Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion HAL/keymaster/4.1/CborConverter.cpp
Original file line numberDiff line numberDiff line change
Expand Up@@ -245,7 +245,7 @@ bool CborConverter::getMultiBinaryArray(const std::unique_ptr<Item>& item, const
}

bool CborConverter::getBinaryArray(const std::unique_ptr<Item>& item, const uint32_t pos,
::android::hardware::hidl_vec<uint8_t>& value) {
::android::hardware::hidl_vec<uint8_t>& value) {
bool ret = false;
std::unique_ptr<Item> strItem(nullptr);
getItemAtPos(item, pos, strItem);
Expand All@@ -258,6 +258,19 @@ ::android::hardware::hidl_vec<uint8_t>& value) {
return ret;
}

bool CborConverter::getBinaryArray(const std::unique_ptr<Item>& item, const uint32_t pos,
::android::hardware::hidl_string& value) {
std::vector<uint8_t> vec;
std::string str;
if(!getBinaryArray(item, pos, vec)) {
return false;
}
for(auto ch : vec) {
str += ch;
}
value = str;
return true;
}

bool CborConverter::getBinaryArray(const std::unique_ptr<Item>& item, const uint32_t pos, std::vector<uint8_t>& value) {
bool ret = false;
Expand Down
Loading