Skip to content

Commit 4f8f11b

Browse files
committed
Add test case
1 parent 67de234 commit 4f8f11b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24070,6 +24070,11 @@ static int test_export_keying_material_cb(WOLFSSL_CTX *ctx, WOLFSSL *ssl)
2407024070
NULL, 0, 0), 0);
2407124071
ExpectIntEQ(wolfSSL_export_keying_material(ssl, ekm, sizeof(ekm),
2407224072
"key expansion", XSTR_SIZEOF("key expansion"), NULL, 0, 0), 0);
24073+
/* contextLen overflow: values exceeding UINT16_MAX must be rejected to
24074+
* prevent integer overflow in seedLen calculation (ZD #21242). */
24075+
ExpectIntEQ(wolfSSL_export_keying_material(ssl, ekm, sizeof(ekm),
24076+
"Test label", XSTR_SIZEOF("Test label"), ekm,
24077+
(size_t)UINT16_MAX + 1, 1), 0);
2407324078

2407424079
return EXPECT_RESULT();
2407524080
}

0 commit comments

Comments
 (0)