]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-LEAP: Use os_memcmp_const() for hash/password comparisons
authorJouni Malinen <j@w1.fi>
Sun, 29 Jun 2014 17:22:17 +0000 (20:22 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 2 Jul 2014 09:38:47 +0000 (12:38 +0300)
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 <j@w1.fi>
src/eap_peer/eap_leap.c

index df3401384cf97b65915bf97fd78ef1c8abcef13c..f4cd1250d7fa71be70caac1a5aa64da2ced8334e 100644 (file)
@@ -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",