Skip to content

Commit 4416dec

Browse files
address test name matching and comment about internal struct access
1 parent 1d1ec94 commit 4416dec

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

tests/api/test_tls13.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,7 +3192,7 @@ int test_tls13_cert_req_sigalgs(void)
31923192
* uppercase names like "SECP384R1" do not match the lowercase "secp384r1"
31933193
* entry; they fall through to the wolfCrypt ECC look-up which uses
31943194
* XSTRCASECMP. */
3195-
int test_set_curves_list_ecc_fallback(void)
3195+
int test_tls13_set_curves_list_ecc_fallback(void)
31963196
{
31973197
EXPECT_DECLS;
31983198
#if defined(WOLFSSL_TLS13) && defined(HAVE_ECC) && \
@@ -3213,15 +3213,20 @@ int test_set_curves_list_ecc_fallback(void)
32133213
ExpectIntEQ(wolfSSL_CTX_set1_curves_list(ctx, "SECP384R1"),
32143214
WOLFSSL_SUCCESS);
32153215

3216-
/* Verify the correct curve was stored, not ecc_sets[0] */
3217-
ExpectIntEQ(ctx->numGroups, 1);
3218-
ExpectIntEQ(ctx->group[0], WOLFSSL_ECC_SECP384R1);
3216+
/* Verify the correct named-group ID was stored (not ecc_sets[0]).
3217+
* Currently no public getter exists for the configured group list. */
3218+
if (!EXPECT_FAIL()) {
3219+
ExpectIntEQ(ctx->numGroups, 1);
3220+
ExpectIntEQ(ctx->group[0], WOLFSSL_ECC_SECP384R1);
3221+
}
32193222

32203223
/* SSL-level: same check via wolfSSL_set1_curves_list */
32213224
ExpectNotNull(ssl = wolfSSL_new(ctx));
32223225
ExpectIntEQ(wolfSSL_set1_curves_list(ssl, "SECP384R1"), WOLFSSL_SUCCESS);
3223-
ExpectIntEQ(ssl->numGroups, 1);
3224-
ExpectIntEQ(ssl->group[0], WOLFSSL_ECC_SECP384R1);
3226+
if (!EXPECT_FAIL()) {
3227+
ExpectIntEQ(ssl->numGroups, 1);
3228+
ExpectIntEQ(ssl->group[0], WOLFSSL_ECC_SECP384R1);
3229+
}
32253230

32263231
wolfSSL_free(ssl);
32273232
wolfSSL_CTX_free(ctx);

tests/api/test_tls13.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int test_key_share_mismatch(void);
3939
int test_tls13_middlebox_compat_empty_session_id(void);
4040
int test_tls13_plaintext_alert(void);
4141
int test_tls13_cert_req_sigalgs(void);
42-
int test_set_curves_list_ecc_fallback(void);
42+
int test_tls13_set_curves_list_ecc_fallback(void);
4343

4444
#define TEST_TLS13_DECLS \
4545
TEST_DECL_GROUP("tls13", test_tls13_apis), \
@@ -57,6 +57,6 @@ int test_set_curves_list_ecc_fallback(void);
5757
TEST_DECL_GROUP("tls13", test_tls13_middlebox_compat_empty_session_id), \
5858
TEST_DECL_GROUP("tls13", test_tls13_plaintext_alert), \
5959
TEST_DECL_GROUP("tls13", test_tls13_cert_req_sigalgs), \
60-
TEST_DECL_GROUP("tls13", test_set_curves_list_ecc_fallback)
60+
TEST_DECL_GROUP("tls13", test_tls13_set_curves_list_ecc_fallback)
6161

6262
#endif /* WOLFCRYPT_TEST_TLS13_H */

0 commit comments

Comments
 (0)