[01/14] PASN: Add some specification definitions
diff mbox series

Message ID 20200224091529.15259-2-ilan.peer@intel.com
State Changes Requested
Headers show
Series
  • Support base Pre association Security Negotiation (PASN)
Related show

Commit Message

Peer, Ilan Feb. 24, 2020, 9:15 a.m. UTC
Based on Draft P802.11az_D2.0.

Note that these are only placeholders to allow
to implement the algorithms. These definitions
would need to changed once the specification is updated.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/common/ieee802_11_defs.h | 11 +++++++++++
 src/common/wpa_common.h      | 23 +++++++++++++++++++++++
 wlantest/Makefile            |  1 +
 3 files changed, 35 insertions(+)

Comments

Jouni Malinen Feb. 29, 2020, 10:15 p.m. UTC | #1
On Mon, Feb 24, 2020 at 11:15:16AM +0200, Ilan Peer wrote:
> Based on Draft P802.11az_D2.0.
> 
> Note that these are only placeholders to allow
> to implement the algorithms. These definitions
> would need to changed once the specification is updated.

These are waiting for ANA assignment and as such, I don't think
P802.11az/D2.0 is yet stable enough to justify this to be applied.

Patch
diff mbox series

diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index 7c51574b58..94d5c52d90 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -84,6 +84,12 @@ 
 #define WLAN_AUTH_FILS_SK		4
 #define WLAN_AUTH_FILS_SK_PFS		5
 #define WLAN_AUTH_FILS_PK		6
+
+#ifdef CONFIG_PASN
+/* TODO: the PASN algorithm is not defined in the spec. */
+#define WLAN_AUTH_PASN			7
+#endif /* CONFIG_PASN */
+
 #define WLAN_AUTH_LEAP			128
 
 #define WLAN_AUTH_CHALLENGE_LEN 128
@@ -478,6 +484,11 @@ 
 #define WLAN_EID_EXT_REJECTED_GROUPS 92
 #define WLAN_EID_EXT_ANTI_CLOGGING_TOKEN 93
 
+#ifdef CONFIG_PASN
+/* TODO: the PASN Parameters element is not defined yet in the spec */
+#define WLAN_EID_EXT_PASN_PARAMS 128
+#endif /* CONFIG_PASN */
+
 /* Extended Capabilities field */
 #define WLAN_EXT_CAPAB_20_40_COEX 0
 #define WLAN_EXT_CAPAB_GLK 1
diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
index 57d47f03eb..3e9e00558e 100644
--- a/src/common/wpa_common.h
+++ b/src/common/wpa_common.h
@@ -19,6 +19,8 @@ 
 #define WPA_KEY_RSC_LEN 8
 #define WPA_GMK_LEN 32
 #define WPA_GTK_MAX_LEN 32
+#define WPA_PASN_PMK_LEN 32
+#define WPA_PASN_MAX_MIC_LEN 24
 
 #define OWE_DH_GROUP 19
 
@@ -68,6 +70,10 @@  WPA_CIPHER_BIP_CMAC_256)
 #define RSN_AUTH_KEY_MGMT_FT_FILS_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 16)
 #define RSN_AUTH_KEY_MGMT_FT_FILS_SHA384 RSN_SELECTOR(0x00, 0x0f, 0xac, 17)
 #define RSN_AUTH_KEY_MGMT_OWE RSN_SELECTOR(0x00, 0x0f, 0xac, 18)
+
+/* TODO: PASN is not defined yet */
+#define RSN_AUTH_KEY_MGMT_PASN RSN_SELECTOR(0x00, 0x0f, 0xac, 19)
+
 #define RSN_AUTH_KEY_MGMT_CCKM RSN_SELECTOR(0x00, 0x40, 0x96, 0x00)
 #define RSN_AUTH_KEY_MGMT_OSEN RSN_SELECTOR(0x50, 0x6f, 0x9a, 0x01)
 #define RSN_AUTH_KEY_MGMT_DPP RSN_SELECTOR(0x50, 0x6f, 0x9a, 0x02)
@@ -489,6 +495,23 @@  struct wpa_ft_ies {
 	size_t rsnxe_len;
 };
 
+/* Based on Draft P802.11az_D2.0 */
+#define WPA_PASN_CTRL_COMEBACK_INFO_PRESENT BIT(0)
+#define WPA_PASN_CTRL_GROUP_AND_KEY_PRESENT BIT(1)
+
+#define WPA_PASN_NO_WRAPPED_DATA      0
+#define WPA_PASN_WRAPPED_DATA_FT      1
+#define WPA_PASN_WRAPPED_DATA_FILS_SK 2
+#define WPA_PASN_WRAPPED_DATA_SAE     3
+
+struct pasn_parameter_ie {
+	u8 id;
+	u8 len;
+	u8 id_ext;
+	u8 control;
+	u8 wrapped_data_format;
+} STRUCT_PACKED;
+
 int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse,
 		     int use_sha384);
 
diff --git a/wlantest/Makefile b/wlantest/Makefile
index 0fdf3ff91f..8ac46b32e0 100644
--- a/wlantest/Makefile
+++ b/wlantest/Makefile
@@ -54,6 +54,7 @@  CFLAGS += -DCONFIG_SAE
 CFLAGS += -DCONFIG_OWE
 CFLAGS += -DCONFIG_DPP
 CFLAGS += -DCONFIG_SHA384
+CFLAGS += -DCONFIG_PASN
 
 OBJS += ../src/common/ieee802_11_common.o
 OBJS += ../src/common/wpa_common.o