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)))))