FT: Use BSSID as r1_key_holder if no value is configured
authorMichael Braun <michael-dev@fami-braun.de>
Wed, 24 Feb 2016 11:53:34 +0000 (12:53 +0100)
committerJouni Malinen <j@w1.fi>
Sun, 28 Feb 2016 15:56:42 +0000 (17:56 +0200)
r1_key_holder is an identifier that was always set to zero if unless
configured before.

See 11.6.1.7.4 of IEEE Std 802.11-2012 which reads
 "R1KH-ID is a MAC address of the holder of the PMK-R1 in the
  Authenticator of the AP"
See 12.2.2 of IEEE Std 802.11-2012 which reads
 "Each R0KH-ID and R1KH-ID is assumed to be expressed as a unique
  identifier within the mobility domain."
 "The R1KH-ID shall be set to a MAC address of the physical entity
  that stores the PMK-R1 ..."

Defaulting this to BSSID is a more reasonable value since we have not
rejected the missing r1_key_holder as invalid configuration.

Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
hostapd/hostapd.conf
src/ap/hostapd.c

index d535eec..fbc71d3 100644 (file)
@@ -1260,6 +1260,7 @@ own_ip_addr=127.0.0.1
 
 # PMK-R1 Key Holder identifier (dot11FTR1KeyHolderID)
 # 6-octet identifier as a hex string.
+# Defaults to BSSID.
 #r1_key_holder=000102030405
 
 # Reassociation deadline in time units (TUs / 1.024 ms; range 1000..65535)
index dd2dc17..4e7c037 100644 (file)
@@ -940,6 +940,11 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
        if (conf->wmm_enabled < 0)
                conf->wmm_enabled = hapd->iconf->ieee80211n;
 
+#ifdef CONFIG_IEEE80211R
+       if (is_zero_ether_addr(conf->r1_key_holder))
+               os_memcpy(conf->r1_key_holder, hapd->own_addr, ETH_ALEN);
+#endif /* CONFIG_IEEE80211R */
+
 #ifdef CONFIG_MESH
        if (hapd->iface->mconf == NULL)
                flush_old_stations = 0;