Deleted Added
full compact
wpa_ft.c (302408) wpa_ft.c (324697)
1/*
2 * WPA Supplicant - IEEE 802.11r - Fast BSS Transition
3 * Copyright (c) 2006-2015, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8

--- 139 unchanged lines hidden (view full) ---

148 size_t buf_len;
149 u8 *buf, *pos, *ftie_len, *ftie_pos;
150 struct rsn_mdie *mdie;
151 struct rsn_ftie *ftie;
152 struct rsn_ie_hdr *rsnie;
153 u16 capab;
154
155 sm->ft_completed = 0;
1/*
2 * WPA Supplicant - IEEE 802.11r - Fast BSS Transition
3 * Copyright (c) 2006-2015, Jouni Malinen <j@w1.fi>
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8

--- 139 unchanged lines hidden (view full) ---

148 size_t buf_len;
149 u8 *buf, *pos, *ftie_len, *ftie_pos;
150 struct rsn_mdie *mdie;
151 struct rsn_ftie *ftie;
152 struct rsn_ie_hdr *rsnie;
153 u16 capab;
154
155 sm->ft_completed = 0;
156 sm->ft_reassoc_completed = 0;
156
157 buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
158 2 + sm->r0kh_id_len + ric_ies_len + 100;
159 buf = os_zalloc(buf_len);
160 if (buf == NULL)
161 return NULL;
162 pos = buf;
163

--- 512 unchanged lines hidden (view full) ---

676 wpa_hexdump(MSG_DEBUG, "FT: Response IEs", ies, ies_len);
677
678 if (!wpa_key_mgmt_ft(sm->key_mgmt)) {
679 wpa_printf(MSG_DEBUG, "FT: Reject FT IEs since FT is not "
680 "enabled for this connection");
681 return -1;
682 }
683
157
158 buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
159 2 + sm->r0kh_id_len + ric_ies_len + 100;
160 buf = os_zalloc(buf_len);
161 if (buf == NULL)
162 return NULL;
163 pos = buf;
164

--- 512 unchanged lines hidden (view full) ---

677 wpa_hexdump(MSG_DEBUG, "FT: Response IEs", ies, ies_len);
678
679 if (!wpa_key_mgmt_ft(sm->key_mgmt)) {
680 wpa_printf(MSG_DEBUG, "FT: Reject FT IEs since FT is not "
681 "enabled for this connection");
682 return -1;
683 }
684
685 if (sm->ft_reassoc_completed) {
686 wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
687 return 0;
688 }
689
684 if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
685 wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
686 return -1;
687 }
688
689 mdie = (struct rsn_mdie *) parse.mdie;
690 if (mdie == NULL || parse.mdie_len < sizeof(*mdie) ||
691 os_memcmp(mdie->mobility_domain, sm->mobility_domain,

--- 84 unchanged lines hidden (view full) ---

776
777 if (os_memcmp_const(mic, ftie->mic, 16) != 0) {
778 wpa_printf(MSG_DEBUG, "FT: Invalid MIC in FTIE");
779 wpa_hexdump(MSG_MSGDUMP, "FT: Received MIC", ftie->mic, 16);
780 wpa_hexdump(MSG_MSGDUMP, "FT: Calculated MIC", mic, 16);
781 return -1;
782 }
783
690 if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
691 wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
692 return -1;
693 }
694
695 mdie = (struct rsn_mdie *) parse.mdie;
696 if (mdie == NULL || parse.mdie_len < sizeof(*mdie) ||
697 os_memcmp(mdie->mobility_domain, sm->mobility_domain,

--- 84 unchanged lines hidden (view full) ---

782
783 if (os_memcmp_const(mic, ftie->mic, 16) != 0) {
784 wpa_printf(MSG_DEBUG, "FT: Invalid MIC in FTIE");
785 wpa_hexdump(MSG_MSGDUMP, "FT: Received MIC", ftie->mic, 16);
786 wpa_hexdump(MSG_MSGDUMP, "FT: Calculated MIC", mic, 16);
787 return -1;
788 }
789
790 sm->ft_reassoc_completed = 1;
791
784 if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
785 return -1;
786
787#ifdef CONFIG_IEEE80211W
788 if (wpa_ft_process_igtk_subelem(sm, parse.igtk, parse.igtk_len) < 0)
789 return -1;
790#endif /* CONFIG_IEEE80211W */
791

--- 56 unchanged lines hidden ---
792 if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
793 return -1;
794
795#ifdef CONFIG_IEEE80211W
796 if (wpa_ft_process_igtk_subelem(sm, parse.igtk, parse.igtk_len) < 0)
797 return -1;
798#endif /* CONFIG_IEEE80211W */
799

--- 56 unchanged lines hidden ---