Skip to content

Commit

Permalink
Merge pull request wolfSSL#7783 from douzzer/20240723-AesGcmXcrypt-NU…
Browse files Browse the repository at this point in the history
…LL-in-checks

20240723-AesGcmXcrypt-NULL-in-checks
  • Loading branch information
kaleb-himes authored Jul 24, 2024
2 parents 97dcf12 + f872614 commit 3a4788b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions wolfcrypt/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -8308,7 +8308,10 @@ int wc_AesGcmEncrypt(Aes* aes, byte* out, const byte* in, word32 sz,
int ret;

/* argument checks */
if (aes == NULL || authTagSz > AES_BLOCK_SIZE || ivSz == 0) {
if (aes == NULL || authTagSz > AES_BLOCK_SIZE || ivSz == 0 ||
((authTagSz > 0) && (authTag == NULL)) ||
((authInSz > 0) && (authIn == NULL)))
{
return BAD_FUNC_ARG;
}

Expand Down Expand Up @@ -8437,8 +8440,8 @@ int wc_AesGcmDecrypt(Aes* aes, byte* out, const byte* in, word32 sz,
* in and out are don't cares, as this is is the GMAC case. */
if (aes == NULL || iv == NULL || (sz != 0 && (in == NULL || out == NULL)) ||
authTag == NULL || authTagSz > AES_BLOCK_SIZE || authTagSz == 0 ||
ivSz == 0) {

ivSz == 0 || ((authInSz > 0) && (authIn == NULL)))
{
return BAD_FUNC_ARG;
}

Expand Down

0 comments on commit 3a4788b

Please sign in to comment.