From 548fbb3ab502f51b68b328eb0b528df75108bcee Mon Sep 17 00:00:00 2001 From: Subhani Shaik Date: Mon, 7 Nov 2016 17:22:41 -0800 Subject: [PATCH] [AWARE]: Enable NAN Security 1) Include security params in Publish/Subscribe/Data Request/Response Structures. 2) Include security params in MatchIndication. Bug: 33552694 Test: builds Change-Id: I7a3af05b17f18040b311cf861c8dc0a0bba99d7d --- include/hardware_legacy/wifi_nan.h | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/include/hardware_legacy/wifi_nan.h b/include/hardware_legacy/wifi_nan.h index 70e1f6b..70c1cfa 100644 --- a/include/hardware_legacy/wifi_nan.h +++ b/include/hardware_legacy/wifi_nan.h @@ -58,6 +58,8 @@ typedef u32 NanDataPathId; #define NAN_MAX_FRAME_DATA_LEN 504 #define NAN_DP_MAX_APP_INFO_LEN 512 #define NAN_ERROR_STR_LEN 255 +#define NAN_PMK_INFO_LEN 32 +#define NAN_MAX_SCID_BUF_LEN 1024 /* Definition of various NanResponseType @@ -220,6 +222,10 @@ typedef enum { NAN_DP_FORCE_CHANNEL_SETUP } NanDataPathChannelCfg; +/* NAN Shared Key Security Cipher Suites Mask */ +#define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01 +#define NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02 + /* Nan/NDP Capabilites info */ typedef struct { u32 max_concurrent_nan_clusters; @@ -235,6 +241,7 @@ typedef struct { u32 max_ndp_sessions; u32 max_app_info_len; u32 max_queued_transmit_followup_msgs; + u32 cipher_suites_supported; } NanCapabilities; /* @@ -868,6 +875,30 @@ typedef struct { Nan accept policy for the specific service(publish) */ NanServiceAcceptPolicy service_responder_policy; + /* NAN Cipher Suite Type */ + u32 cipher_type; + /* pmk length */ + u8 pmk_len; + /* + PMK: Info is optional in Discovery phase. PMK info can be passed during + the NDP session. + */ + u8 pmk[NAN_PMK_INFO_LEN]; + + /* Security Context Identifiers length */ + u32 scid_len; + /* + Security Context Identifier attribute contains PMKID + shall be included in NDP setup and response messages. + Security Context Identifier, Identifies the Security + Context. For NAN Shared Key Cipher Suite, this field + contains the 16 octet PMKID identifying the PMK used + for setting up the Secure Data Path. + */ + u8 scid[NAN_MAX_SCID_BUF_LEN]; + + /* NAN secuirty required flag */ + NanDataPathSecurityCfgStatus security_cfg; } NanPublishRequest; /* @@ -988,6 +1019,31 @@ typedef struct { BIT2 - Disable followUp indication received (OTA). */ u8 recv_indication_cfg; + + /* NAN Cipher Suite Type */ + u32 cipher_type; + /* pmk length */ + u8 pmk_len; + /* + PMK: Info is optional in Discovery phase. PMK info can be passed during + the NDP session. + */ + u8 pmk[NAN_PMK_INFO_LEN]; + + /* Security Context Identifiers length */ + u32 scid_len; + /* + Security Context Identifier attribute contains PMKID + shall be included in NDP setup and response messages. + Security Context Identifier, Identifies the Security + Context. For NAN Shared Key Cipher Suite, this field + contains the 16 octet PMKID identifying the PMK used + for setting up the Secure Data Path. + */ + u8 scid[NAN_MAX_SCID_BUF_LEN]; + + /* NAN security required flag */ + NanDataPathSecurityCfgStatus security_cfg; } NanSubscribeRequest; /* @@ -1473,6 +1529,24 @@ typedef struct { /* NAN Cluster Attribute */ u8 cluster_attribute_len; u8 cluster_attribute[NAN_MAX_CLUSTER_ATTRIBUTE_LEN]; + + /* NAN Cipher Suite */ + u32 peer_cipher_type; + + /* Security Context Identifiers length */ + u32 scid_len; + /* + Security Context Identifier attribute contains PMKID + shall be included in NDP setup and response messages. + Security Context Identifier, Identifies the Security + Context. For NAN Shared Key Cipher Suite, this field + contains the 16 octet PMKID identifying the PMK used + for setting up the Secure Data Path. + */ + u8 scid[NAN_MAX_SCID_BUF_LEN]; + + /* NAN security required flag */ + NanDataPathSecurityCfgStatus security_cfg; } NanMatchInd; /* @@ -1707,6 +1781,13 @@ typedef struct { NanDataPathCfg ndp_cfg; /* App/Service information of the Initiator */ NanDataPathAppInfo app_info; + + /* NAN Cipher Suite Type */ + u32 cipher_type; + /* pmk length */ + u8 pmk_len; + /* PMK */ + u8 pmk[NAN_PMK_INFO_LEN]; } NanDataPathInitiatorRequest; /* @@ -1731,6 +1812,13 @@ typedef struct { NanDataPathAppInfo app_info; /* Response Code indicating ACCEPT/REJECT/DEFER */ NanDataPathResponseCode rsp_code; + + /* NAN Cipher Suite Type */ + u32 cipher_type; + /* pmk length */ + u8 pmk_len; + /* PMK */ + u8 pmk[NAN_PMK_INFO_LEN]; } NanDataPathIndicationResponse; /* NDP termination info */ -- 2.11.0