public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 1/2] crypto: allow NULL 'ad' to aes_siv_decrypt
Date: Thu, 16 Dec 2021 10:00:02 -0800	[thread overview]
Message-ID: <20211216180003.38883-1-prestwoj@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 547 bytes --]

---
 src/crypto.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/crypto.c b/src/crypto.c
index 475ebf36..cd50d6f7 100644
--- 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++;
-- 
2.31.1

             reply	other threads:[~2021-12-16 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 18:00 James Prestwood [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-16 18:20 [PATCH 1/2] crypto: allow NULL 'ad' to aes_siv_decrypt Denis Kenzior
2021-12-15 17:48 Denis Kenzior
2021-12-15 17:41 James Prestwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211216180003.38883-1-prestwoj@gmail.com \
    --to=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox