diff --git a/cyassl/ctaocrypt/asn.h b/cyassl/ctaocrypt/asn.h index 58c75803d..c27c144dd 100644 --- a/cyassl/ctaocrypt/asn.h +++ b/cyassl/ctaocrypt/asn.h @@ -46,3 +46,4 @@ #endif /* CTAO_CRYPT_ASN_H */ #endif /* !NO_ASN */ + diff --git a/cyassl/ctaocrypt/rsa.h b/cyassl/ctaocrypt/rsa.h index 335a98ddd..72f8dc5d0 100644 --- a/cyassl/ctaocrypt/rsa.h +++ b/cyassl/ctaocrypt/rsa.h @@ -28,6 +28,7 @@ /* includes for their compatibility */ #include #include +#include #define InitRsaKey wc_InitRsaKey #define FreeRsaKey wc_FreeRsaKey @@ -50,10 +51,6 @@ #define RsaFreeCavium wc_RsaFreeCavium #endif - #define RsaPrivateKeyDecode wc_RsaPrivateKeyDecode - #define RsaPublicKeyDecode wc_RsaPublicKeyDecode - #define RsaPublicKeyDecodeRaw wc_RsaPublicKeyDecodeRaw - #endif /* CTAO_CRYPT_RSA_H */ #endif /* NO_RSA */ diff --git a/cyassl/ctaocrypt/settings_comp.h b/cyassl/ctaocrypt/settings_comp.h index 9b8e519a2..041c6594f 100644 --- a/cyassl/ctaocrypt/settings_comp.h +++ b/cyassl/ctaocrypt/settings_comp.h @@ -22,10 +22,17 @@ #ifndef CTAO_CRYPT_SETTINGS_C_H #define CTAO_CRYPT_SETTINGS_C_H -/* asn.c compatibility */ -#define RsaPrivateKeyDecode wc_RsaPrivateKeyDecode -#define RsaPublicKeyDecode wc_RsaPublicKeyDecode -#define RsaPublicKeyDecodeRaw wc_RsaPublicKeyDecodeRaw + +/* since fips overrides rsa.h map compatibility here */ +#if !defined(NO_RSA) + #ifdef WOLFSSL_KEY_GEN + #define RsaKeyToDer wc_RsaKeyToDer + #endif + + #define RsaPrivateKeyDecode wc_RsaPrivateKeyDecode + #define RsaPublicKeyDecode wc_RsaPublicKeyDecode + #define RsaPublicKeyDecodeRaw wc_RsaPublicKeyDecodeRaw +#endif /* have rsa and HAVE_FIPS */ /* Macro redefinitions for compatibility */ #if defined(WOLFSSL_SHA512) && !defined(CYASSL_SHA512) @@ -40,6 +47,9 @@ #if defined(NO_WOLFSSL_MEMORY) && !defined(NO_CYASSL_MEMORY) #define NO_CYASSL_MEMORY #endif +#ifdef WOLFSSL_KEY_GEN + #define CYASSL_KEY_GEN +#endif #endif /* CTAO_CRYPT_SETTINGS_C_H */ diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index eb5562fe5..80971953e 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -100,12 +100,6 @@ int wc_RsaFlattenPublicKey(RsaKey* key, byte* a, word32* aSz, byte* b, { return MakeRsaKey(key, size, e, rng); } - - - int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen) - { - return RsaKeyToDer(key, output, inLen); - } #endif