Fix for FIPS v1 CAVP case so the wc_RsaExportKey and wc_CheckProbablePrime functions are available. Cleanup to remove unused ERROR_OUT.

This commit is contained in:
David Garske
2018-08-13 06:25:55 -06:00
parent bb574d28b2
commit 80e46253d9

View File

@ -200,8 +200,6 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* a, word32* aSz, byte* b,
#include <wolfcrypt/src/misc.c>
#endif
#define ERROR_OUT(x) { ret = (x); goto done;}
enum {
RSA_STATE_NONE = 0,
@ -2616,6 +2614,9 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* e, word32* eSz, byte* n,
}
#endif /* HAVE_FIPS */
static int RsaGetValue(mp_int* in, byte* out, word32* outSz)
{
word32 sz;
@ -2890,7 +2891,7 @@ int wc_CheckProbablePrime(const byte* pRaw, word32 pRawSz,
eRaw, eRawSz, nlen, isPrime, NULL);
}
#if !defined(HAVE_FIPS) || (defined(HAVE_FIPS) && (HAVE_FIPS_VERSION >= 2))
/* Make an RSA key for size bits, with e specified, 65537 is a good e */
int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng)
{
@ -3087,6 +3088,7 @@ int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng)
return 0;
}
#endif /* !FIPS || FIPS_VER >= 2 */
#endif /* WOLFSSL_KEY_GEN */
@ -3105,7 +3107,4 @@ int wc_RsaSetRNG(RsaKey* key, WC_RNG* rng)
#endif /* WC_RSA_BLINDING */
#undef ERROR_OUT
#endif /* HAVE_FIPS */
#endif /* NO_RSA */