From e0a675e211302257256ed80ea1edeff329c9b9e9 Mon Sep 17 00:00:00 2001 From: Todd Short Date: Tue, 24 May 2016 08:55:12 -0400 Subject: [PATCH] Clean up RAND_bytes() calls When RAND_pseudo_bytes() was replaced with RAND_bytes(), this case was not reduced to a simple RAND_bytes() call. Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1117) --- crypto/bn/bn_rand.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c index 1dd07e789c..9c0a4eef06 100644 --- a/crypto/bn/bn_rand.c +++ b/crypto/bn/bn_rand.c @@ -44,13 +44,8 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) time(&tim); RAND_add(&tim, sizeof(tim), 0.0); - if (pseudorand) { - if (RAND_bytes(buf, bytes) <= 0) - goto err; - } else { - if (RAND_bytes(buf, bytes) <= 0) - goto err; - } + if (RAND_bytes(buf, bytes) <= 0) + goto err; if (pseudorand == 2) { /* -- 2.34.1