]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
test: make the DRBG test work without RAND_METHOD support.
authorPauli <ppzgs1@gmail.com>
Wed, 17 Feb 2021 01:54:48 +0000 (11:54 +1000)
committerPauli <ppzgs1@gmail.com>
Tue, 23 Feb 2021 13:24:41 +0000 (23:24 +1000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13652)

test/drbgtest.c

index bedc62ca2cab39630716678cbd8b4205ecc7f728..1276f726cca4be60b9f720efb4606a7a7cfb8300 100644 (file)
@@ -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))