Fix no-dh

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)
This commit is contained in:
Matt Caswell 2019-12-18 11:14:29 +00:00
parent 501fcfb8cf
commit 285c691304
3 changed files with 9 additions and 1 deletions

View 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 }
};

View 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

View 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;
}