From: Jouni Malinen Date: Sun, 5 Feb 2017 11:52:43 +0000 (+0200) Subject: Set EAPOL-Key Key Length field to 0 for group message 1/2 in RSN X-Git-Tag: hostap_2_7~1676 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=caab23f192085e6c8e47c41fc1ae9f795d1cbe86;p=thirdparty%2Fhostap.git Set EAPOL-Key Key Length field to 0 for group message 1/2 in RSN P802.11i/D3.0 described the Key Length as having value 16 for the group key handshake. However, this was changed to 0 in the published IEEE Std 802.11i-2004 amendment (and still remains 0 in the current standard IEEE Std 802.11-2016). We need to maintain the non-zero value for WPA (v1) cases, but the RSN case can be changed to 0 to be closer to the current standard. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c index 0d60d3289..0bd901fbf 100644 --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c @@ -1484,9 +1484,11 @@ void __wpa_send_eapol(struct wpa_authenticator *wpa_auth, WPA_PUT_BE16(key->key_info, key_info); alg = pairwise ? sm->pairwise : wpa_auth->conf.wpa_group; - WPA_PUT_BE16(key->key_length, wpa_cipher_key_len(alg)); - if (key_info & WPA_KEY_INFO_SMK_MESSAGE) + if ((key_info & WPA_KEY_INFO_SMK_MESSAGE) || + (sm->wpa == WPA_VERSION_WPA2 && !pairwise)) WPA_PUT_BE16(key->key_length, 0); + else + WPA_PUT_BE16(key->key_length, wpa_cipher_key_len(alg)); /* FIX: STSL: what to use as key_replay_counter? */ for (i = RSNA_MAX_EAPOL_RETRIES - 1; i > 0; i--) {