mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 17:30:51 +02:00
Replace macros from stdint.h with literals to make code more generic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user