Add TEST_ASSOC_IE for WPA/RSN IE testing on AP side
The new wpa_supplicant control interface command "TEST_ASSOC_IE <hexdump>" can now be used to override the WPA/RSN IE for Association Request frame and following 4-way handshake to allow protocol testing of AP side processing of WPA/RSN IE. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
8eb45bde38
commit
651c6a84af
4 changed files with 61 additions and 0 deletions
|
@ -2291,6 +2291,9 @@ void wpa_sm_deinit(struct wpa_sm *sm)
|
|||
#ifdef CONFIG_IEEE80211R
|
||||
os_free(sm->assoc_resp_ies);
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
#ifdef CONFIG_TESTING_OPTIONS
|
||||
wpabuf_free(sm->test_assoc_ie);
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
os_free(sm);
|
||||
}
|
||||
|
||||
|
@ -2692,6 +2695,17 @@ int wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm, u8 *wpa_ie,
|
|||
if (sm == NULL)
|
||||
return -1;
|
||||
|
||||
#ifdef CONFIG_TESTING_OPTIONS
|
||||
if (sm->test_assoc_ie) {
|
||||
wpa_printf(MSG_DEBUG,
|
||||
"TESTING: Replace association WPA/RSN IE");
|
||||
if (*wpa_ie_len < wpabuf_len(sm->test_assoc_ie))
|
||||
return -1;
|
||||
os_memcpy(wpa_ie, wpabuf_head(sm->test_assoc_ie),
|
||||
wpabuf_len(sm->test_assoc_ie));
|
||||
res = wpabuf_len(sm->test_assoc_ie);
|
||||
} else
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
res = wpa_gen_wpa_ie(sm, wpa_ie, *wpa_ie_len);
|
||||
if (res < 0)
|
||||
return -1;
|
||||
|
@ -3031,3 +3045,12 @@ void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm,
|
|||
}
|
||||
sm->ptk_set = 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_TESTING_OPTIONS
|
||||
void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf)
|
||||
{
|
||||
wpabuf_free(sm->test_assoc_ie);
|
||||
sm->test_assoc_ie = buf;
|
||||
}
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
|
|
|
@ -419,5 +419,6 @@ int wpa_tdls_enable_chan_switch(struct wpa_sm *sm, const u8 *addr,
|
|||
int wpa_tdls_disable_chan_switch(struct wpa_sm *sm, const u8 *addr);
|
||||
|
||||
int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf);
|
||||
void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf);
|
||||
|
||||
#endif /* WPA_H */
|
||||
|
|
|
@ -134,6 +134,10 @@ struct wpa_sm {
|
|||
#ifdef CONFIG_P2P
|
||||
u8 p2p_ip_addr[3 * 4];
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
#ifdef CONFIG_TESTING_OPTIONS
|
||||
struct wpabuf *test_assoc_ie;
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue