From: Jouni Malinen Date: Sat, 6 Feb 2021 09:19:55 +0000 (+0200) Subject: RSN: Validate RSNXE match in EAPOL-Key msg 3/4 only when RSN is used X-Git-Tag: hostap_2_10~641 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc197795924c52f68fe1da76c4668e6f6ed392f9;p=thirdparty%2Fhostap.git RSN: Validate RSNXE match in EAPOL-Key msg 3/4 only when RSN is used This is needed to avoid the corner case of local RSNXE aware station being configured to behave as WPA(v1)-only STA when the AP might not include RSNXE in EAPOL-Key msg 3/4. Signed-off-by: Jouni Malinen --- diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index e1aba36de..9a5ba7b87 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -1572,11 +1572,12 @@ static int wpa_supplicant_validate_ie(struct wpa_sm *sm, return -1; } - if ((sm->ap_rsnxe && !ie->rsnxe) || - (!sm->ap_rsnxe && ie->rsnxe) || - (sm->ap_rsnxe && ie->rsnxe && - (sm->ap_rsnxe_len != ie->rsnxe_len || - os_memcmp(sm->ap_rsnxe, ie->rsnxe, sm->ap_rsnxe_len) != 0))) { + if (sm->proto == WPA_PROTO_RSN && + ((sm->ap_rsnxe && !ie->rsnxe) || + (!sm->ap_rsnxe && ie->rsnxe) || + (sm->ap_rsnxe && ie->rsnxe && + (sm->ap_rsnxe_len != ie->rsnxe_len || + os_memcmp(sm->ap_rsnxe, ie->rsnxe, sm->ap_rsnxe_len) != 0)))) { wpa_msg(sm->ctx->msg_ctx, MSG_INFO, "WPA: RSNXE mismatch between Beacon/ProbeResp and EAPOL-Key msg 3/4"); wpa_hexdump(MSG_INFO, "RSNXE in Beacon/ProbeResp",