From 5b003918ef11f87d974d2c66944c649117e88d7e Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 18 Dec 2017 11:10:12 -0800 Subject: [PATCH] Fix for #ifdef issue causing some X509 functions to be unavailable when DH and ECC were disabled. Fix for `HashAlgoToType` not being available if building with DH and ECC disabled and RSA PSS enabled. --- src/internal.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/internal.c b/src/internal.c index 30422bcde..cc90de0e5 100644 --- a/src/internal.c +++ b/src/internal.c @@ -2699,7 +2699,8 @@ static INLINE void DecodeSigAlg(const byte* input, byte* hashAlgo, byte* hsType) } #endif /* !NO_WOLFSSL_SERVER || !NO_CERTS */ -#if !defined(NO_DH) || defined(HAVE_ECC) +#if !defined(NO_DH) || defined(HAVE_ECC) || \ + (!defined(NO_RSA) && defined(WC_RSA_PSS)) static enum wc_HashType HashAlgoToType(int hashAlgo) { @@ -2729,9 +2730,11 @@ static enum wc_HashType HashAlgoToType(int hashAlgo) return WC_HASH_TYPE_NONE; } -#ifndef NO_CERTS +#endif /* !NO_DH || HAVE_ECC || (!NO_RSA && WC_RSA_PSS) */ +#ifndef NO_CERTS + void InitX509Name(WOLFSSL_X509_NAME* name, int dynamicFlag) { (void)dynamicFlag; @@ -2840,10 +2843,8 @@ void FreeX509(WOLFSSL_X509* x509) if (x509->altNames) FreeAltNames(x509->altNames, x509->heap); } -#endif /* !NO_CERTS */ -#endif /* !NO_DH || HAVE_ECC */ -#ifndef NO_CERTS + /* Encode the signature algorithm into buffer. * * hashalgo The hash algorithm.