summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2017-03-23 00:31:07 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-23 00:31:07 +0000
commite0429223dc17791a64509ea98343dc7e1155d820 (patch)
treeabbf7d278eb7ff44f9646367b8ca5f550bd5a9a4
parente58fbf0cdd7d3e890bac0cdbbb07b0a4680f65f7 (diff)
parent9a46e190521f3887fea6c1e03c220187e160298f (diff)
downloadlibhardware_legacy-e0429223dc17791a64509ea98343dc7e1155d820.tar.gz
Merge "[AWARE]: Add support to accept either passphrase or pmk" am: ad6f1d5512 am: adedd72dd1
am: 9a46e19052 Change-Id: I136dd9be16b2c187d86ab4a6b16db486f7084123
-rw-r--r--include/hardware_legacy/wifi_nan.h93
1 files changed, 74 insertions, 19 deletions
diff --git a/include/hardware_legacy/wifi_nan.h b/include/hardware_legacy/wifi_nan.h
index d3875d6..3618351 100644
--- a/include/hardware_legacy/wifi_nan.h
+++ b/include/hardware_legacy/wifi_nan.h
@@ -61,6 +61,9 @@ typedef u32 NanDataPathId;
#define NAN_PMK_INFO_LEN 32
#define NAN_MAX_SCID_BUF_LEN 1024
#define NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN 1024
+#define NAN_SECURITY_MIN_PASSPHRASE_LEN 8
+#define NAN_SECURITY_MAX_PASSPHRASE_LEN 63
+
/*
Definition of various NanResponseType
@@ -252,6 +255,42 @@ typedef enum {
NAN_RANGE_REQUEST_CANCEL
} NanRangeResponse;
+/* NAN Security Key Input Type*/
+typedef enum {
+ NAN_SECURITY_KEY_INPUT_PMK = 1,
+ NAN_SECURITY_KEY_INPUT_PASSPHRASE
+} NanSecurityKeyInputType;
+
+typedef struct {
+ /* pmk length */
+ u32 pmk_len;
+ /*
+ PMK: Info is optional in Discovery phase.
+ PMK info can be passed during
+ the NDP session.
+ */
+ u8 pmk[NAN_PMK_INFO_LEN];
+} NanSecurityPmk;
+
+typedef struct {
+ /* passphrase length */
+ u32 passphrase_len;
+ /*
+ passphrase info is optional in Discovery phase.
+ passphrase info can be passed during
+ the NDP session.
+ */
+ u8 passphrase[NAN_SECURITY_MAX_PASSPHRASE_LEN];
+} NanSecurityPassPhrase;
+
+typedef struct {
+ NanSecurityKeyInputType key_type;
+ union {
+ NanSecurityPmk pmk_info;
+ NanSecurityPassPhrase passphrase_info;
+ } body;
+} NanSecurityKeyInfo;
+
/* NAN Shared Key Security Cipher Suites Mask */
#define NAN_CIPHER_SUITE_SHARED_KEY_NONE 0x00
#define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01
@@ -1015,13 +1054,12 @@ typedef struct {
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
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
the NDP session.
- */
- u8 pmk[NAN_PMK_INFO_LEN];
+ */
+ NanSecurityKeyInfo key_info;
/* Security Context Identifiers length */
u32 scid_len;
@@ -1179,13 +1217,12 @@ typedef struct {
/* 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
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
the NDP session.
*/
- u8 pmk[NAN_PMK_INFO_LEN];
+ NanSecurityKeyInfo key_info;
/* Security Context Identifiers length */
u32 scid_len;
@@ -2013,13 +2050,22 @@ 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];
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+ /* length of service name */
+ u32 service_name_len;
+ /*
+ UTF-8 encoded string identifying the service name.
+ The service name field is only used if a Nan discovery
+ is not associated with the NDP (out-of-band discovery).
+ */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];
} NanDataPathInitiatorRequest;
/*
@@ -2044,13 +2090,22 @@ 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];
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+ /* length of service name */
+ u32 service_name_len;
+ /*
+ UTF-8 encoded string identifying the service name.
+ The service name field is only used if a Nan discovery
+ is not associated with the NDP (out-of-band discovery).
+ */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];
} NanDataPathIndicationResponse;
/* NDP termination info */