[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Tue May 24 14:50:16 UTC 2016


The branch master has been updated
       via  e0a675e211302257256ed80ea1edeff329c9b9e9 (commit)
      from  0a618df059d93bf7fe9e3ec92e04db8bc1eeff07 (commit)


- Log -----------------------------------------------------------------
commit e0a675e211302257256ed80ea1edeff329c9b9e9
Author: Todd Short <tshort at akamai.com>
Date:   Tue May 24 08:55:12 2016 -0400

    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 at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/1117)

-----------------------------------------------------------------------

Summary of changes:
 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 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) {
         /*


More information about the openssl-commits mailing list