summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-02-17 11:54:48 +1000
committerPauli <ppzgs1@gmail.com>2021-02-23 23:24:41 +1000
commitd994ce12058d80f1f04257c30f89d04d5f6399e1 (patch)
treeaf82fa639c5bb71864a80fa1ebe9c8bcac05e12b
parentb3ab537b3a4098857d2039d1d745fee0ea5a96e3 (diff)
downloadopenssl-new-d994ce12058d80f1f04257c30f89d04d5f6399e1.tar.gz
test: make the DRBG test work without RAND_METHOD support.
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13652)
-rw-r--r--test/drbgtest.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/drbgtest.c b/test/drbgtest.c
index bedc62ca2c..1276f726cc 100644
--- a/test/drbgtest.c
+++ b/test/drbgtest.c
@@ -47,6 +47,7 @@
*/
static int gen_bytes(EVP_RAND_CTX *drbg, unsigned char *buf, int num)
{
+#ifndef OPENSSL_NO_DEPRECATED_3_0
const RAND_METHOD *meth = RAND_get_rand_method();
if (meth != NULL && meth != RAND_OpenSSL()) {
@@ -54,6 +55,7 @@ static int gen_bytes(EVP_RAND_CTX *drbg, unsigned char *buf, int num)
return meth->bytes(buf, num);
return -1;
}
+#endif
if (drbg != NULL)
return EVP_RAND_generate(drbg, buf, num, 0, 0, NULL, 0);
@@ -551,9 +553,11 @@ static int test_rand_reseed(void)
if (crngt_skip())
return TEST_skip("CRNGT cannot be disabled");
+#ifndef OPENSSL_NO_DEPRECATED_3_0
/* Check whether RAND_OpenSSL() is the default method */
if (!TEST_ptr_eq(RAND_get_rand_method(), RAND_OpenSSL()))
return 0;
+#endif
/* All three DRBGs should be non-null */
if (!TEST_ptr(primary = RAND_get0_primary(NULL))