blob: 42a5616949e7dd105ec923b52c0d4930620919ad [file] [log] [blame]
Gabriel Biren910d5df2022-04-08 18:21:22 +00001/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.wifi;
18
19import android.hardware.wifi.NanCipherSuiteType;
20import android.hardware.wifi.NanDataPathSecurityType;
21
22/**
23 * Configuration of NAN data-path security.
24 */
25@VintfStability
26parcelable NanDataPathSecurityConfig {
27 /**
28 * Security configuration of the data-path (NDP). Security is enabled if not equal to
29 * |NanDataPathSecurityType.OPEN|.
30 * NAN Spec: Service Discovery Extension Attribute (SDEA) / Control / Security Required
31 */
32 NanDataPathSecurityType securityType;
33 /**
34 * Cipher type for data-paths. If |securityType| is |NanDataPathSecurityType.OPEN| then must
35 * be set to |NanCipherSuiteType.NONE|. Otherwise a non-|NanCipherSuiteType.NONE| cipher suite
36 * must be specified.
37 */
38 NanCipherSuiteType cipherType;
39 /**
40 * Optional Pairwise Master Key (PMK). Must be specified (and is only used) if |securityType| is
41 * set to |NanDataPathSecurityType.PMK|.
42 * Ref: IEEE 802.11i
43 */
44 byte[32] pmk;
45 /**
46 * Optional Passphrase. Must be specified (and is only used) if |securityType| is set to
47 * |NanDataPathSecurityType.PASSPHRASE|.
48 * Min length: |IWifiNanIface.MIN_DATA_PATH_CONFIG_PASSPHRASE_LENGTH|
49 * Max length: |IWifiNanIface.MAX_DATA_PATH_CONFIG_PASSPHRASE_LENGTH|
50 * NAN Spec: Appendix: Mapping passphrase to PMK for NCS-SK Cipher Suites
51 */
52 byte[] passphrase;
53 /**
54 * Security Context Identifier attribute contains PMKID. Shall be included in NDP setup and
55 * response messages. Security Context Identifier identifies the Security Context. When
56 * security is enabled this field contains the 16 octet PMKID identifying the PMK used for
57 * setting up the Secure Data Path.
58 */
59 byte[16] scid;
60}