Skip to contentSkip to conversation

crypto: allow NULL 'ad' to aes_siv_decrypt

PATCH Applied James Prestwood 2 participants 4 messages Dec 16, 2021

lore
Share & tools
lore

James Prestwood

author
#0 lore raw

PATCH 1/2 crypto: allow NULL 'ad' to aes_siv_decrypt

---
 src/crypto.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/crypto.c +3 -1
index 475ebf36..cd50d6f7 100644
@@ -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++;
Signature · 1 line
2.31.1
author
#1 lore raw

PATCH 2/2 offchannel: always use -ECANCELED for cancelation

info->error gets reset to zero on a successful ROC callback which was getting used for cancelation.

---
 src/offchannel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/offchannel.c +1 -1
index 4db3fcf2..e01f76c7 100644
@@ -231,7 +231,7 @@ void offchannel_cancel(uint64_t wdev_id, uint32_t id)
 
 destroy:
 	if (info->destroy)
-		info->destroy(info->error, info->user_data);
+		info->destroy(-ECANCELED, info->user_data);
 
 	info->destroy = NULL;
 	info->started = NULL;
Signature · 1 line
2.31.1
Applied
#2 lore raw

Re: [PATCH 2/2] offchannel: always use -ECANCELED for cancelation

Hi James,

Quoted 6 lines · James Prestwood

info->error gets reset to zero on a successful ROC callback which was getting used for cancelation.

---
  src/offchannel.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Regards,
-Denis

Applied
#3 lore raw
In reply to James Prestwood
Quoted 4 lines · James Prestwood
---
  src/crypto.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Applied, thanks.

I amended the description of your earlier patch to refer to 'aes_siv_encrypt'

Regards,
-Denis