Fix no-dh and no-dsa
authorMatt Caswell <matt@openssl.org>
Fri, 24 Jul 2020 11:04:00 +0000 (12:04 +0100)
committerPauli <paul.dale@oracle.com>
Sun, 26 Jul 2020 06:01:15 +0000 (16:01 +1000)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12525)

test/evp_libctx_test.c

index a9f665842a6463b8428e6634d7c2317f22db4c4b..395c5d99b5c6f55ec1a0f08d3e76ebfa5e275c63 100644 (file)
@@ -23,6 +23,7 @@
 #include <openssl/evp.h>
 #include <openssl/provider.h>
 #include <openssl/dsa.h>
+#include <openssl/dh.h>
 #include <openssl/safestack.h>
 #include "testutil.h"
 #include "internal/nelem.h"
@@ -57,7 +58,7 @@ const OPTIONS *test_get_options(void)
     return test_options;
 }
 
-#if !defined(OPENSSL_NO_DSA) || !defined(OPENSSL_NO_DH)
+#ifndef OPENSSL_NO_DH
 static const char *getname(int id)
 {
     const char *name[] = {"p", "q", "g" };
@@ -68,7 +69,11 @@ static const char *getname(int id)
 }
 #endif
 
-#ifndef OPENSSL_NO_DSA
+/*
+ * We're using some DH specific values in this test, so we skip compilation if
+ * we're in a no-dh build.
+ */
+#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DH)
 
 static int test_dsa_param_keygen(int tstid)
 {
@@ -315,7 +320,7 @@ int setup_tests(void)
     if (!TEST_ptr(libprov))
         return 0;
 
-#ifndef OPENSSL_NO_DSA
+#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DH)
     ADD_ALL_TESTS(test_dsa_param_keygen, 3 * 3 * 3);
 #endif
 #ifndef OPENSSL_NO_DH