Switch from ossl_rand to DRBG rand
authorRich Salz <rsalz@openssl.org>
Thu, 3 Aug 2017 13:23:28 +0000 (09:23 -0400)
committerRich Salz <rsalz@openssl.org>
Thu, 3 Aug 2017 13:23:28 +0000 (09:23 -0400)
commit75e2c877650444fb829547bdb58d46eb1297bc1a
tree67ad6280bccdca4ae95cc269b1994ea4c1557aa7
parent67dc995eaf538ea309c6292a1a5073465201f55b
Switch from ossl_rand to DRBG rand

If RAND_add wraps around, XOR with existing. Add test to drbgtest that
does the wrap-around.

Re-order seeding and stop after first success.

Add RAND_poll_ex()

Use the DF and therefore lower RANDOMNESS_NEEDED.  Also, for child DRBG's,
mix in the address as the personalization bits.

Centralize the entropy callbacks, from drbg_lib to rand_lib.
(Conceptually, entropy is part of the enclosing application.)
Thanks to Dr. Matthias St Pierre for the suggestion.

Various code cleanups:
    -Make state an enum; inline RANDerr calls.
    -Add RAND_POLL_RETRIES (thanks Pauli for the idea)
    -Remove most RAND_seed calls from rest of library
    -Rename DRBG_CTX to RAND_DRBG, etc.
    -Move some code from drbg_lib to drbg_rand; drbg_lib is now only the
     implementation of NIST DRBG.
    -Remove blocklength

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/4019)
34 files changed:
apps/speed.c
crypto/bn/bn_rand.c
crypto/dsa/dsa_asn1.c
crypto/ec/ecdsa_ossl.c
crypto/evp/evp_pkey.c
crypto/pem/pem_lib.c
crypto/rand/build.info
crypto/rand/drbg_lib.c
crypto/rand/drbg_rand.c
crypto/rand/ossl_rand.c [deleted file]
crypto/rand/rand_egd.c
crypto/rand/rand_lcl.h
crypto/rand/rand_lib.c
crypto/rand/rand_unix.c
crypto/rand/rand_vms.c
crypto/rand/rand_win.c
crypto/rsa/rsa_crpt.c
doc/man3/RAND_add.pod
include/internal/rand.h
include/openssl/ossl_typ.h
include/openssl/rand.h
ssl/statem/statem.c
test/bntest.c
test/build.info
test/dhtest.c
test/drbgtest.c
test/dsatest.c
test/ecdsatest.c
test/ectest.c
test/randtest.c [deleted file]
test/recipes/05-test_rand.t
test/ssltest_old.c
util/libcrypto.num
util/private.num