diff options
author | Etan Cohen <etancohen@google.com> | 2017-03-23 00:10:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-23 00:10:34 +0000 |
commit | ad6f1d5512e7b7693253678548086bb09bb518a2 (patch) | |
tree | eec48bf083e01672085f837fd996124b52b2a8ea | |
parent | 980baf1bd79ff3ff8cdac3dd929f1b31bb174917 (diff) | |
parent | 3686f0e8838b79080216dc0360276e8a7fc32251 (diff) | |
download | libhardware_legacy-ad6f1d5512e7b7693253678548086bb09bb518a2.tar.gz |
Merge "[AWARE]: Add support to accept either passphrase or pmk"
-rw-r--r-- | include/hardware_legacy/wifi_nan.h | 93 |
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 */ |