]> git.ipfire.org Git - thirdparty/openssl.git/commit
test/drbgtest.c: Fix error check test
authorVitezslav Cizek <vcizek@suse.com>
Fri, 10 Jul 2020 19:33:00 +0000 (21:33 +0200)
committerDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>
Wed, 22 Jul 2020 23:16:50 +0000 (01:16 +0200)
commit72a9868fe53e01bfe912a56b56e4474ff6e0a063
tree5cd8fb6ab7df34f7db0a6ebe05ebd17c72f73756
parent48fc6cd59c6d4a8f6ecd57d85d6ef4e6373ff147
test/drbgtest.c: Fix error check test

The condition in test_error_checks() was inverted, so the test succeeded
as long as error_check() failed. Incidently, error_check() contained
several bugs that assured it always failed, thus giving overall drbg
test success.

Remove the broken explicit zero check.
RAND_DRBG_uninstantiate() cleanses the data via drbg_ctr_uninstantiate(),
but right after that it resets drbg->data.ctr using RAND_DRBG_set(),
so TEST_mem_eq(zero, sizeof(drbg->data)) always failed.

(backport from https://github.com/openssl/openssl/pull/11195)

Signed-off-by: Vitezslav Cizek <vcizek@suse.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/12517)
test/drbgtest.c