FILS: Add hostapd configuration options

This adds CONFIG_FILS=y build configuration option and new key
management options for FILS authentication.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-09-01 17:57:59 +03:00 committed by Jouni Malinen
parent 274d8b776f
commit 903ecbe8da
7 changed files with 87 additions and 0 deletions

View file

@ -258,6 +258,12 @@ NEED_ECC=y
NEED_DH_GROUPS=y NEED_DH_GROUPS=y
endif endif
ifdef CONFIG_FILS
L_CFLAGS += -DCONFIG_FILS
NEED_CRC32=y
NEED_SHA384=y
endif
ifdef CONFIG_WNM ifdef CONFIG_WNM
L_CFLAGS += -DCONFIG_WNM L_CFLAGS += -DCONFIG_WNM
OBJS += src/ap/wnm_ap.c OBJS += src/ap/wnm_ap.c
@ -852,6 +858,10 @@ ifdef NEED_ECC
L_CFLAGS += -DCONFIG_ECC L_CFLAGS += -DCONFIG_ECC
endif endif
ifdef NEED_CRC32
OBJS += src/utils/crc32.c
endif
ifdef CONFIG_NO_RANDOM_POOL ifdef CONFIG_NO_RANDOM_POOL
L_CFLAGS += -DCONFIG_NO_RANDOM_POOL L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
else else

View file

@ -305,6 +305,12 @@ NEED_DH_GROUPS=y
NEED_AP_MLME=y NEED_AP_MLME=y
endif endif
ifdef CONFIG_FILS
CFLAGS += -DCONFIG_FILS
NEED_CRC32=y
NEED_SHA384=y
endif
ifdef CONFIG_WNM ifdef CONFIG_WNM
CFLAGS += -DCONFIG_WNM CFLAGS += -DCONFIG_WNM
OBJS += ../src/ap/wnm_ap.o OBJS += ../src/ap/wnm_ap.o
@ -894,6 +900,10 @@ ifdef NEED_ECC
CFLAGS += -DCONFIG_ECC CFLAGS += -DCONFIG_ECC
endif endif
ifdef NEED_CRC32
OBJS += ../src/utils/crc32.o
endif
ifdef CONFIG_NO_RANDOM_POOL ifdef CONFIG_NO_RANDOM_POOL
CFLAGS += -DCONFIG_NO_RANDOM_POOL CFLAGS += -DCONFIG_NO_RANDOM_POOL
else else

View file

