commit | 0fa5c95909e5394c81122d8d5d28c80e90873a8e | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Thu Sep 16 02:24:33 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Sep 16 02:24:33 2021 +0000 |
tree | 614f2e0ef751941705d328a3429572429f1e0bb1 | |
parent | 140ebbc73542ab3f998eeedd5798c20fe9c6de73 [diff] | |
parent | 1efb6663520ad3d5e38cbaf3f17d2192646e570c [diff] |
Merge "Keystore 2.0: Small performance gain" am: 1efb666352 Original change: https://android-review.googlesource.com/c/platform/system/security/+/1607519 Change-Id: I563e754735f030186e7c52bced521f0454c423be
diff --git a/keystore-engine/keystore2_engine.cpp b/keystore-engine/keystore2_engine.cpp index 69d2ca6..ee550ca 100644 --- a/keystore-engine/keystore2_engine.cpp +++ b/keystore-engine/keystore2_engine.cpp
@@ -357,7 +357,7 @@ // If the key_id starts with the grant id prefix, we parse the following string as numeric // grant id. We can then use the grant domain without alias to load the designated key. - if (alias.find(keystore2_grant_id_prefix) == 0) { + if (android::base::StartsWith(alias, keystore2_grant_id_prefix)) { std::stringstream s(alias.substr(keystore2_grant_id_prefix.size())); s >> std::hex >> reinterpret_cast<uint64_t&>(descriptor.nspace); descriptor.domain = ks2::Domain::GRANT;