]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix: uninstantiation breaks the RAND_DRBG callback mechanism
authorDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>
Mon, 20 Jul 2020 21:21:37 +0000 (23:21 +0200)
committerDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>
Wed, 22 Jul 2020 23:12:48 +0000 (01:12 +0200)
commita27cb956c02220c502449176a8834b1d9643ac23
tree0ee7664718c30eedfea527db19e9aefc0798db72
parentd1768e8298a35fcd8e6e19575e4a9b2e93e4d788
Fix: uninstantiation breaks the RAND_DRBG callback mechanism

The RAND_DRBG callbacks are wrappers around the EVP_RAND callbacks.
During uninstantiation, the EVP_RAND callbacks got lost while the
RAND_DRBG callbacks remained, because RAND_DRBG_uninstantiate()
calls RAND_DRBG_set(), which recreates the EVP_RAND object.
This was causing drbgtest failures.

This commit fixes the problem by adding code to RAND_DRBG_set() for
saving and restoring the EVP_RAND callbacks.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11195)
crypto/rand/drbg_lib.c