diff options
author | Jooyung Han <jooyung@google.com> | 2020-02-21 21:17:06 +0900 |
---|---|---|
committer | Jooyung Han <jooyung@google.com> | 2020-03-24 06:37:11 +0000 |
commit | 17be89b21bfc46b8c0932cb14ce428ebc2986de5 (patch) | |
tree | c8b9bb1f014c8e987d5ddf946b74fd4c92274609 /identity/aidl/default/Util.cpp | |
parent | 3e3e78bf208475c5854c60905628f7c8b6dc110f (diff) |
use vector<uint8_t> for byte[] in AIDL
In native world, byte stream is typically represented in uint8_t[]
or vector<uint8_t>. C++ backend already generates that way. This
change involves NDK backend.
Now NDK backend also uses vector<uint8_t> just like C++ backend.
Bug: 144957764
Test: atest CtsNdkBinderTestCases
Merged-In: I8de348b57cf92dd99b3ee16252f56300ce5f4683
Change-Id: I8de348b57cf92dd99b3ee16252f56300ce5f4683
(cherry picked from commit 9070318462e5e73acf1509cf7e75ac260e51e43a)
Exempt-From-Owner-Approval: cp from internal
Diffstat (limited to 'identity/aidl/default/Util.cpp')
-rw-r--r-- | identity/aidl/default/Util.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/identity/aidl/default/Util.cpp b/identity/aidl/default/Util.cpp index a0f86bedcd..66b9f13d89 100644 --- a/identity/aidl/default/Util.cpp +++ b/identity/aidl/default/Util.cpp @@ -39,21 +39,12 @@ const vector<uint8_t>& getHardwareBoundKey() { return hardwareBoundKey; } -vector<uint8_t> byteStringToUnsigned(const vector<int8_t>& value) { - return vector<uint8_t>(value.begin(), value.end()); -} - -vector<int8_t> byteStringToSigned(const vector<uint8_t>& value) { - return vector<int8_t>(value.begin(), value.end()); -} - vector<uint8_t> secureAccessControlProfileEncodeCbor(const SecureAccessControlProfile& profile) { cppbor::Map map; map.add("id", profile.id); if (profile.readerCertificate.encodedCertificate.size() > 0) { - map.add("readerCertificate", - cppbor::Bstr(byteStringToUnsigned(profile.readerCertificate.encodedCertificate))); + map.add("readerCertificate", cppbor::Bstr(profile.readerCertificate.encodedCertificate)); } if (profile.userAuthenticationRequired) { @@ -94,7 +85,7 @@ bool secureAccessControlProfileCheckMac(const SecureAccessControlProfile& profil if (!mac) { return false; } - if (mac.value() != byteStringToUnsigned(profile.mac)) { + if (mac.value() != profile.mac) { return false; } return true; |