diff --git a/src/ssl.c b/src/ssl.c index af9f3fe35..bca9b2f43 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -32050,20 +32050,18 @@ int wolfSSL_EC_POINT_is_at_infinity(const WOLFSSL_EC_GROUP *group, size_t wolfSSL_EC_get_builtin_curves(WOLFSSL_EC_builtin_curve *r, size_t nitems) { - static size_t ecc_sets_count = 0; - size_t i, min; + size_t ecc_sets_count; + size_t i, min_nitems; - if (ecc_sets_count == 0) { - for (i = 0; ecc_sets[i].size != 0; i++); - ecc_sets_count = i; - } + for (i = 0; ecc_sets[i].size != 0 && ecc_sets[i].name != NULL; i++); + ecc_sets_count = i; if (r == NULL || nitems == 0) return ecc_sets_count; - min = nitems < ecc_sets_count ? nitems : ecc_sets_count; + min_nitems = nitems < ecc_sets_count ? nitems : ecc_sets_count; - for (i = 0; i < min; i++) { + for (i = 0; i < min_nitems; i++) { r[i].nid = ecc_sets[i].id; r[i].comment = ecc_sets[i].name; } @@ -37057,7 +37055,7 @@ err: WOLFSSL_ENTER("wolfSSL_OBJ_nid2sn"); /* find based on NID and return name */ - for (i = 0; i < ecc_sets[i].size; i++) { + for (i = 0; ecc_sets[i].size != 0; i++) { if (n == ecc_sets[i].id) { return ecc_sets[i].name; } diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 2e64698e9..a54be33f1 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4811,7 +4811,7 @@ WOLFSSL_LOCAL int wc_OBJ_sn2nid(const char *sn) if (XSTRNCMP(sn, "secp384r1", 10) == 0) sn = "SECP384R1"; /* find based on name and return NID */ - for (i = 0; i < ecc_sets[i].size; i++) { + for (i = 0; ecc_sets[i].size != 0 && ecc_sets[i].name != NULL; i++) { if (XSTRNCMP(sn, ecc_sets[i].name, ECC_MAXNAME) == 0) { return ecc_sets[i].id; } diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index a750ac373..ccd434b3f 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -3263,7 +3263,7 @@ int hash_test(void) if (ret != BAD_FUNC_ARG) return -3094; -#ifndef NO_ASN +#ifndef NO_CERTS #if defined(WOLFSSL_MD2) && !defined(HAVE_SELFTEST) ret = wc_GetCTC_HashOID(MD2); if (ret == 0) @@ -11508,7 +11508,7 @@ static int rsa_keygen_test(WC_RNG* rng) #if !defined(HAVE_FAST_RSA) && !defined(HAVE_USER_RSA) && \ (!defined(HAVE_FIPS) || \ (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))) && \ - !defined(HAVE_SELFTEST) + !defined(HAVE_SELFTEST) && !defined(HAVE_INTEL_QA) ret = wc_CheckRsaKey(&genKey); if (ret != 0) { ERROR_OUT(-8228, exit_rsa); diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 16d7bb01e..4889405d7 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -240,7 +240,7 @@ #elif (defined(WOLFSSL_ASYNC_CRYPT) && defined(HAVE_INTEL_QA)) || \ defined(HAVE_INTEL_QA_SYNC) #ifndef HAVE_INTEL_QA_SYNC - #include + #include #undef USE_WOLFSSL_MEMORY #ifdef WOLFSSL_DEBUG_MEMORY #define XMALLOC(s, h, t) IntelQaMalloc((s), (h), (t), __func__, __LINE__)