mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-07 20:30:51 +02:00
add guard for integer underflow in DecryptTls13
This commit is contained in:
+5
-1
@@ -2966,11 +2966,15 @@ int DecryptTls13(WOLFSSL* ssl, byte* output, const byte* input, word16 sz,
|
||||
const byte* aad, word16 aadSz)
|
||||
{
|
||||
int ret = 0;
|
||||
word16 dataSz = sz - ssl->specs.aead_mac_size;
|
||||
word16 dataSz;
|
||||
word16 macSz = ssl->specs.aead_mac_size;
|
||||
word32 nonceSz = 0;
|
||||
|
||||
WOLFSSL_ENTER("DecryptTls13");
|
||||
if (sz < ssl->specs.aead_mac_size) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
dataSz = sz - ssl->specs.aead_mac_size;
|
||||
|
||||
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
|
||||
ret = tsip_Tls13AesDecrypt(ssl, output, input, sz);
|
||||
|
||||
Reference in New Issue
Block a user