summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Mok <keithmok@google.com>2022-08-29 23:26:23 +0000
committerHasini Gunasinghe <hasinitg@google.com>2022-08-30 22:54:38 +0000
commitd78ef2348cadeb9a707a1b87f98ef4d0b0aac7ab (patch)
tree1bbc2a3964e8e8350f97b9fdfaaba1220529ed20
parent3fc6c4ba987c442afd7bafe63b1736ed55f748e1 (diff)
downloadkeymaster-d78ef2348cadeb9a707a1b87f98ef4d0b0aac7ab.tar.gz
The boundary check is wrong Bug: 242702451 Test: manual Ignore-AOSP-First: security Change-Id: I2b312916604e051fa4d8cb6e3e461a1f874bfa6d (cherry picked from commit 03bd6c29cd9b5cfb9c6bb83d165defc700e0ba7c)
-rw-r--r--ng/KeyMintUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ng/KeyMintUtils.cpp b/ng/KeyMintUtils.cpp
index 45967fd..0d9c324 100644
--- a/ng/KeyMintUtils.cpp
+++ b/ng/KeyMintUtils.cpp
@@ -108,7 +108,7 @@ vector<uint8_t> authToken2AidlVec(const std::optional<HardwareAuthToken>& token)
vector<uint8_t> result;
if (!token.has_value()) return result;
- if (token->mac.size() < 32) return result;
+ if (token->mac.size() != 32) return result;
result.resize(sizeof(hw_auth_token_t));
auto pos = result.begin();