diff options
author | Pauli <paul.dale@oracle.com> | 2018-12-21 03:03:19 +0100 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2019-02-08 07:13:47 +0100 |
commit | b1522fa5ef676b7af0128eab3eee608af3416182 (patch) | |
tree | fc973771cba1c5379cf3179499f7c39191480bf1 /test/drbgtest.c | |
parent | test/drbgtest.c: call OPENSSL_thread_stop() explicitly (diff) | |
download | openssl-b1522fa5ef676b7af0128eab3eee608af3416182.tar.xz openssl-b1522fa5ef676b7af0128eab3eee608af3416182.zip |
Address a bug in the DRBG tests where the reseeding wasn't properly
reinstantiating the DRBG.
Bug reported by Doug Gibbons.
Reviewed-by: Paul Yang <yang.yang@baishancloud.com>
(Merged from https://github.com/openssl/openssl/pull/8184)
Diffstat (limited to 'test/drbgtest.c')
-rw-r--r-- | test/drbgtest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/drbgtest.c b/test/drbgtest.c index c788f19fc5..362a1d2b49 100644 --- a/test/drbgtest.c +++ b/test/drbgtest.c @@ -429,7 +429,7 @@ static int error_check(DRBG_SELFTEST_DATA *td) */ /* Test explicit reseed with too large additional input */ - if (!init(drbg, td, &t) + if (!instantiate(drbg, td, &t) || RAND_DRBG_reseed(drbg, td->adin, drbg->max_adinlen + 1, 0) > 0) goto err; @@ -440,7 +440,7 @@ static int error_check(DRBG_SELFTEST_DATA *td) goto err; /* Test explicit reseed with too much entropy */ - if (!init(drbg, td, &t)) + if (!instantiate(drbg, td, &t)) goto err; t.entropylen = drbg->max_entropylen + 1; if (!TEST_int_le(RAND_DRBG_reseed(drbg, td->adin, td->adinlen, 0), 0) @@ -448,7 +448,7 @@ static int error_check(DRBG_SELFTEST_DATA *td) goto err; /* Test explicit reseed with too little entropy */ - if (!init(drbg, td, &t)) + if (!instantiate(drbg, td, &t)) goto err; t.entropylen = drbg->min_entropylen - 1; if (!TEST_int_le(RAND_DRBG_reseed(drbg, td->adin, td->adinlen, 0), 0) |