commit 1a27cd1548cfcfbc4b22b3a36386a0fc98148fce
parent 53e68b64b2fe6b0800509e7e82b1df89fe200d20
Author: James Prestwood <prestwoj@gmail.com>
Date: Thu, 16 Dec 2021 10:00:02 -0800
crypto: allow NULL 'ad' to aes_siv_decrypt
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/crypto.c b/src/crypto.c
@@ -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++;