crypto: allow NULL 'ad' to aes_siv_decrypt
James Prestwood
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
@@ -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++;
Signature · 1 line
2.31.1
James Prestwood
PATCH 2/2 offchannel: always call destroy right away on cancel
The main cancel code path was not calling destroy immediately which was not consistent with other code paths/APIs.
--- src/offchannel.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
src/offchannel.c +10 -12
@@ -208,20 +208,10 @@ void offchannel_cancel(uint64_t wdev_id, uint32_t id) goto work_done; } -/* -* Call destroy now to maintain consistency with any other -* path leading to radio_work_done(). But set needs_cancel so -* the ROC command can be canceled -*/ -if (info->destroy) - info->destroy (info->error, info->user_data); - - info->destroy =NULL ; - info->started =NULL ; - info->user_data =NULL ; +/* Lets the ROC callback know it needs to cancel the request */ info->needs_cancel = true; -return ; + goto destroy; }/*
@@ -239,6 +229,14 @@ void offchannel_cancel(uint64_t wdev_id, uint32_t id)*/ offchannel_cancel_roc (info); +destroy: +if (info->destroy) + info->destroy (info->error, info->user_data); + + info->destroy =NULL ; + info->started =NULL ; + info->user_data =NULL ; +return ; work_done:
Signature · 1 line
2.31.1
Denis Kenzior
Hi James,
Quoted 4 lines · James Prestwood
--- src/crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Both applied, thanks.
Regards,
-Denis