The branch master has been updated
       via  4c78ba5918daf7965759a720687c58d2ebb0eb1f (commit)
       via  78632b6633cf8af21a4fba2091f3e771e3ab40fb (commit)
      from  cf37aaa335965902c6a022bc3c3e0162f59c0f3a (commit)


- Log -----------------------------------------------------------------
commit 4c78ba5918daf7965759a720687c58d2ebb0eb1f
Author: Dr. Stephen Henson <st...@openssl.org>
Date:   Sat Aug 5 12:04:10 2017 +0100

    Add entropy sanity check
    
    Reviewed-by: Kurt Roeckx <k...@roeckx.be>
    (Merged from https://github.com/openssl/openssl/pull/4092)

commit 78632b6633cf8af21a4fba2091f3e771e3ab40fb
Author: Dr. Stephen Henson <st...@openssl.org>
Date:   Sat Aug 5 11:19:27 2017 +0100

    Set randomness buffer pointer in get_entropy calls.
    
    Reviewed-by: Kurt Roeckx <k...@roeckx.be>
    (Merged from https://github.com/openssl/openssl/pull/4092)

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

Summary of changes:
 crypto/rand/drbg_rand.c | 5 +++++
 crypto/rand/rand_lib.c  | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/crypto/rand/drbg_rand.c b/crypto/rand/drbg_rand.c
index 06f8aff..934679e 100644
--- a/crypto/rand/drbg_rand.c
+++ b/crypto/rand/drbg_rand.c
@@ -243,6 +243,9 @@ int ctr_instantiate(RAND_DRBG *drbg,
 {
     RAND_DRBG_CTR *ctr = &drbg->ctr;
 
+    if (ent == NULL)
+        return 0;
+
     memset(ctr->K, 0, sizeof(ctr->K));
     memset(ctr->V, 0, sizeof(ctr->V));
     AES_set_encrypt_key(ctr->K, drbg->strength, &ctr->ks);
@@ -254,6 +257,8 @@ int ctr_reseed(RAND_DRBG *drbg,
                const unsigned char *ent, size_t entlen,
                const unsigned char *adin, size_t adinlen)
 {
+    if (ent == NULL)
+        return 0;
     ctr_update(drbg, ent, entlen, adin, adinlen, NULL, 0);
     return 1;
 }
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index d6cb717..79b2cce 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -143,6 +143,7 @@ size_t drbg_entropy_from_system(RAND_DRBG *drbg,
             memmove(rand_bytes.buff, &rand_bytes.buff[min_len], 
rand_bytes.curr);
     }
     CRYPTO_THREAD_unlock(rand_bytes.lock);
+    *pout = drbg->randomness;
     return min_len;
 }
 
@@ -163,6 +164,7 @@ size_t drbg_entropy_from_parent(RAND_DRBG *drbg,
     if (st == 0)
         return 0;
     drbg->filled = 1;
+    *pout = drbg->randomness;
     return min_len;
 }
 
_____
openssl-commits mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits

Reply via email to