Blame SOURCES/freeradius-EAP-PWD-information-leak-10-iterations.patch

da7c71
From 3ea2a5a026e73d81cd9a3e9bbd4300c433004bfa Mon Sep 17 00:00:00 2001
da7c71
From: Mathy Vanhoef <mathy.vanhoef@nyu.edu>
da7c71
Date: Wed, 5 Jun 2019 19:21:06 +0000
da7c71
Subject: [PATCH] EAP-pwd: fix side-channel leak where 1 in 2018 handshakes
da7c71
 fail
da7c71
da7c71
Previously the Hunting and Pecking algorithm of EAP-pwd aborted when
da7c71
more than 10 iterations are needed. Every iteration has a 50% chance
da7c71
of finding the password element. This means one in every 2048 handshakes
da7c71
will fail, in which case an error frame is sent to the client. This
da7c71
event leaks information that can be abused in an offline password
da7c71
brute-force attack. More precisely, the adversary learns that all 10
da7c71
iterations failed for the given random EAP-pwd token. Using the same
da7c71
techniques as in the Dragonblood attack, this can be used to brute-force
da7c71
the password.
da7c71
da7c71
This patch fixes the above issue by executing enough iterations such that
da7c71
the password element is always found eventually.
da7c71
da7c71
Note that timing and cache leaks remain a risk against the current
da7c71
implementation of EAP-pwd.
da7c71
---
da7c71
 src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c | 2 +-
da7c71
 1 file changed, 1 insertion(+), 1 deletion(-)
da7c71
da7c71
diff --git a/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c b/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
da7c71
index c54f08c030..d94851c3aa 100644
da7c71
--- a/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
da7c71
+++ b/src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
da7c71
@@ -192,7 +192,7 @@ int compute_password_element (pwd_session_t *session, uint16_t grp_num,
da7c71
 	}
da7c71
 	ctr = 0;
da7c71
 	while (1) {
da7c71
-		if (ctr > 10) {
da7c71
+		if (ctr > 100) {
da7c71
 			DEBUG("unable to find random point on curve for group %d, something's fishy", grp_num);
da7c71
 			goto fail;
da7c71
 		}