From 6795e1bf21035a8e02458b46b189ce22c7dc2658 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 15 Jun 2022 17:01:30 -0700 Subject: [PATCH] Attempt to fix issue with duplicate prototype `wc_RsaKeyToPublicDer` with FIPS v2 selftest. --- wolfssl/wolfcrypt/asn_public.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wolfssl/wolfcrypt/asn_public.h b/wolfssl/wolfcrypt/asn_public.h index ac55d3be9..bafbd24d6 100644 --- a/wolfssl/wolfcrypt/asn_public.h +++ b/wolfssl/wolfcrypt/asn_public.h @@ -607,7 +607,10 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer); WOLFSSL_API int wc_RsaPublicKeyDecode_ex(const byte* input, word32* inOutIdx, word32 inSz, const byte** n, word32* nSz, const byte** e, word32* eSz); /* For FIPS v1/v2 and selftest this is in rsa.h */ - #if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \ + #if (!defined(HAVE_SELFTEST) || \ + (defined(HAVE_SELFTEST) && defined(WOLFSSL_CERT_GEN) && \ + !defined(WOLFSSL_KEY_GEN))) && \ + (!defined(HAVE_FIPS) || \ !defined(HAVE_FIPS_VERSION) || \ ((HAVE_FIPS_VERSION > 2) && \ (! ((HAVE_FIPS_VERSION == 5) && (HAVE_FIPS_VERSION_MINOR == 0)))))