1 From: Jouni Malinen <j@w1.fi>
2 Date: Fri, 22 Sep 2017 12:06:37 +0300
3 Subject: [PATCH] FT: Do not allow multiple Reassociation Response frames
5 The driver is expected to not report a second association event without
6 the station having explicitly request a new association. As such, this
7 case should not be reachable. However, since reconfiguring the same
8 pairwise or group keys to the driver could result in nonce reuse issues,
9 be extra careful here and do an additional state check to avoid this
10 even if the local driver ends up somehow accepting an unexpected
11 Reassociation Response frame.
13 Signed-off-by: Jouni Malinen <j@w1.fi>
16 --- a/src/rsn_supp/wpa.c
17 +++ b/src/rsn_supp/wpa.c
18 @@ -2637,6 +2637,9 @@ void wpa_sm_notify_disassoc(struct wpa_s
20 sm->fils_completed = 0;
21 #endif /* CONFIG_FILS */
22 +#ifdef CONFIG_IEEE80211R
23 + sm->ft_reassoc_completed = 0;
24 +#endif /* CONFIG_IEEE80211R */
26 /* Keys are not needed in the WPA state machine anymore */
28 --- a/src/rsn_supp/wpa_ft.c
29 +++ b/src/rsn_supp/wpa_ft.c
30 @@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp
34 + sm->ft_reassoc_completed = 0;
36 buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) +
37 2 + sm->r0kh_id_len + ric_ies_len + 100;
38 @@ -687,6 +688,11 @@ int wpa_ft_validate_reassoc_resp(struct
42 + if (sm->ft_reassoc_completed) {
43 + wpa_printf(MSG_DEBUG, "FT: Reassociation has already been completed for this FT protocol instance - ignore unexpected retransmission");
47 if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) {
48 wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
50 @@ -787,6 +793,8 @@ int wpa_ft_validate_reassoc_resp(struct
54 + sm->ft_reassoc_completed = 1;
56 if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
59 --- a/src/rsn_supp/wpa_i.h
60 +++ b/src/rsn_supp/wpa_i.h
61 @@ -128,6 +128,7 @@ struct wpa_sm {
63 u8 r1kh_id[FT_R1KH_ID_LEN];
65 + int ft_reassoc_completed;
66 int over_the_ds_in_progress;
67 u8 target_ap[ETH_ALEN]; /* over-the-DS target AP */
68 int set_ptk_after_assoc;