From 41ebc92fa5f58aaadd745c2c6cd76eadba610f4e Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Tue, 24 Feb 2026 08:02:26 -0600 Subject: [PATCH] Replace macros from stdint.h with literals to make code more generic --- src/ssl.c | 2 +- src/tls13.c | 2 +- tests/api.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index ba03ed4418..92789e7b3a 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -5728,7 +5728,7 @@ int wolfSSL_export_keying_material(WOLFSSL *ssl, /* Sanity check contextLen to prevent integer overflow when cast to word32 * and to ensure it fits in the 2-byte length encoding (max 65535). */ - if (use_context && contextLen > UINT16_MAX) { + if (use_context && contextLen > 0xFFFF) { WOLFSSL_MSG("contextLen too large"); return WOLFSSL_FAILURE; } diff --git a/src/tls13.c b/src/tls13.c index c1d31c8187..d9e5aebca8 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -1024,7 +1024,7 @@ int Tls13_Exporter(WOLFSSL* ssl, unsigned char *out, size_t outLen, return ret; /* Sanity check contextLen to prevent truncation when cast to word32. */ - if (contextLen > UINT32_MAX) { + if (contextLen > 0xFFFFFFFFU) { return BAD_FUNC_ARG; } diff --git a/tests/api.c b/tests/api.c index 4511b8d37d..d8b0677007 100644 --- a/tests/api.c +++ b/tests/api.c @@ -24074,7 +24074,7 @@ static int test_export_keying_material_cb(WOLFSSL_CTX *ctx, WOLFSSL *ssl) * prevent integer overflow in seedLen calculation (ZD #21242). */ ExpectIntEQ(wolfSSL_export_keying_material(ssl, ekm, sizeof(ekm), "Test label", XSTR_SIZEOF("Test label"), ekm, - (size_t)UINT16_MAX + 1, 1), 0); + (size_t)0xFFFF + 1, 1), 0); return EXPECT_RESULT(); }