Fix no-dh
authorMatt Caswell <matt@openssl.org>
Wed, 18 Dec 2019 11:14:29 +0000 (11:14 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 23 Dec 2019 10:22:21 +0000 (10:22 +0000)
The new serializer code broke no-dh builds so we add some more guards to fix it.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/10644)

providers/defltprov.c
providers/implementations/serializers/build.info
test/evp_pkey_provided_test.c

index b8e96f9..51cd2b9 100644 (file)
@@ -399,6 +399,7 @@ static const OSSL_ALGORITHM deflt_serializer[] = {
     { "RSA", "default=yes,format=pem,type=public",
       rsa_pub_pem_serializer_functions },
 
+#ifndef OPENSSL_NO_DH
     { "DH", "default=yes,format=text,type=private",
       dh_priv_text_serializer_functions },
     { "DH", "default=yes,format=text,type=public",
@@ -417,6 +418,7 @@ static const OSSL_ALGORITHM deflt_serializer[] = {
       dh_pub_pem_serializer_functions },
     { "DH", "default=yes,format=pem,type=domainparams",
       dh_param_pem_serializer_functions },
+#endif
 
     { NULL, NULL, NULL }
 };
index 43bdee6..f92437e 100644 (file)
@@ -8,5 +8,7 @@ $DSA_GOAL=../../libimplementations.a
 
 SOURCE[$SERIALIZER_GOAL]=serializer_common.c
 SOURCE[$RSA_GOAL]=serializer_rsa.c serializer_rsa_priv.c serializer_rsa_pub.c
-SOURCE[$DH_GOAL]=serializer_dh.c serializer_dh_priv.c serializer_dh_pub.c serializer_dh_param.c
+IF[{- !$disabled{dh} -}]
+  SOURCE[$DH_GOAL]=serializer_dh.c serializer_dh_priv.c serializer_dh_pub.c serializer_dh_param.c
+ENDIF
 SOURCE[$DSA_GOAL]=serializer_dsa.c serializer_dsa_priv.c serializer_dsa_pub.c serializer_dsa_param.c
index 6dcd0fe..c38f79c 100644 (file)
@@ -139,6 +139,7 @@ static int test_fromdata_rsa(void)
     return ret;
 }
 
+#ifndef OPENSSL_NO_DH
 /* Array indexes used in test_fromdata_dh */
 #define PRIV_KEY        0
 #define PUB_KEY         1
@@ -187,10 +188,13 @@ static int test_fromdata_dh(void)
 
     return ret;
 }
+#endif
 
 int setup_tests(void)
 {
     ADD_TEST(test_fromdata_rsa);
+#ifndef OPENSSL_NO_DH
     ADD_TEST(test_fromdata_dh);
+#endif
     return 1;
 }