aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-03-12 20:45:35 (GMT)
committerJouni Malinen <j@w1.fi>2017-03-12 21:20:32 (GMT)
commit76e20f4fa7025b8e6887b9bd55a5072ca7d74677 (patch)
tree4b367a4940d392336b16efa25ce2908fac29f9ea /wpa_supplicant/sme.c
parent1764559eef3020afebb427d48799c13514f45de0 (diff)
downloadhostap-76e20f4fa7025b8e6887b9bd55a5072ca7d74677.zip
hostap-76e20f4fa7025b8e6887b9bd55a5072ca7d74677.tar.gz
hostap-76e20f4fa7025b8e6887b9bd55a5072ca7d74677.tar.bz2
FILS: Add FILS SK auth PFS support in STA mode
This adds an option to configure wpa_supplicant to use the perfect forward secrecy option in FILS shared key authentication. A new build option CONFIG_FILS_SK_PFS=y can be used to include this functionality. A new runtime network profile parameter fils_dh_group is used to enable this by specifying which DH group to use. For example, fils_dh_group=19 would use FILS SK PFS with a 256-bit random ECP group. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 76d1acd..5ab56c8 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -563,12 +563,23 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
0)
wpa_printf(MSG_DEBUG,
"SME: Try to use FILS with PMKSA caching");
- resp = fils_build_auth(wpa_s->wpa);
+ resp = fils_build_auth(wpa_s->wpa, ssid->fils_dh_group);
if (resp) {
- params.auth_alg = WPA_AUTH_ALG_FILS;
+ int auth_alg;
+
+ if (ssid->fils_dh_group)
+ wpa_printf(MSG_DEBUG,
+ "SME: Try to use FILS SK authentication with PFS (DH Group %u)",
+ ssid->fils_dh_group);
+ else
+ wpa_printf(MSG_DEBUG,
+ "SME: Try to use FILS SK authentication without PFS");
+ auth_alg = ssid->fils_dh_group ?
+ WPA_AUTH_ALG_FILS_SK_PFS : WPA_AUTH_ALG_FILS;
+ params.auth_alg = auth_alg;
params.auth_data = wpabuf_head(resp);
params.auth_data_len = wpabuf_len(resp);
- wpa_s->sme.auth_alg = WPA_AUTH_ALG_FILS;
+ wpa_s->sme.auth_alg = auth_alg;
}
}
#endif /* CONFIG_FILS */
@@ -968,7 +979,27 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_FILS
- if (data->auth.auth_type == WLAN_AUTH_FILS_SK) {
+ if (data->auth.auth_type == WLAN_AUTH_FILS_SK ||
+ data->auth.auth_type == WLAN_AUTH_FILS_SK_PFS) {
+ u16 expect_auth_type;
+
+ expect_auth_type = wpa_s->sme.auth_alg ==
+ WPA_AUTH_ALG_FILS_SK_PFS ? WLAN_AUTH_FILS_SK_PFS :
+ WLAN_AUTH_FILS_SK;
+ if (data->auth.auth_type != expect_auth_type) {
+ wpa_dbg(wpa_s, MSG_DEBUG,
+ "SME: FILS Authentication response used different auth alg (%u; expected %u)",
+ data->auth.auth_type, expect_auth_type);
+ wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_DISCONNECTED "bssid="
+ MACSTR
+ " reason=%d locally_generated=1",
+ MAC2STR(wpa_s->pending_bssid),
+ WLAN_REASON_DEAUTH_LEAVING);
+ wpas_connection_failed(wpa_s, wpa_s->pending_bssid);
+ wpa_supplicant_mark_disassoc(wpa_s);
+ return;
+ }
+
if (fils_process_auth(wpa_s->wpa, wpa_s->pending_bssid,
data->auth.ies, data->auth.ies_len) < 0) {
wpa_dbg(wpa_s, MSG_DEBUG,
@@ -1010,7 +1041,8 @@ void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
os_memset(&params, 0, sizeof(params));
#ifdef CONFIG_FILS
- if (auth_type == WLAN_AUTH_FILS_SK) {
+ if (auth_type == WLAN_AUTH_FILS_SK ||
+ auth_type == WLAN_AUTH_FILS_SK_PFS) {
struct wpabuf *buf;
const u8 *snonce, *anonce;
const unsigned int max_hlp = 20;