From: Jouni Malinen Date: Sun, 29 Jun 2014 17:22:17 +0000 (+0300) Subject: EAP-LEAP: Use os_memcmp_const() for hash/password comparisons X-Git-Tag: hostap_2_3~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b1e7458709354aed02e815cfa4b882247a4f29b;p=thirdparty%2Fhostap.git EAP-LEAP: Use os_memcmp_const() for hash/password comparisons This makes the implementation less likely to provide useful timing information to potential attackers from comparisons of information received from a remote device and private material known only by the authorized devices. Signed-off-by: Jouni Malinen --- diff --git a/src/eap_peer/eap_leap.c b/src/eap_peer/eap_leap.c index df3401384..f4cd1250d 100644 --- a/src/eap_peer/eap_leap.c +++ b/src/eap_peer/eap_leap.c @@ -244,7 +244,7 @@ static struct wpabuf * eap_leap_process_response(struct eap_sm *sm, void *priv, ret->methodState = METHOD_DONE; ret->allowNotifications = FALSE; - if (os_memcmp(pos, expected, LEAP_RESPONSE_LEN) != 0) { + if (os_memcmp_const(pos, expected, LEAP_RESPONSE_LEN) != 0) { wpa_printf(MSG_WARNING, "EAP-LEAP: AP sent an invalid " "response - authentication failed"); wpa_hexdump(MSG_DEBUG, "EAP-LEAP: Expected response from AP",