X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=rsaref%2Frsaref.c;h=ae70feb3e9b0e246d07d0891ef0087cb34c96d61;hb=09483c58e3b21841d2761ce90b1f12b24f814881;hp=7677eb9fce9fa10c9f7c2abf4e082f32d6a5fbde;hpb=bc3baeaccafe289f06c8bce1d3eeac661ebc15c4;p=oweals%2Fopenssl.git diff --git a/rsaref/rsaref.c b/rsaref/rsaref.c index 7677eb9fce..ae70feb3e9 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; } @@ -298,4 +299,10 @@ err: memset(&rnd,0,sizeof(rnd)); return(outlen); } +#else /* !NO_RSA */ + +# if PEDANTIC +static void *dummy=&dummy; +# endif + #endif