aboutsummaryrefslogtreecommitdiff
path: root/crypto/bn
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2016-05-24 08:55:12 -0400
committerTodd Short <tshort@akamai.com>2016-05-24 08:55:12 -0400
commite0a675e211302257256ed80ea1edeff329c9b9e9 (patch)
tree804030345703355b47471dbf7d99a01580d693e2 /crypto/bn
parent0a618df059d93bf7fe9e3ec92e04db8bc1eeff07 (diff)
downloadopenssl-e0a675e211302257256ed80ea1edeff329c9b9e9.zip
openssl-e0a675e211302257256ed80ea1edeff329c9b9e9.tar.gz
openssl-e0a675e211302257256ed80ea1edeff329c9b9e9.tar.bz2
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 <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1117)
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_rand.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c
index 1dd07e7..9c0a4ee 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) {
/*