]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
atheros: Add FILS AAD parameters in sta_auth() handler
authorJeffin Mammen <jmammen@qti.qualcomm.com>
Fri, 21 Apr 2017 16:39:55 +0000 (19:39 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 23 Apr 2017 14:47:15 +0000 (17:47 +0300)
This is needed to allow the driver SME to perform the needed AES-SIV
operations during FILS association.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/drivers/driver.h
src/drivers/driver_atheros.c

index 3a3a3dff1aa4f8f5ac0a0ad541d0e0f07c91f4eb..6098329c505f4d19a27ce784a0a9aa78e9e93bcc 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "common/defs.h"
 #include "common/ieee802_11_defs.h"
+#include "common/wpa_common.h"
 #ifdef CONFIG_MACSEC
 #include "pae/ieee802_1x_kay.h"
 #endif /* CONFIG_MACSEC */
@@ -719,6 +720,31 @@ struct wpa_driver_sta_auth_params {
         * len - ie buffer length
         */
        size_t len;
+
+       /**
+        * fils_auth - Indicates whether FILS authentication is being performed
+        */
+       int fils_auth;
+
+       /**
+        * fils_anonce - ANonce (required for FILS)
+        */
+       u8 fils_anonce[WPA_NONCE_LEN];
+
+       /**
+        * fils_snonce - SNonce (required for FILS)
+       */
+       u8 fils_snonce[WPA_NONCE_LEN];
+
+       /**
+        * fils_kek - key for encryption (required for FILS)
+        */
+       u8 fils_kek[WPA_KEK_MAX_LEN];
+
+       /**
+        * fils_kek_len - Length of the fils_kek in octets (required for FILS)
+        */
+       size_t fils_kek_len;
 };
 
 /**
index c64183ccc849a39266f862379058dd8835d1289d..ca8d2276dded9bb354a6391392c2bc9f6cfdff7b 100644 (file)
 
 #include "ieee80211_external.h"
 
+/* Avoid conflicting definition from the driver header files with
+ * common/wpa_common.h */
+#undef WPA_OUI_TYPE
+
 
 #ifdef CONFIG_WPS
 #include <netpacket/packet.h>
@@ -1065,7 +1069,32 @@ atheros_sta_auth(void *priv, struct wpa_driver_sta_auth_params *params)
        wpa_printf(MSG_DEBUG, "%s: addr=%s status_code=%d",
                   __func__, ether_sprintf(params->addr), params->status);
 
+#ifdef CONFIG_FILS
+       /* Copy FILS AAD parameters if the driver supports FILS */
+       if (params->fils_auth && drv->fils_en) {
+               wpa_printf(MSG_DEBUG, "%s: im_op IEEE80211_MLME_AUTH_FILS",
+                          __func__);
+               os_memcpy(mlme.fils_aad.ANonce, params->fils_anonce,
+                         IEEE80211_FILS_NONCE_LEN);
+               os_memcpy(mlme.fils_aad.SNonce, params->fils_snonce,
+                         IEEE80211_FILS_NONCE_LEN);
+               os_memcpy(mlme.fils_aad.kek, params->fils_kek,
+                         IEEE80211_MAX_WPA_KEK_LEN);
+               mlme.fils_aad.kek_len = params->fils_kek_len;
+               mlme.im_op = IEEE80211_MLME_AUTH_FILS;
+               wpa_hexdump(MSG_DEBUG, "FILS: ANonce",
+                           mlme.fils_aad.ANonce, FILS_NONCE_LEN);
+               wpa_hexdump(MSG_DEBUG, "FILS: SNonce",
+                           mlme.fils_aad.SNonce, FILS_NONCE_LEN);
+               wpa_hexdump_key(MSG_DEBUG, "FILS: KEK",
+                               mlme.fils_aad.kek, mlme.fils_aad.kek_len);
+       } else {
+               mlme.im_op = IEEE80211_MLME_AUTH;
+       }
+#else /* CONFIG_FILS */
        mlme.im_op = IEEE80211_MLME_AUTH;
+#endif /* CONFIG_FILS */
+
        mlme.im_reason = params->status;
        mlme.im_seq = params->seq;
        os_memcpy(mlme.im_macaddr, params->addr, IEEE80211_ADDR_LEN);