diff --git a/examples/configs/user_settings_arduino.h b/examples/configs/user_settings_arduino.h index 2639bfc584c..57dfa6b3630 100644 --- a/examples/configs/user_settings_arduino.h +++ b/examples/configs/user_settings_arduino.h @@ -78,7 +78,7 @@ #define NO_MAIN_DRIVER #define WOLFSSL_NO_SP - #define WOLFSSL_NO_SIG_WRAPPER + #define NO_SIG_WRAPPER #define TFM_TIMING_RESISTANT #undef WOLFSSL_DTLS diff --git a/wolfcrypt/src/signature.c b/wolfcrypt/src/signature.c index 8e1c10f0529..29550c98dcc 100644 --- a/wolfcrypt/src/signature.c +++ b/wolfcrypt/src/signature.c @@ -32,14 +32,7 @@ #include #endif -/* If ECC and RSA are disabled then disable signature wrapper */ -#if (!defined(HAVE_ECC) || (defined(HAVE_ECC) && !defined(HAVE_ECC_SIGN) \ - && !defined(HAVE_ECC_VERIFY))) && defined(NO_RSA) - #undef NO_SIG_WRAPPER - #define NO_SIG_WRAPPER -#endif - -/* Signature wrapper disabled check */ +/* Signature wrapper disabled check (NO_SIG_WRAPPER set by signature.h) */ #ifndef NO_SIG_WRAPPER #if !defined(NO_RSA) && defined(NO_ASN) diff --git a/wolfssl/wolfcrypt/signature.h b/wolfssl/wolfcrypt/signature.h index e0360722592..246accd4fd7 100644 --- a/wolfssl/wolfcrypt/signature.h +++ b/wolfssl/wolfcrypt/signature.h @@ -35,6 +35,13 @@ extern "C" { #endif +/* If ECC and RSA are disabled then disable signature wrapper */ +#if (!defined(HAVE_ECC) || (defined(HAVE_ECC) && !defined(HAVE_ECC_SIGN) \ + && !defined(HAVE_ECC_VERIFY))) && defined(NO_RSA) + #undef NO_SIG_WRAPPER + #define NO_SIG_WRAPPER +#endif + /* Minimum hash strength accepted by the wc_SignatureVerify/Generate * convenience APIs. Default is SHA-256 to keep MD5 and SHA-1 (both with * known collision attacks) out of new code. Define WC_SIG_MIN_HASH_TYPE @@ -52,6 +59,9 @@ enum wc_SignatureType { WC_SIGNATURE_TYPE_RSA_W_ENC = 3 /* Adds DER header via wc_EncodeSignature */ }; +/* Signature wrapper disabled check */ +#ifndef NO_SIG_WRAPPER + WOLFSSL_API int wc_SignatureGetSize(enum wc_SignatureType sig_type, const void* key, word32 key_len); @@ -90,6 +100,8 @@ WOLFSSL_API int wc_SignatureGenerate_ex( void* key, word32 key_len, WC_RNG* rng, int verify); +#endif /* !NO_SIG_WRAPPER */ + #ifdef __cplusplus } /* extern "C" */ #endif