From a70cd4965aac0ad6e85f67d0fa667ed44b1eff3b Mon Sep 17 00:00:00 2001 From: gojimmypi Date: Fri, 29 Dec 2023 09:46:51 -0800 Subject: [PATCH] RSA / ECC gating test for https://github.com/wolfSSL/wolfssh/pull/642 --- .../wolfssl/include/user_settings.h | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/ide/Espressif/ESP-IDF/examples/wolfssl_echoserver/components/wolfssl/include/user_settings.h b/ide/Espressif/ESP-IDF/examples/wolfssl_echoserver/components/wolfssl/include/user_settings.h index 5d07a1001..8842c9be1 100644 --- a/ide/Espressif/ESP-IDF/examples/wolfssl_echoserver/components/wolfssl/include/user_settings.h +++ b/ide/Espressif/ESP-IDF/examples/wolfssl_echoserver/components/wolfssl/include/user_settings.h @@ -117,10 +117,42 @@ /* #define WOLFSSL_SHA3 */ #define WOLFSSL_SHA512 -#define HAVE_ECC -#define HAVE_CURVE25519 -#define CURVE25519_SMALL -#define HAVE_ED25519 + +#define MY_USE_ECC 0 +#define MY_USE_RSA 1 + +/* We can use either or both ECC and RSA, but must use at least one. */ +#if MY_USE_ECC || MY_USE_RSA + #if MY_USE_ECC + /* ---- ECDSA / ECC ---- */ + #define HAVE_ECC + #define HAVE_CURVE25519 + #define HAVE_ED25519 + + /* + #define HAVE_ECC384 + #define CURVE25519_SMALL + */ + #else + #define WOLFSSH_NO_ECC + /* WOLFSSH_NO_ECDSA is typically defined automatically, + * here for clarity: */ + #define WOLFSSH_NO_ECDSA + #endif + + #if MY_USE_RSA + /* ---- RSA ----- */ + /* #define RSA_LOW_MEM */ + + /* DH disabled by default, needed if ECDSA/ECC also turned off */ + #define HAVE_DH + #else + #define WOLFSSH_NO_RSA + #endif +#else + #error "Either RSA or ECC must be enabled" +#endif + /* when you want to use pkcs7 */ /* #define HAVE_PKCS7 */ @@ -135,9 +167,6 @@ /* #define WOLFSSL_AES_DIRECT */ /* #define WOLFSSL_AES_COUNTER */ -/* #define RSA_LOW_MEM */ -#define WOLFSSH_NO_RSA - /* debug options */ /* #define DEBUG_WOLFSSL */ /* #define WOLFSSL_ESP32_CRYPT_DEBUG */