OCV: Add support to override channel info OCI element (STA)

To support the STA testbed role, the STA has to use specified channel
information in OCI element sent to the AP in EAPOL-Key msg 2/4, SA Query
Request, and SA Query Response frames. Add override parameters to use
the specified channel while populating OCI element in all these frames.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Vamsi Krishna 2020-05-08 23:29:04 +05:30 committed by Jouni Malinen
parent c2080e8657
commit 2d118f557a
7 changed files with 47 additions and 0 deletions

View file

@ -756,6 +756,14 @@ static void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
"Failed to get channel info for OCI element in EAPOL-Key 2/4");
goto failed;
}
#ifdef CONFIG_TESTING_OPTIONS
if (sm->oci_freq_override_eapol) {
wpa_printf(MSG_INFO,
"TEST: Override OCI KDE frequency %d -> %d MHz",
ci.frequency, sm->oci_freq_override_eapol);
ci.frequency = sm->oci_freq_override_eapol;
}
#endif /* CONFIG_TESTING_OPTIONS */
if (ocv_insert_oci_kde(&ci, &pos) < 0)
goto failed;
@ -3291,6 +3299,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
case WPA_PARAM_FT_RSNXE_USED:
sm->ft_rsnxe_used = value;
break;
case WPA_PARAM_OCI_FREQ_EAPOL:
sm->oci_freq_override_eapol = value;
break;
#endif /* CONFIG_TESTING_OPTIONS */
#ifdef CONFIG_DPP2
case WPA_PARAM_DPP_PFS:

View file

@ -108,6 +108,7 @@ enum wpa_sm_conf_params {
WPA_PARAM_USE_EXT_KEY_ID,
WPA_PARAM_FT_RSNXE_USED,
WPA_PARAM_DPP_PFS,
WPA_PARAM_OCI_FREQ_EAPOL,
};
struct rsn_supp_config {

View file

@ -154,6 +154,7 @@ struct wpa_sm {
#ifdef CONFIG_TESTING_OPTIONS
struct wpabuf *test_assoc_ie;
int ft_rsnxe_used;
unsigned int oci_freq_override_eapol;
#endif /* CONFIG_TESTING_OPTIONS */
#ifdef CONFIG_FILS