Add explicit casts

This commit is contained in:
Juliusz Sosinowicz
2026-03-06 18:11:33 +01:00
parent 679d04d201
commit 694f251663
+5 -5
View File
@@ -4243,7 +4243,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
const byte *identity, *binders;
idsLen = (word16)((input[idx] << 8) | input[idx+1]);
if (idsLen + OPAQUE16_LEN + idx > extLen) {
if ((word32)idsLen + OPAQUE16_LEN + idx > (word32)extLen) {
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
return WOLFSSL_FATAL_ERROR;
}
@@ -4251,7 +4251,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
/* PSK identity */
idLen = (word16)((input[idx] << 8) | input[idx+1]);
if (idLen + OPAQUE16_LEN + idx > extLen) {
if ((word32)idLen + OPAQUE16_LEN + idx > (word32)extLen) {
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
return WOLFSSL_FATAL_ERROR;
}
@@ -4260,7 +4260,7 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
idx += idLen;
/* Obfuscated Ticket Age 32-bits */
if (idx + OPAQUE32_LEN > extLen) {
if ((word32)idx + OPAQUE32_LEN > (word32)extLen) {
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
return WOLFSSL_FATAL_ERROR;
}
@@ -4270,12 +4270,12 @@ static int ProcessClientHello(const byte* input, int* sslBytes,
idx += OPAQUE32_LEN;
/* binders - all binders */
if (idx + OPAQUE16_LEN > extLen) {
if ((word32)idx + OPAQUE16_LEN > (word32)extLen) {
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
return WOLFSSL_FATAL_ERROR;
}
bindersLen = (word16)((input[idx] << 8) | input[idx+1]);
if (bindersLen + OPAQUE16_LEN + idx > extLen) {
if ((word32)bindersLen + OPAQUE16_LEN + idx > (word32)extLen) {
SetError(CLIENT_HELLO_INPUT_STR, error, session, FATAL_ERROR_STATE);
return WOLFSSL_FATAL_ERROR;
}