3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

crypto: allow NULL 'ad' to aes_siv_encrypt

This commit is contained in:
James Prestwood 2021-12-15 09:41:45 -08:00 committed by Denis Kenzior
parent 124b04fff6
commit 53e68b64b2

View File

@ -330,7 +330,9 @@ bool aes_siv_encrypt(const void *key, size_t key_len, const void *in,
struct iovec iov[num_ad + 1];
uint8_t v[16];
memcpy(iov, ad, sizeof(struct iovec) * num_ad);
if (ad)
memcpy(iov, ad, sizeof(struct iovec) * num_ad);
iov[num_ad].iov_base = (void *)in;
iov[num_ad].iov_len = in_len;
num_ad++;