From a2b18e657ea1a932d125154f4e13ab2258796d90 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Sat, 24 Jan 2015 10:57:19 -0500 Subject: ifdef cleanup, part 4a: '#ifdef undef' This removes all code surrounded by '#ifdef undef' One case is left: memmove() replaced by open-coded for loop, in crypto/stack/stack.c That needs further review. Also removed a couple of instances of /* dead code */ if I saw them while doing the main removal. Reviewed-by: Matt Caswell --- demos/engines/rsaref/rsaref.c | 52 ------------------------------------------- 1 file changed, 52 deletions(-) (limited to 'demos/engines/rsaref') diff --git a/demos/engines/rsaref/rsaref.c b/demos/engines/rsaref/rsaref.c index 498cc7098f..b6429de1a7 100644 --- a/demos/engines/rsaref/rsaref.c +++ b/demos/engines/rsaref/rsaref.c @@ -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); -- cgit v1.2.3