All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] eapol: Use constant-time comparison
@ 2021-06-13 20:23 Joseph Benden
  2021-06-14 14:10 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Benden @ 2021-06-13 20:23 UTC (permalink / raw)
  To: iwd

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

This closes the possibility of a timing attack against PMKIDs.
---
 src/eapol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/eapol.c b/src/eapol.c
index f587e708..51fb3c92 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -1142,7 +1142,7 @@ static void eapol_handle_ptk_1_of_4(struct eapol_sm *sm,
 			goto error_unspecified;
 
 		for (i = 0; i < rsn_info.num_pmkids; i++)
-			if (!memcmp(rsn_info.pmkids + i * 16, pmkid, 16)) {
+			if (!l_secure_memcmp(rsn_info.pmkids + i * 16, pmkid, 16)) {
 				found = true;
 				break;
 			}
@@ -1155,7 +1155,7 @@ static void eapol_handle_ptk_1_of_4(struct eapol_sm *sm,
 		if (!handshake_state_get_pmkid(sm->handshake, own_pmkid))
 			goto error_unspecified;
 
-		if (memcmp(pmkid, own_pmkid, 16)) {
+		if (l_secure_memcmp(pmkid, own_pmkid, 16)) {
 			l_debug("Authenticator sent a PMKID that didn't match");
 
 			/*
-- 
2.32.0

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

* Re: [PATCH 1/1] eapol: Use constant-time comparison
  2021-06-13 20:23 [PATCH 1/1] eapol: Use constant-time comparison Joseph Benden
@ 2021-06-14 14:10 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-06-14 14:10 UTC (permalink / raw)
  To: iwd

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

Hi Joseph,

On 6/13/21 3:23 PM, Joseph Benden wrote:
> This closes the possibility of a timing attack against PMKIDs.
> ---
>   src/eapol.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Applied with a minor formatting tweak to the first chunk (>80 chars / line)

Regards,
-Denis

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

end of thread, other threads:[~2021-06-14 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 20:23 [PATCH 1/1] eapol: Use constant-time comparison Joseph Benden
2021-06-14 14:10 ` 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.