The initial Authenticator implementation depended on the Key Data field
being empty for EAPOL-Key msg 4/4. This worked fine for years in
practice, but in theory, vendor specific elements or KDEs could have
been added inti EAPOL-Key msg 4/4 and that would have broken this
design. In addition, the MLD case did introduce a KDE into EAPOL-Key msg
4/4 and required changes here.
As an initial step to make this more robust for future extensions,
recognize a received EAPOL-Key message as msg 4/4 if it is for RSN
(i.e., not WPAv1), has Secure=1, contains an unencrypted Key Data field,
and does not include RSNE.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
msg = GROUP_2;
msgtxt = "2/2 Group";
} else if (key_data_length == 0 ||
+ (sm->wpa == WPA_VERSION_WPA2 &&
+ !(key_info & WPA_KEY_INFO_ENCR_KEY_DATA) &&
+ (key_info & WPA_KEY_INFO_SECURE) &&
+ !get_ie(key_data, key_data_length, WLAN_EID_RSN)) ||
(mic_len == 0 && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA) &&
key_data_length == AES_BLOCK_SIZE) ||
(is_mld && (key_info & WPA_KEY_INFO_SECURE) &&