Lines Matching defs:kde
32 static u8 * wpa_add_kde(u8 *pos, u32 kde, const u8 *data, size_t data_len)
36 RSN_SELECTOR_PUT(pos, kde);
97 /* Peer MAC Address KDE */
101 /* Error KDE */
160 /* Initiator MAC Address KDE */
179 struct wpa_eapol_ie_parse kde;
193 if (wpa_supplicant_parse_ies((const u8 *) (key + 1), extra_len, &kde) <
199 if (kde.rsn_ie == NULL || kde.mac_addr == NULL ||
200 kde.mac_addr_len < ETH_ALEN) {
201 wpa_printf(MSG_INFO, "RSN: No RSN IE or MAC address KDE in "
207 MAC2STR(kde.mac_addr));
209 if (kde.rsn_ie_len > PEERKEY_MAX_IE_LEN) {
215 if (wpa_parse_wpa_ie_rsn(kde.rsn_ie, kde.rsn_ie_len, &ie) < 0) {
224 wpa_supplicant_send_smk_error(sm, src_addr, kde.mac_addr,
238 os_memcpy(peerkey->addr, kde.mac_addr, ETH_ALEN);
240 os_memcpy(peerkey->rsnie_i, kde.rsn_ie, kde.rsn_ie_len);
241 peerkey->rsnie_i_len = kde.rsn_ie_len;
435 struct wpa_eapol_ie_parse *kde)
438 MAC2STR(kde->mac_addr));
440 if (os_memcmp(kde->smk + PMK_LEN, peerkey->pnonce, WPA_NONCE_LEN) != 0)
442 wpa_printf(MSG_INFO, "RSN: PNonce in SMK KDE does not "
447 if (os_memcmp(kde->nonce, peerkey->inonce, WPA_NONCE_LEN) != 0) {
462 struct wpa_eapol_ie_parse *kde)
468 MAC2STR(kde->mac_addr));
469 if (kde->rsn_ie == NULL || kde->rsn_ie_len > PEERKEY_MAX_IE_LEN ||
470 wpa_parse_wpa_ie_rsn(kde->rsn_ie, kde->rsn_ie_len, &ie) < 0) {
482 if (os_memcmp(kde->smk + PMK_LEN, peerkey->inonce, WPA_NONCE_LEN) != 0)
484 wpa_printf(MSG_INFO, "RSN: INonce in SMK KDE does not "
489 os_memcpy(peerkey->rsnie_p, kde->rsn_ie, kde->rsn_ie_len);
490 peerkey->rsnie_p_len = kde->rsn_ie_len;
491 os_memcpy(peerkey->pnonce, kde->nonce, WPA_NONCE_LEN);
497 "unacceptable cipher", MAC2STR(kde->mac_addr));
498 wpa_supplicant_send_smk_error(sm, src_addr, kde->mac_addr,
517 struct wpa_eapol_ie_parse kde;
527 if (wpa_supplicant_parse_ies((const u8 *) (key + 1), extra_len, &kde) <
533 if (kde.mac_addr == NULL || kde.mac_addr_len < ETH_ALEN ||
534 kde.nonce == NULL || kde.nonce_len < WPA_NONCE_LEN ||
535 kde.smk == NULL || kde.smk_len < PMK_LEN + WPA_NONCE_LEN ||
536 kde.lifetime == NULL || kde.lifetime_len < 4) {
538 "Lifetime KDE in SMK M4/M5");
543 if (os_memcmp(peerkey->addr, kde.mac_addr, ETH_ALEN) == 0 &&
552 MAC2STR(kde.mac_addr));
558 peerkey, &kde) < 0)
561 if (wpa_supplicant_process_smk_m4(peerkey, &kde) < 0)
565 os_memcpy(peerkey->smk, kde.smk, PMK_LEN);
568 lifetime = WPA_GET_BE32(kde.lifetime);
598 struct wpa_eapol_ie_parse kde;
611 if (wpa_supplicant_parse_ies((const u8 *) (key + 1), extra_len, &kde) <
617 if (kde.error == NULL || kde.error_len < sizeof(error)) {
618 wpa_printf(MSG_INFO, "RSN: No Error KDE in SMK Error");
622 if (kde.mac_addr && kde.mac_addr_len >= ETH_ALEN)
623 os_memcpy(peer, kde.mac_addr, ETH_ALEN);
626 os_memcpy(&error, kde.error, sizeof(error));
629 "RSN: SMK Error KDE received: MUI %d error_type %d peer "
634 if (kde.mac_addr &&
640 if (os_memcmp(peerkey->addr, kde.mac_addr, ETH_ALEN) ==
662 const u8 *kde;
674 kde = (const u8 *) (key + 1);
676 wpa_hexdump(MSG_DEBUG, "RSN: msg 1/4 key data", kde, len);
677 if (wpa_supplicant_parse_ies(kde, len, &ie) < 0 || ie.pmkid == NULL) {
736 struct wpa_eapol_ie_parse *kde)
741 if (kde->lifetime == NULL || kde->lifetime_len < sizeof(lifetime))
744 lifetime = WPA_GET_BE32(kde->lifetime);
771 struct wpa_eapol_ie_parse kde;
778 os_memset(&kde, 0, sizeof(kde));
781 * from the peer. It may also include Lifetime KDE. */
785 if (wpa_supplicant_parse_ies(keydata, len, &kde) < 0 ||
786 kde.pmkid == NULL || kde.rsn_ie == NULL) {
791 if (os_memcmp(kde.pmkid, peerkey->smkid, PMKID_LEN) != 0) {
793 kde.pmkid, PMKID_LEN);
797 if (kde.rsn_ie_len != peerkey->rsnie_p_len ||
798 os_memcmp(kde.rsn_ie, peerkey->rsnie_p, kde.rsn_ie_len) != 0) {
804 kde.rsn_ie, kde.rsn_ie_len);
808 wpa_supplicant_update_smk_lifetime(sm, peerkey, &kde);
820 struct wpa_eapol_ie_parse kde;
829 os_memset(&kde, 0, sizeof(kde));
832 * Lifetime KDE. */
836 if (wpa_supplicant_parse_ies(keydata, len, &kde) < 0) {
842 if (kde.rsn_ie_len != peerkey->rsnie_i_len ||
843 os_memcmp(kde.rsn_ie, peerkey->rsnie_i, kde.rsn_ie_len) != 0) {
851 kde.rsn_ie, kde.rsn_ie_len);
863 wpa_supplicant_update_smk_lifetime(sm, peerkey, &kde);
1036 * MIC=MIC, DataKDs=(RSNIE_I, MAC_P KDE))
1094 /* Peer MAC address KDE */