summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/rsaref/rsaref.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/rsaref/rsaref.c')
-rw-r--r--crypto/openssl/rsaref/rsaref.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/openssl/rsaref/rsaref.c b/crypto/openssl/rsaref/rsaref.c
index 7677eb9..ae70feb 100644
--- a/crypto/openssl/rsaref/rsaref.c
+++ b/crypto/openssl/rsaref/rsaref.c
@@ -279,7 +279,8 @@ int RSA_ref_public_encrypt(int len, unsigned char *from, unsigned char *to,
R_GetRandomBytesNeeded((unsigned int *)&i,&rnd);
while (i > 0)
{
- RAND_bytes(buf,16);
+ if (RAND_bytes(buf,16) <= 0)
+ goto err;
R_RandomUpdate(&rnd,buf,(unsigned int)((i>16)?16:i));
i-=16;
}
@@ -298,4 +299,10 @@ err:
memset(&rnd,0,sizeof(rnd));
return(outlen);
}
+#else /* !NO_RSA */
+
+# if PEDANTIC
+static void *dummy=&dummy;
+# endif
+
#endif
OpenPOWER on IntegriCloud