diff options
author | Etan Cohen <etancohen@google.com> | 2017-07-11 13:53:11 -0700 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2017-07-11 13:55:39 -0700 |
commit | d89cc8dced4dda3da4d7123233d6196f473b8e59 (patch) | |
tree | 616accb18630f0e2cd3939e95d603dcbc5dd7264 /service | |
parent | f695dc1941b90bbfa555f311b05f3eeab9d7ecc1 (diff) |
[AWARE] Configure a Service Name for OOB NDP with PMK
Configure a Service Name (dummy) when creating an out-of-band
NAN data-path (NDP) using a PMK. This was already done for Passphrase,
same code and (dummy) Service Name used for PMK as well.
Rationale: the key generation (from the PMK) requires a hash of
the service name.
Bug: 63581297
Test: DataPathTest:test_oob_pmk_specific passes (and other PMK tests)
Change-Id: If8e3b8263ccd98c86f2c218324ea4ab0159f4217
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java b/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java index b9f3b4f88..a6e724f7d 100644 --- a/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java +++ b/service/java/com/android/server/wifi/aware/WifiAwareNativeApi.java @@ -758,12 +758,12 @@ public class WifiAwareNativeApi implements WifiAwareShellCommand.DelegatedShellC capabilities.supportedCipherSuites); req.securityConfig.securityType = NanDataPathSecurityType.PASSPHRASE; convertNativeByteArrayToArrayList(passphrase.getBytes(), req.securityConfig.passphrase); + } - if (isOutOfBand) { // only relevant when using passphrase - convertNativeByteArrayToArrayList( - SERVICE_NAME_FOR_OOB_DATA_PATH.getBytes(StandardCharsets.UTF_8), - req.serviceNameOutOfBand); - } + if (req.securityConfig.securityType != NanDataPathSecurityType.OPEN && isOutOfBand) { + convertNativeByteArrayToArrayList( + SERVICE_NAME_FOR_OOB_DATA_PATH.getBytes(StandardCharsets.UTF_8), + req.serviceNameOutOfBand); } try { @@ -831,12 +831,12 @@ public class WifiAwareNativeApi implements WifiAwareShellCommand.DelegatedShellC capabilities.supportedCipherSuites); req.securityConfig.securityType = NanDataPathSecurityType.PASSPHRASE; convertNativeByteArrayToArrayList(passphrase.getBytes(), req.securityConfig.passphrase); + } - if (isOutOfBand) { // only relevant when using passphrase - convertNativeByteArrayToArrayList( - SERVICE_NAME_FOR_OOB_DATA_PATH.getBytes(StandardCharsets.UTF_8), - req.serviceNameOutOfBand); - } + if (req.securityConfig.securityType != NanDataPathSecurityType.OPEN && isOutOfBand) { + convertNativeByteArrayToArrayList( + SERVICE_NAME_FOR_OOB_DATA_PATH.getBytes(StandardCharsets.UTF_8), + req.serviceNameOutOfBand); } try { |