diff options
Diffstat (limited to 'rsaref/rsaref.c')
-rw-r--r-- | rsaref/rsaref.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rsaref/rsaref.c b/rsaref/rsaref.c index 55cebc8..ae70feb 100644 --- a/rsaref/rsaref.c +++ b/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; } |