minor change for the prng
[openssl.git] / rsaref / rsaref.c
index 55cebc8..ae70feb 100644 (file)
@@ -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;
                }