OCV: Add hostapd config parameter

Add hostapd.conf parameter ocv to disable or enable Operating Channel
Verification (OCV) support.

Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
This commit is contained in:
Mathy Vanhoef 2018-08-06 15:46:25 -04:00 committed by Jouni Malinen
parent 138205d600
commit 9c55fdb023
4 changed files with 25 additions and 0 deletions

View file

@ -3316,6 +3316,12 @@ static int hostapd_config_fill(struct hostapd_config *conf,
return 1; return 1;
} }
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_OCV
} else if (os_strcmp(buf, "ocv") == 0) {
bss->ocv = atoi(pos);
if (bss->ocv && !bss->ieee80211w)
bss->ieee80211w = 1;
#endif /* CONFIG_OCV */
#ifdef CONFIG_IEEE80211N #ifdef CONFIG_IEEE80211N
} else if (os_strcmp(buf, "ieee80211n") == 0) { } else if (os_strcmp(buf, "ieee80211n") == 0) {
conf->ieee80211n = atoi(pos); conf->ieee80211n = atoi(pos);

View file

@ -1418,6 +1418,13 @@ own_ip_addr=127.0.0.1
# dot11AssociationSAQueryRetryTimeout, 1...4294967295 # dot11AssociationSAQueryRetryTimeout, 1...4294967295
#assoc_sa_query_retry_timeout=201 #assoc_sa_query_retry_timeout=201
# ocv: Operating Channel Validation
# This is a countermeasure against multi-channel man-in-the-middle attacks.
# Enabling this automatically also enables ieee80211w, if not yet enabled.
# 0 = disabled (default)
# 1 = enabled
#ocv=1
# disable_pmksa_caching: Disable PMKSA caching # disable_pmksa_caching: Disable PMKSA caching
# This parameter can be used to disable caching of PMKSA created through EAP # This parameter can be used to disable caching of PMKSA created through EAP
# authentication. RSN preauthentication may still end up using PMKSA caching if # authentication. RSN preauthentication may still end up using PMKSA caching if

View file

@ -1009,6 +1009,15 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
} }
#endif /* CONFIG_MBO */ #endif /* CONFIG_MBO */
#ifdef CONFIG_OCV
if (full_config && bss->ieee80211w == NO_MGMT_FRAME_PROTECTION &&
bss->ocv) {
wpa_printf(MSG_ERROR,
"OCV: PMF needs to be enabled whenever using OCV");
return -1;
}
#endif /* CONFIG_OCV */
return 0; return 0;
} }

View file

@ -335,6 +335,9 @@ struct hostapd_bss_config {
/* dot11AssociationSAQueryRetryTimeout (in TUs) */ /* dot11AssociationSAQueryRetryTimeout (in TUs) */
int assoc_sa_query_retry_timeout; int assoc_sa_query_retry_timeout;
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_OCV
int ocv; /* Operating Channel Validation */
#endif /* CONFIG_OCV */
enum { enum {
PSK_RADIUS_IGNORED = 0, PSK_RADIUS_IGNORED = 0,
PSK_RADIUS_ACCEPTED = 1, PSK_RADIUS_ACCEPTED = 1,