Attempt to move asn.c RSA API defs into asn_public.h, since ASN is not in FIPS boundary.

This commit is contained in:
David Garske
2021-07-30 08:24:18 -07:00
parent c69d6d2491
commit 5465d40ee3
3 changed files with 8 additions and 8 deletions

View File

@ -16859,8 +16859,6 @@ static int test_wc_RsaKeyToPublicDer (void)
} }
} }
#if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \
(!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION != 2)))
if (ret == 0) { if (ret == 0) {
/* test getting size only */ /* test getting size only */
ret = wc_RsaKeyToPublicDer_ex(&key, NULL, derLen, 0); ret = wc_RsaKeyToPublicDer_ex(&key, NULL, derLen, 0);
@ -16875,7 +16873,6 @@ static int test_wc_RsaKeyToPublicDer (void)
ret = WOLFSSL_FATAL_ERROR; ret = WOLFSSL_FATAL_ERROR;
} }
} }
#endif
#ifndef HAVE_USER_RSA #ifndef HAVE_USER_RSA
/* Pass in bad args. */ /* Pass in bad args. */

View File

@ -521,8 +521,15 @@ WOLFSSL_API void wc_FreeDer(DerBuffer** pDer);
#if !defined(HAVE_USER_RSA) #if !defined(HAVE_USER_RSA)
WOLFSSL_API int wc_RsaPublicKeyDecode_ex(const byte* input, word32* inOutIdx, WOLFSSL_API int wc_RsaPublicKeyDecode_ex(const byte* input, word32* inOutIdx,
word32 inSz, const byte** n, word32* nSz, const byte** e, word32* eSz); 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) || \
(!defined(HAVE_FIPS_VERSION) || (HAVE_FIPS_VERSION > 2)))
WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
#endif
#endif #endif
WOLFSSL_API int wc_RsaPublicKeyDerSize(RsaKey* key, int with_header); WOLFSSL_API int wc_RsaPublicKeyDerSize(RsaKey* key, int with_header);
WOLFSSL_API int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
int with_header);
#endif #endif
#ifndef NO_DSA #ifndef NO_DSA

View File

@ -214,7 +214,7 @@ struct RsaKey {
#define WC_RSAKEY_TYPE_DEFINED #define WC_RSAKEY_TYPE_DEFINED
#endif #endif
#endif /*HAVE_FIPS */ #endif /* HAVE_FIPS */
WOLFSSL_API int wc_InitRsaKey(RsaKey* key, void* heap); WOLFSSL_API int wc_InitRsaKey(RsaKey* key, void* heap);
WOLFSSL_API int wc_InitRsaKey_ex(RsaKey* key, void* heap, int devId); WOLFSSL_API int wc_InitRsaKey_ex(RsaKey* key, void* heap, int devId);
@ -355,10 +355,6 @@ WOLFSSL_API int wc_RsaExportKey(RsaKey* key,
byte* p, word32* pSz, byte* p, word32* pSz,
byte* q, word32* qSz); byte* q, word32* qSz);
WOLFSSL_API int wc_RsaKeyToPublicDer(RsaKey* key, byte* output, word32 inLen);
WOLFSSL_API int wc_RsaKeyToPublicDer_ex(RsaKey* key, byte* output, word32 inLen,
int with_header);
#ifdef WOLFSSL_KEY_GEN #ifdef WOLFSSL_KEY_GEN
WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng); WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng);
WOLFSSL_API int wc_CheckProbablePrime_ex(const byte* p, word32 pSz, WOLFSSL_API int wc_CheckProbablePrime_ex(const byte* p, word32 pSz,