ifdef cleanup, part 4a: '#ifdef undef'
[openssl.git] / demos / engines / rsaref / rsaref.c
index 498cc7098fe5f165883e5c1cc236c080848e5e85..b6429de1a786576f8c39d8c04cb5eb9f62b88e32 100644 (file)
@@ -324,31 +324,6 @@ static int RSAref_bn2bin(BIGNUM *from, unsigned char *to, int max)
     return (1);
 }
 
-#ifdef undef
-/* unsigned char *from:  [max]    */
-static BIGNUM *RSAref_bin2bn(unsigned char *from, BIGNUM *to, int max)
-{
-    int i;
-    BIGNUM *ret;
-
-    for (i = 0; i < max; i++)
-        if (from[i])
-            break;
-
-    ret = BN_bin2bn(&(from[i]), max - i, to);
-    return (ret);
-}
-
-static int RSAref_Public_ref2eay(RSArefPublicKey * from, RSA *to)
-{
-    to->n = RSAref_bin2bn(from->m, NULL, RSAref_MAX_LEN);
-    to->e = RSAref_bin2bn(from->e, NULL, RSAref_MAX_LEN);
-    if ((to->n == NULL) || (to->e == NULL))
-        return (0);
-    return (1);
-}
-#endif
-
 static int RSAref_Public_eay2ref(RSA *from, R_RSA_PUBLIC_KEY * to)
 {
     to->bits = BN_num_bits(from->n);
@@ -359,33 +334,6 @@ static int RSAref_Public_eay2ref(RSA *from, R_RSA_PUBLIC_KEY * to)
     return (1);
 }
 
-#ifdef undef
-static int RSAref_Private_ref2eay(RSArefPrivateKey * from, RSA *to)
-{
-    if ((to->n = RSAref_bin2bn(from->m, NULL, RSAref_MAX_LEN)) == NULL)
-        return (0);
-    if ((to->e = RSAref_bin2bn(from->e, NULL, RSAref_MAX_LEN)) == NULL)
-        return (0);
-    if ((to->d = RSAref_bin2bn(from->d, NULL, RSAref_MAX_LEN)) == NULL)
-        return (0);
-    if ((to->p =
-         RSAref_bin2bn(from->prime[0], NULL, RSAref_MAX_PLEN)) == NULL)
-        return (0);
-    if ((to->q =
-         RSAref_bin2bn(from->prime[1], NULL, RSAref_MAX_PLEN)) == NULL)
-        return (0);
-    if ((to->dmp1 = RSAref_bin2bn(from->pexp[0], NULL, RSAref_MAX_PLEN))
-        == NULL)
-        return (0);
-    if ((to->dmq1 = RSAref_bin2bn(from->pexp[1], NULL, RSAref_MAX_PLEN))
-        == NULL)
-        return (0);
-    if ((to->iqmp = RSAref_bin2bn(from->coef, NULL, RSAref_MAX_PLEN)) == NULL)
-        return (0);
-    return (1);
-}
-#endif
-
 static int RSAref_Private_eay2ref(RSA *from, R_RSA_PRIVATE_KEY * to)
 {
     to->bits = BN_num_bits(from->n);