Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssl/dist/crypto/rand Re-check the en...



details:   https://anonhg.NetBSD.org/src/rev/d2af6819ac7b
branches:  trunk
changeset: 788916:d2af6819ac7b
user:      tls <tls%NetBSD.org@localhost>
date:      Sun Jul 28 14:13:29 2013 +0000

description:
Re-check the entropy level after we call RAND_poll(), so that we do
not continuously suck data out of /dev/urandom if we receive a stream
of requests larger than the initial-entropy threshold (hi Roland!).

diffstat:

 crypto/external/bsd/openssl/dist/crypto/rand/md_rand.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r d1c96521c0e1 -r d2af6819ac7b crypto/external/bsd/openssl/dist/crypto/rand/md_rand.c
--- a/crypto/external/bsd/openssl/dist/crypto/rand/md_rand.c    Sun Jul 28 14:02:56 2013 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/rand/md_rand.c    Sun Jul 28 14:13:29 2013 +0000
@@ -397,6 +397,11 @@
                RAND_poll();
                ok = (entropy >= ENTROPY_NEEDED);
 
+               }
+
+       if (!ok)
+               {
+
                /* If the PRNG state is not yet unpredictable, then seeing
                 * the PRNG output may help attackers to determine the new
                 * state; thus we have to decrease the entropy estimate.



Home | Main Index | Thread Index | Old Index