crypto: allow NULL 'ad' to aes_siv_decrypt

This commit is contained in:
James Prestwood 2021-12-16 10:00:02 -08:00 committed by Denis Kenzior
parent 53e68b64b2
commit 1a27cd1548
1 changed files with 3 additions and 1 deletions

View File

@ -389,7 +389,9 @@ bool aes_siv_decrypt(const void *key, size_t key_len, const void *in,
if (in_len < 16)
return false;
memcpy(iov, ad, sizeof(struct iovec) * num_ad);
if (ad)
memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)out;
iov[num_ad].iov_len = in_len - 16;
num_ad++;