@ -710,6 +710,18 @@ static int hostapd_config_parse_key_mgmt(int line, const char *value)
else if (os_strcmp(start, "WPA-EAP-SUITE-B-192") == 0) else if (os_strcmp(start, "WPA-EAP-SUITE-B-192") == 0)
val |= WPA_KEY_MGMT_IEEE8021X_SUITE_B_192; val |= WPA_KEY_MGMT_IEEE8021X_SUITE_B_192;
#endif /* CONFIG_SUITEB192 */ #endif /* CONFIG_SUITEB192 */
#ifdef CONFIG_FILS
else if (os_strcmp(start, "FILS-SHA256") == 0)
val |= WPA_KEY_MGMT_FILS_SHA256;
else if (os_strcmp(start, "FILS-SHA384") == 0)
val |= WPA_KEY_MGMT_FILS_SHA384;
#ifdef CONFIG_IEEE80211R
else if (os_strcmp(start, "FT-FILS-SHA256") == 0)
val |= WPA_KEY_MGMT_FT_FILS_SHA256;
else if (os_strcmp(start, "FT-FILS-SHA384") == 0)
val |= WPA_KEY_MGMT_FT_FILS_SHA384;
#endif /* CONFIG_IEEE80211R */
#endif /* CONFIG_FILS */
else { else {
wpa_printf(MSG_ERROR, "Line %d: invalid key_mgmt '%s'", wpa_printf(MSG_ERROR, "Line %d: invalid key_mgmt '%s'",
line, start); line, start);
@ -3493,6 +3505,16 @@ static int hostapd_config_fill(struct hostapd_config *conf,
bss->ftm_responder = atoi(pos); bss->ftm_responder = atoi(pos);
} else if (os_strcmp(buf, "ftm_initiator") == 0) { } else if (os_strcmp(buf, "ftm_initiator") == 0) {
bss->ftm_initiator = atoi(pos); bss->ftm_initiator = atoi(pos);
#ifdef CONFIG_FILS
} else if (os_strcmp(buf, "fils_cache_id") == 0) {
if (hexstr2bin(pos, bss->fils_cache_id, FILS_CACHE_ID_LEN)) {
wpa_printf(MSG_ERROR,
"Line %d: Invalid fils_cache_id '%s'",
line, pos);
return 1;
}
bss->fils_cache_id_set = 1;
#endif /* CONFIG_FILS */
} else { } else {
wpa_printf(MSG_ERROR, wpa_printf(MSG_ERROR,
"Line %d: unknown configuration item '%s'", "Line %d: unknown configuration item '%s'",

View file

@ -1117,6 +1117,20 @@ static int hostapd_ctrl_iface_get_key_mgmt(struct hostapd_data *hapd,
pos += ret; pos += ret;
} }
#endif /* CONFIG_SAE */ #endif /* CONFIG_SAE */
#ifdef CONFIG_FILS
if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256) {
ret = os_snprintf(pos, end - pos, "FT-FILS-SHA256 ");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA384) {
ret = os_snprintf(pos, end - pos, "FT-FILS-SHA384 ");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#endif /* CONFIG_FILS */
#endif /* CONFIG_IEEE80211R */ #endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK_SHA256) { if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK_SHA256) {
@ -1154,6 +1168,20 @@ static int hostapd_ctrl_iface_get_key_mgmt(struct hostapd_data *hapd,
return pos - buf; return pos - buf;
pos += ret; pos += ret;
} }
#ifdef CONFIG_FILS
if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FILS_SHA256) {
ret = os_snprintf(pos, end - pos, "FILS-SHA256 ");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
if (hapd->conf->wpa_key_mgmt & WPA_KEY_MGMT_FILS_SHA384) {
ret = os_snprintf(pos, end - pos, "FILS-SHA384 ");
if (os_snprintf_error(end - pos, ret))
return pos - buf;
pos += ret;
}
#endif /* CONFIG_FILS */
if (pos > buf && *(pos - 1) == ' ') { if (pos > buf && *(pos - 1) == ' ') {
*(pos - 1) = '\0'; *(pos - 1) = '\0';

View file

@ -343,3 +343,8 @@ CONFIG_IPV6=y
# a client, from which a signature can be produced which can identify the model # a client, from which a signature can be produced which can identify the model
# of client device like "Nexus 6P" or "iPhone 5s". # of client device like "Nexus 6P" or "iPhone 5s".
#CONFIG_TAXONOMY=y #CONFIG_TAXONOMY=y
# Fast Initial Link Setup (FILS) (IEEE 802.11ai)
# Note: This is an experimental and not yet complete implementation. This
# should not be enabled for production use.
#CONFIG_FILS=y

View file

@ -1163,6 +1163,10 @@ own_ip_addr=127.0.0.1
# Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The # Set of accepted key management algorithms (WPA-PSK, WPA-EAP, or both). The
# entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be # entries are separated with a space. WPA-PSK-SHA256 and WPA-EAP-SHA256 can be
# added to enable SHA256-based stronger algorithms. # added to enable SHA256-based stronger algorithms.
# FILS-SHA256 = Fast Initial Link Setup with SHA256
# FILS-SHA384 = Fast Initial Link Setup with SHA384
# FT-FILS-SHA256 = FT and Fast Initial Link Setup with SHA256
# FT-FILS-SHA384 = FT and Fast Initial Link Setup with SHA384
# (dot11RSNAConfigAuthenticationSuitesTable) # (dot11RSNAConfigAuthenticationSuitesTable)
#wpa_key_mgmt=WPA-PSK WPA-EAP #wpa_key_mgmt=WPA-PSK WPA-EAP
@ -1273,6 +1277,9 @@ own_ip_addr=127.0.0.1
# http://www.iana.org/assignments/ipsec-registry/ipsec-registry.xml#ipsec-registry-9 # http://www.iana.org/assignments/ipsec-registry/ipsec-registry.xml#ipsec-registry-9
#sae_groups=19 20 21 25 26 #sae_groups=19 20 21 25 26
# FILS Cache Identifier (16-bit value in hexdump format)
#fils_cache_id=0011
##### IEEE 802.11r configuration ############################################## ##### IEEE 802.11r configuration ##############################################
# Mobility Domain identifier (dot11FTMobilityDomainID, MDID) # Mobility Domain identifier (dot11FTMobilityDomainID, MDID)

View file

@ -596,6 +596,11 @@ struct hostapd_bss_config {
int ftm_responder; int ftm_responder;
int ftm_initiator; int ftm_initiator;
#ifdef CONFIG_FILS
u8 fils_cache_id[FILS_CACHE_ID_LEN];
int fils_cache_id_set;
#endif /* CONFIG_FILS */
}; };