Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -22175,7 +22175,8 @@ int DoApplicationData(WOLFSSL* ssl, byte* input, word32* inOutIdx, int sniff)
#ifdef WOLFSSL_EARLY_DATA
if (ssl->options.side == WOLFSSL_SERVER_END &&
ssl->earlyData > early_data_ext) {
if (ssl->earlyDataSz + dataSz > ssl->options.maxEarlyDataSz) {
if ((word32)dataSz >
ssl->options.maxEarlyDataSz - ssl->earlyDataSz) {
if (sniff == NO_SNIFF) {
SendAlert(ssl, alert_fatal, unexpected_message);
}
Expand Down
2 changes: 2 additions & 0 deletions wolfcrypt/src/blake2b.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ int wc_Blake2bHmacUpdate(Blake2b* b2b, const byte* in, size_t in_len)
{
if (in == NULL)
return BAD_FUNC_ARG;
if ((word32)in_len != in_len)
return BAD_FUNC_ARG;

return wc_Blake2bUpdate(b2b, in, (word32)in_len);
}
Expand Down
2 changes: 2 additions & 0 deletions wolfcrypt/src/blake2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,8 @@ int wc_Blake2sHmacUpdate(Blake2s* b2s, const byte* in, size_t in_len)
{
if (in == NULL)
return BAD_FUNC_ARG;
if ((word32)in_len != in_len)
return BAD_FUNC_ARG;

return wc_Blake2sUpdate(b2s, in, (word32)in_len);
}
Expand Down
5 changes: 5 additions & 0 deletions wolfcrypt/src/chacha20_poly1305.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,11 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot(
goto out;
}

if ((word32)ad_len != ad_len) {
ret = BAD_FUNC_ARG;
goto out;
}

if ((ret = wc_XChaCha20Poly1305_Init(aead, ad, (word32)ad_len,
nonce, (word32)nonce_len,
key, (word32)key_len, 1)) < 0)
Expand Down
3 changes: 3 additions & 0 deletions wolfcrypt/src/coding.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ int Base16_Encode(const byte* in, word32 inLen, byte* out, word32* outLen)
if (in == NULL || out == NULL || outLen == NULL)
return BAD_FUNC_ARG;

if (inLen > (WOLFSSL_MAX_32BIT / 2))
return BAD_FUNC_ARG;

if (*outLen < (2 * inLen))
return BAD_FUNC_ARG;

Expand Down
5 changes: 5 additions & 0 deletions wolfcrypt/src/evp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3106,6 +3106,11 @@ int wolfSSL_EVP_PKEY_CTX_add1_hkdf_info(WOLFSSL_EVP_PKEY_CTX* ctx,
WOLFSSL_MSG("WOLFSSL_EVP_PKEY type is not HKDF.");
ret = WOLFSSL_FAILURE;
}
if (ret == WOLFSSL_SUCCESS && info != NULL && infoSz > 0 &&
ctx->pkey->hkdfInfoSz > (WOLFSSL_MAX_32BIT - (word32)infoSz)) {
WOLFSSL_MSG("HKDF info length overflow.");
ret = WOLFSSL_FAILURE;
}

if (ret == WOLFSSL_SUCCESS && info != NULL && infoSz > 0) {
unsigned char* p;
Expand Down
Loading