From: Pauli Date: Wed, 17 Feb 2021 01:54:48 +0000 (+1000) Subject: test: make the DRBG test work without RAND_METHOD support. X-Git-Tag: openssl-3.0.0-alpha13~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d994ce12058d80f1f04257c30f89d04d5f6399e1;p=thirdparty%2Fopenssl.git test: make the DRBG test work without RAND_METHOD support. Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/13652) --- diff --git a/test/drbgtest.c b/test/drbgtest.c index bedc62ca2ca..1276f726cca 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))