This commit is contained in:
Daniel Pouzzner
2024-07-05 17:03:05 -05:00
parent d8757a51b3
commit 88af1a2932
4 changed files with 16 additions and 6 deletions

View File

@@ -1612,6 +1612,11 @@ int wolfIO_HttpProcessResponse(int sfd, const char** appStrList,
/* read data if no \r\n or first time */ /* read data if no \r\n or first time */
if ((start == NULL) || (end == NULL)) { if ((start == NULL) || (end == NULL)) {
if (httpBufSz < len + 1) {
return BUFFER_ERROR; /* can't happen, but Coverity thinks it
* can.
*/
}
result = wolfIO_Recv(sfd, (char*)httpBuf+len, httpBufSz-len-1, 0); result = wolfIO_Recv(sfd, (char*)httpBuf+len, httpBufSz-len-1, 0);
if (result > 0) { if (result > 0) {
len += result; len += result;

View File

@@ -12910,10 +12910,6 @@ int wc_AesXtsEncryptInit(XtsAes* xaes, const byte* i, word32 iSz,
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
} }
if (iSz < AES_BLOCK_SIZE) {
return BAD_FUNC_ARG;
}
XMEMCPY(stream->tweak_block, i, AES_BLOCK_SIZE); XMEMCPY(stream->tweak_block, i, AES_BLOCK_SIZE);
stream->bytes_crypted_with_this_tweak = 0; stream->bytes_crypted_with_this_tweak = 0;

View File

@@ -4017,7 +4017,10 @@ int wc_RsaPSS_CheckPadding_ex2(const byte* in, word32 inSz, byte* sig,
/* Sig = Salt | Exp Hash */ /* Sig = Salt | Exp Hash */
if (ret == 0) { if (ret == 0) {
if (sigSz != inSz + (word32)saltLen) { word32 totalSz;
if ((WC_SAFE_SUM_WORD32(inSz, (word32)saltLen, totalSz) == 0) ||
(sigSz != totalSz))
{
ret = PSS_SALTLEN_E; ret = PSS_SALTLEN_E;
} }
} }

View File

@@ -545,9 +545,15 @@ int wc_CryptKey(const char* password, int passwordSz, byte* salt,
ret = wc_PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz, ret = wc_PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz,
iterations, (int)derivedLen, typeH, 1); iterations, (int)derivedLen, typeH, 1);
if (ret < 0)
break;
if (id != PBE_SHA1_RC4_128) { if (id != PBE_SHA1_RC4_128) {
ret += wc_PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt, i = ret;
ret = wc_PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt,
saltSz, iterations, 8, typeH, 2); saltSz, iterations, 8, typeH, 2);
if (ret < 0)
break;
ret += i;
} }
break; break;
} }