Lines Matching refs:kde
37 static u8 * wpa_add_kde(u8 *pos, u32 kde, const u8 *data, size_t data_len)
41 RSN_SELECTOR_PUT(pos, kde);
102 /* Peer MAC Address KDE */
106 /* Error KDE */
165 /* Initiator MAC Address KDE */
184 struct wpa_eapol_ie_parse kde;
198 if (wpa_supplicant_parse_ies((const u8 *) (key + 1), extra_len, &kde) <
204 if (kde.rsn_ie == NULL || kde.mac_addr == NULL ||
205 kde.mac_addr_len < ETH_ALEN) {
206 wpa_printf(MSG_INFO, "RSN: No RSN IE or MAC address KDE in "
212 MAC2STR(kde.mac_addr));
214 if (kde.rsn_ie_len > PEERKEY_MAX_IE_LEN) {
220 if (wpa_parse_wpa_ie_rsn(kde.rsn_ie, kde.rsn_ie_len, &ie) < 0) {
234 wpa_supplicant_send_smk_error(sm, src_addr, kde.mac_addr,
246 os_memcpy(peerkey->addr, kde.mac_addr, ETH_ALEN);
248 os_memcpy(peerkey->rsnie_i, kde.rsn_ie, kde.rsn_ie_len);
249 peerkey->rsnie_i_len = kde.rsn_ie_len;
446 struct wpa_eapol_ie_parse *kde)
449 MAC2STR(kde->mac_addr));
451 if (os_memcmp(kde->smk + PMK_LEN, peerkey->pnonce, WPA_NONCE_LEN) != 0)
453 wpa_printf(MSG_INFO, "RSN: PNonce in SMK KDE does not "
458 if (os_memcmp(kde->nonce, peerkey->inonce, WPA_NONCE_LEN) != 0) {
473 struct wpa_eapol_ie_parse *kde)
479 MAC2STR(kde->mac_addr));
480 if (kde->rsn_ie == NULL || kde->rsn_ie_len > PEERKEY_MAX_IE_LEN ||
481 wpa_parse_wpa_ie_rsn(kde->rsn_ie, kde->rsn_ie_len, &ie) < 0) {
493 if (os_memcmp(kde->smk + PMK_LEN, peerkey->inonce, WPA_NONCE_LEN) != 0)
495 wpa_printf(MSG_INFO, "RSN: INonce in SMK KDE does not "
500 os_memcpy(peerkey->rsnie_p, kde->rsn_ie, kde->rsn_ie_len);
501 peerkey->rsnie_p_len = kde->rsn_ie_len;
502 os_memcpy(peerkey->pnonce, kde->nonce, WPA_NONCE_LEN);
513 "unacceptable cipher", MAC2STR(kde->mac_addr));
514 wpa_supplicant_send_smk_error(sm, src_addr, kde->mac_addr,
530 struct wpa_eapol_ie_parse kde;
540 if (wpa_supplicant_parse_ies((const u8 *) (key + 1), extra_len, &kde) <
546 if (kde.mac_addr == NULL || kde.mac_addr_len < ETH_ALEN ||
547 kde.nonce == NULL || kde.nonce_len < WPA_NONCE_LEN ||
548 kde.smk == NULL || kde.smk_len < PMK_LEN + WPA_NONCE_LEN ||
549 kde.lifetime == NULL || kde.lifetime_len < 4) {
551 "Lifetime KDE in SMK M4/M5");
556 if (os_memcmp(peerkey->addr, kde.mac_addr, ETH_ALEN) == 0 &&
565 MAC2STR(kde.mac_addr));
571 peerkey, &kde) < 0)
574 if (wpa_supplicant_process_smk_m4(peerkey, &kde) < 0)
578 os_memcpy(peerkey->smk, kde.smk, PMK_LEN);
581 lifetime = WPA_GET_BE32(kde.lifetime);
611 struct wpa_eapol_ie_parse kde;
624 if (wpa_supplicant_parse_ies((const u8 *) (key + 1), extra_len, &kde) <
630 if (kde.error == NULL || kde.error_len < sizeof(error)) {
631 wpa_printf(MSG_INFO, "RSN: No Error KDE in SMK Error");
635 if (kde.mac_addr && kde.mac_addr_len >= ETH_ALEN)
636 os_memcpy(peer, kde.mac_addr, ETH_ALEN);
637 os_memcpy(&error, kde.error, sizeof(error));
640 "RSN: SMK Error KDE received: MUI %d error_type %d peer "
645 if (kde.mac_addr &&
651 if (os_memcmp(peerkey->addr, kde.mac_addr, ETH_ALEN) ==
673 const u8 *kde;
685 kde = (const u8 *) (key + 1);
687 wpa_hexdump(MSG_DEBUG, "RSN: msg 1/4 key data", kde, len);
688 if (wpa_supplicant_parse_ies(kde, len, &ie) < 0 || ie.pmkid == NULL) {
747 struct wpa_eapol_ie_parse *kde)
752 if (kde->lifetime == NULL || kde->lifetime_len < sizeof(lifetime))
755 lifetime = WPA_GET_BE32(kde->lifetime);
782 struct wpa_eapol_ie_parse kde;
789 os_memset(&kde, 0, sizeof(kde));
792 * from the peer. It may also include Lifetime KDE. */
796 if (wpa_supplicant_parse_ies(keydata, len, &kde) < 0 ||
797 kde.pmkid == NULL || kde.rsn_ie == NULL) {
802 if (os_memcmp(kde.pmkid, peerkey->smkid, PMKID_LEN) != 0) {
804 kde.pmkid, PMKID_LEN);
808 if (kde.rsn_ie_len != peerkey->rsnie_p_len ||
809 os_memcmp(kde.rsn_ie, peerkey->rsnie_p, kde.rsn_ie_len) != 0) {
815 kde.rsn_ie, kde.rsn_ie_len);
819 wpa_supplicant_update_smk_lifetime(sm, peerkey, &kde);
831 struct wpa_eapol_ie_parse kde;
840 os_memset(&kde, 0, sizeof(kde));
843 * Lifetime KDE. */
847 if (wpa_supplicant_parse_ies(keydata, len, &kde) < 0) {
853 if (kde.rsn_ie_len != peerkey->rsnie_i_len ||
854 os_memcmp(kde.rsn_ie, peerkey->rsnie_i, kde.rsn_ie_len) != 0) {
862 kde.rsn_ie, kde.rsn_ie_len);
874 wpa_supplicant_update_smk_lifetime(sm, peerkey, &kde);
1047 * MIC=MIC, DataKDs=(RSNIE_I, MAC_P KDE))
1114 /* Peer MAC address KDE */