diff --git a/tests/api.c b/tests/api.c index b28b08a41..2e31b0cb9 100644 --- a/tests/api.c +++ b/tests/api.c @@ -39023,7 +39023,7 @@ static void test_wolfSSL_EVP_get_digestbynid(void) } static void test_wolfSSL_EVP_PKEY_get0_EC_KEY(void) { -#if defined(OPENSSL_ALL) +#if defined(HAVE_ECC) && defined(OPENSSL_ALL) WOLFSSL_EVP_PKEY* pkey; @@ -40607,7 +40607,7 @@ static void test_wolfSSL_RSA_padding_add_PKCS1_PSS(void) static void test_wolfSSL_RSA_sign_sha3(void) { -#if defined(WOLFSSL_SHA3) && !defined(WOLFSSL_NOSHA3_256) +#if !defined(NO_RSA) && defined(WOLFSSL_SHA3) && !defined(WOLFSSL_NOSHA3_256) #if defined(OPENSSL_ALL) && defined(WC_RSA_PSS) && !defined(WC_NO_RNG) RSA *rsa; const unsigned char *derBuf = client_key_der_2048; @@ -40630,7 +40630,7 @@ static void test_wolfSSL_RSA_sign_sha3(void) printf(resultFmt, passed); #endif /* OPENSSL_ALL && WC_RSA_PSS && !WC_NO_RNG*/ -#endif /* WOLFSSL_NOSHA3_256*/ +#endif /* !NO_RSA && WOLFSSL_SHA3 && !WOLFSSL_NOSHA3_256*/ } static void test_wolfSSL_EC_get_builtin_curves(void) @@ -44254,7 +44254,7 @@ static void test_wolfSSL_RSA_print(void) AssertIntEQ(RSA_print(bio, rsa, 0), SSL_SUCCESS); BIO_free(bio); - wolfSSL_RSA_free(rsa); + RSA_free(rsa); printf(resultFmt, passed); #endif } diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 3085ac91e..18e96e5ec 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -8959,9 +8959,8 @@ static int wc_ecc_import_raw_private(ecc_key* key, const char* qx, byte key_raw[ECC_MAX_CRYPTO_HW_SIZE*2 + 1]; #endif -#if (defined(WOLFSSL_CRYPTOCELL) && !defined(WOLFSSL_ATECC508A) && \ - !defined(WOLFSSL_ATECC608A)) || \ - defined(WOLFSSL_SILABS_SE_ACCEL) +#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \ + defined(WOLFSSL_SILABS_SE_ACCEL) || defined(WOLFSSL_CRYPTOCELL) word32 keySz = 0; #endif diff --git a/wolfcrypt/src/port/atmel/atmel.c b/wolfcrypt/src/port/atmel/atmel.c index 42615b2b9..62268d52d 100644 --- a/wolfcrypt/src/port/atmel/atmel.c +++ b/wolfcrypt/src/port/atmel/atmel.c @@ -191,7 +191,7 @@ int wolfCrypt_ATECC_SetConfig(ATCAIfaceCfg* cfg) cfg_ateccx08a_i2c_pi.iface_type = cfg->iface_type; cfg_ateccx08a_i2c_pi.devtype = cfg->devtype; #ifdef ATCA_ENABLE_DEPRECATED - cfg_ateccx08a_i2c_pi.atcai2c.slave_address = cfg->atcai2c.slave_address; + cfg_ateccx08a_i2c_pi.atcai2c.slave_address = cfg->atcai2c.slave_address; #else cfg_ateccx08a_i2c_pi.atcai2c.address = cfg->atcai2c.address; #endif @@ -525,11 +525,11 @@ int atmel_init(void) XMEMSET(&cfg_ateccx08a_i2c_pi, 0, sizeof(cfg_ateccx08a_i2c_pi)); cfg_ateccx08a_i2c_pi.iface_type = ATCA_I2C_IFACE; cfg_ateccx08a_i2c_pi.devtype = ATECC_DEV_TYPE; -#ifdef ATCA_ENABLE_DEPRECATED + #ifdef ATCA_ENABLE_DEPRECATED cfg_ateccx08a_i2c_pi.atcai2c.slave_address = ATECC_I2C_ADDR; -#else + #else cfg_ateccx08a_i2c_pi.atcai2c.address = ATECC_I2C_ADDR; -#endif + #endif cfg_ateccx08a_i2c_pi.atcai2c.bus = ATECC_I2C_BUS; cfg_ateccx08a_i2c_pi.atcai2c.baud = 400000; cfg_ateccx08a_i2c_pi.wake_delay = 1500; diff --git a/wolfssl/wolfcrypt/ecc.h b/wolfssl/wolfcrypt/ecc.h index 16b5d96df..f166c5749 100644 --- a/wolfssl/wolfcrypt/ecc.h +++ b/wolfssl/wolfcrypt/ecc.h @@ -506,8 +506,6 @@ extern const size_t ecc_sets_count; WOLFSSL_API const char* wc_ecc_get_name(int curve_id); -#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A) - #ifdef WOLFSSL_PUBLIC_ECC_ADD_DBL #define ECC_API WOLFSSL_API #else @@ -532,8 +530,6 @@ WOLFSSL_LOCAL int ecc_projective_dbl_point_safe(ecc_point* P, ecc_point* R, mp_int* a, mp_int* modulus, mp_digit mp); -#endif - WOLFSSL_API int wc_ecc_make_key(WC_RNG* rng, int keysize, ecc_key* key); WOLFSSL_ABI WOLFSSL_API diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 2e2817e39..9a18a2704 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -289,22 +289,24 @@ decouple library dependencies with standard string, memory and so on. #define THREAD_LS_T #endif - /* GCC 7 has new switch() fall-through detection */ - /* default to FALL_THROUGH stub */ #ifndef FALL_THROUGH - #define FALL_THROUGH - - #if defined(__GNUC__) - #if ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1))) - #undef FALL_THROUGH - #if defined(WOLFSSL_LINUXKM) && defined(fallthrough) - #define FALL_THROUGH fallthrough - #else - #define FALL_THROUGH ; __attribute__ ((fallthrough)) + /* GCC 7 has new switch() fall-through detection */ + #if defined(__GNUC__) + #if ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1))) + #undef FALL_THROUGH + #if defined(WOLFSSL_LINUXKM) && defined(fallthrough) + #define FALL_THROUGH fallthrough + #else + #define FALL_THROUGH ; __attribute__ ((fallthrough)) + #endif #endif #endif - #endif #endif /* FALL_THROUGH */ + #if !defined(FALL_THROUGH) || defined(__XC32) + /* use stub for fall through by default or for Microchip compiler */ + #undef FALL_THROUGH + #define FALL_THROUGH + #endif /* Micrium will use Visual Studio for compilation but not the Win32 API */ #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \