All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] dpp: check return of aes_siv_encrypt
@ 2022-02-18 19:55 James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2022-02-18 19:55 UTC (permalink / raw)
  To: iwd

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

This was caught by static analysis. As is common this should never
happen in the real world since the only way this can fail (apart from
extreme circumstances like OOM) is if the key size is incorrect, which
it will never be.
---
 src/dpp.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/dpp.c b/src/dpp.c
index f664e490..54662e8f 100644
--- a/src/dpp.c
+++ b/src/dpp.c
@@ -1070,8 +1070,11 @@ static void send_authenticate_response(struct dpp_sm *dpp)
 	 * do not use AAD; in other words, the number of AAD components is set
 	 * to zero.""
 	 */
-	aes_siv_encrypt(dpp->ke, dpp->key_len, wrapped2_plaintext,
-					dpp->key_len + 4, NULL, 0, wrapped2);
+	if (!aes_siv_encrypt(dpp->ke, dpp->key_len, wrapped2_plaintext,
+					dpp->key_len + 4, NULL, 0, wrapped2)) {
+		l_error("Failed to encrypt wrapped data");
+		return;
+	}
 
 	wrapped2_len += 16;
 
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3] dpp: check return of aes_siv_encrypt
@ 2022-02-18 20:47 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2022-02-18 20:47 UTC (permalink / raw)
  To: iwd

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

Hi James,

On 2/18/22 13:55, James Prestwood wrote:
> This was caught by static analysis. As is common this should never
> happen in the real world since the only way this can fail (apart from
> extreme circumstances like OOM) is if the key size is incorrect, which
> it will never be.
> ---
>   src/dpp.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-18 20:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 19:55 [PATCH 3/3] dpp: check return of aes_siv_encrypt James Prestwood
2022-02-18 20:47 Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.