diff options
author | Etan Cohen <etancohen@google.com> | 2017-02-22 12:54:20 -0800 |
---|---|---|
committer | Etan Cohen <etancohen@google.com> | 2017-02-24 15:01:01 -0800 |
commit | d188984de3713fda118aeffd661f0f687d19c4b4 (patch) | |
tree | 52fb3000e128185e5c56e1fc6eb83b940021e5e2 /wifi/1.0/default/hidl_struct_util.cpp | |
parent | c4c2793b013646b54b65cbb6321915126765cd45 (diff) |
[AWARE] Data-path cipher API correction
Data-path security is configured using a specific cipher
type - corrected error which specified a set of cipher
types.
Bug: 33552694
Test: unit tests and integration (sl4a) tests
Change-Id: I2f2d21ebf68bd63906e60b5af76c8808864a1b46
Diffstat (limited to 'wifi/1.0/default/hidl_struct_util.cpp')
-rw-r--r-- | wifi/1.0/default/hidl_struct_util.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp index c7b8c41315..c498206ca5 100644 --- a/wifi/1.0/default/hidl_struct_util.cpp +++ b/wifi/1.0/default/hidl_struct_util.cpp @@ -950,7 +950,7 @@ bool convertHidlNanPublishRequestToLegacy( hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; legacy_request->recv_indication_cfg |= hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; - legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes; + legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType; legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size(); if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) { LOG(ERROR) << "convertHidlNanPublishRequestToLegacy: pmk_len too large"; @@ -1041,7 +1041,7 @@ bool convertHidlNanSubscribeRequestToLegacy( hidl_request.baseConfigs.disableMatchExpirationIndication ? 0x2 : 0x0; legacy_request->recv_indication_cfg |= hidl_request.baseConfigs.disableFollowupReceivedIndication ? 0x4 : 0x0; - legacy_request->cipher_type = hidl_request.baseConfigs.supportedCipherTypes; + legacy_request->cipher_type = (unsigned int) hidl_request.baseConfigs.cipherType; legacy_request->pmk_len = hidl_request.baseConfigs.pmk.size(); if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) { LOG(ERROR) << "convertHidlNanSubscribeRequestToLegacy: pmk_len too large"; @@ -1230,14 +1230,15 @@ bool convertHidlNanDataPathInitiatorRequestToLegacy( legacy_hal::NAN_DP_CONFIG_SECURITY : legacy_hal::NAN_DP_CONFIG_NO_SECURITY; legacy_request->app_info.ndp_app_info_len = hidl_request.appInfo.size(); if (legacy_request->app_info.ndp_app_info_len > NAN_DP_MAX_APP_INFO_LEN) { - LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len to large"; + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: ndp_app_info_len too large"; return false; } memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = hidl_request.supportedCipherTypes; + legacy_request->cipher_type = (unsigned int) hidl_request.cipherType; legacy_request->pmk_len = hidl_request.pmk.size(); if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) { + LOG(ERROR) << "convertHidlNanDataPathInitiatorRequestToLegacy: pmk_len too large"; return false; } memcpy(legacy_request->pmk, hidl_request.pmk.data(), legacy_request->pmk_len); @@ -1267,7 +1268,7 @@ bool convertHidlNanDataPathIndicationResponseToLegacy( } memcpy(legacy_request->app_info.ndp_app_info, hidl_request.appInfo.data(), legacy_request->app_info.ndp_app_info_len); - legacy_request->cipher_type = hidl_request.supportedCipherTypes; + legacy_request->cipher_type = (unsigned int) hidl_request.cipherType; legacy_request->pmk_len = hidl_request.pmk.size(); if (legacy_request->pmk_len > NAN_PMK_INFO_LEN) { LOG(ERROR) << "convertHidlNanDataPathIndicationResponseToLegacy: pmk_len too large"; @@ -1337,7 +1338,7 @@ bool convertLegacyNanMatchIndToHidl( hidl_ind->matchOccuredInBeaconFlag = legacy_ind.match_occured_flag == 1; hidl_ind->outOfResourceFlag = legacy_ind.out_of_resource_flag == 1; hidl_ind->rssiValue = legacy_ind.rssi_value; - hidl_ind->peerSupportedCipherTypes = legacy_ind.peer_cipher_type; + hidl_ind->peerCipherType = (NanCipherSuiteType) legacy_ind.peer_cipher_type; hidl_ind->peerRequiresSecurityEnabledInNdp = legacy_ind.peer_sdea_params.security_cfg == legacy_hal::NAN_DP_CONFIG_SECURITY; hidl_ind->peerRequiresRanging = |