diff options
author | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2018-10-22 18:05:14 +0200 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2018-11-08 16:32:30 +0100 |
commit | c39df745b08d9d9e8ae323a2b017db1961f5c0b8 (patch) | |
tree | 5e69581e1e8b3eb282297f8f2a51414e617fc3ed /test | |
parent | efd67e01a5471f9b0745018d7707b69876b070f6 (diff) |
Test: link drbgtest statically against libcrypto
and remove duplicate rand_drbg_seedlen() implementation again.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7462)
(cherry picked from commit 1c615e4ce97715ae3af9255bc57be32a49687966)
Diffstat (limited to 'test')
-rw-r--r-- | test/build.info | 2 | ||||
-rw-r--r-- | test/drbgtest.c | 40 |
2 files changed, 1 insertions, 41 deletions
diff --git a/test/build.info b/test/build.info index b2a82a74a9..b6bb711c8b 100644 --- a/test/build.info +++ b/test/build.info @@ -341,7 +341,7 @@ INCLUDE_MAIN___test_libtestutil_OLB = /INCLUDE=MAIN SOURCE[drbgtest]=drbgtest.c INCLUDE[drbgtest]=../include - DEPEND[drbgtest]=../libcrypto libtestutil.a + DEPEND[drbgtest]=../libcrypto.a libtestutil.a SOURCE[drbg_cavs_test]=drbg_cavs_test.c drbg_cavs_data.c INCLUDE[drbg_cavs_test]=../include . .. diff --git a/test/drbgtest.c b/test/drbgtest.c index 755f0b314c..b690475e0c 100644 --- a/test/drbgtest.c +++ b/test/drbgtest.c @@ -892,46 +892,6 @@ static int test_multi_thread(void) } #endif -#ifdef OPENSSL_RAND_SEED_NONE -/* - * Calculates the minimum buffer length which needs to be - * provided to RAND_seed() in order to successfully - * instantiate the DRBG. - * - * Copied from rand_drbg_seedlen() in rand_drbg.c - */ -static size_t rand_drbg_seedlen(RAND_DRBG *drbg) -{ - /* - * If no os entropy source is available then RAND_seed(buffer, bufsize) - * is expected to succeed if and only if the buffer length satisfies - * the following requirements, which follow from the calculations - * in RAND_DRBG_instantiate(). - */ - size_t min_entropy = drbg->strength; - size_t min_entropylen = drbg->min_entropylen; - - /* - * Extra entropy for the random nonce in the absence of a - * get_nonce callback, see comment in RAND_DRBG_instantiate(). - */ - if (drbg->min_noncelen > 0 && drbg->get_nonce == NULL) { - min_entropy += drbg->strength / 2; - min_entropylen += drbg->min_noncelen; - } - - /* - * Convert entropy requirement from bits to bytes - * (dividing by 8 without rounding upwards, because - * all entropy requirements are divisible by 8). - */ - min_entropy >>= 3; - - /* Return a value that satisfies both requirements */ - return min_entropy > min_entropylen ? min_entropy : min_entropylen; -} -#endif /*OPENSSL_RAND_SEED_NONE*/ - /* * Test that instantiation with RAND_seed() works as expected * |