Skip to content

Commit 41ebc92

Browse files
committed
Replace macros from stdint.h with literals to make code more generic
1 parent 4f8f11b commit 41ebc92

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5728,7 +5728,7 @@ int wolfSSL_export_keying_material(WOLFSSL *ssl,
57285728

57295729
/* Sanity check contextLen to prevent integer overflow when cast to word32
57305730
* and to ensure it fits in the 2-byte length encoding (max 65535). */
5731-
if (use_context && contextLen > UINT16_MAX) {
5731+
if (use_context && contextLen > 0xFFFF) {
57325732
WOLFSSL_MSG("contextLen too large");
57335733
return WOLFSSL_FAILURE;
57345734
}

src/tls13.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ int Tls13_Exporter(WOLFSSL* ssl, unsigned char *out, size_t outLen,
10241024
return ret;
10251025

10261026
/* Sanity check contextLen to prevent truncation when cast to word32. */
1027-
if (contextLen > UINT32_MAX) {
1027+
if (contextLen > 0xFFFFFFFFU) {
10281028
return BAD_FUNC_ARG;
10291029
}
10301030

tests/api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24074,7 +24074,7 @@ static int test_export_keying_material_cb(WOLFSSL_CTX *ctx, WOLFSSL *ssl)
2407424074
* prevent integer overflow in seedLen calculation (ZD #21242). */
2407524075
ExpectIntEQ(wolfSSL_export_keying_material(ssl, ekm, sizeof(ekm),
2407624076
"Test label", XSTR_SIZEOF("Test label"), ekm,
24077-
(size_t)UINT16_MAX + 1, 1), 0);
24077+
(size_t)0xFFFF + 1, 1), 0);
2407824078

2407924079
return EXPECT_RESULT();
2408024080
}

0 commit comments

Comments
 (0)