summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-02-27 04:10:40 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-02-27 04:10:40 +0000
commit2901ff5e4e69a0581fa3c11adee192fce658b8f0 (patch)
tree0ed9c95dc73d9a2fda9c271daaec125819e8f896
parent0a1c98b7f47abdb861d7615d5103981d3735c450 (diff)
parentcfe00de661cedfad6295fc8713a5da3b48031cb2 (diff)
Snap for 5339334 from cfe00de661cedfad6295fc8713a5da3b48031cb2 to pi-qpr3-release
Change-Id: I9916a94201eafab7d209fa08c0343b550dff7830
-rw-r--r--keystore/Android.bp7
-rw-r--r--keystore/keystore_client_impl.cpp2
-rw-r--r--keystore/permissions.cpp7
3 files changed, 15 insertions, 1 deletions
diff --git a/keystore/Android.bp b/keystore/Android.bp
index 9ce00c2..8d095e1 100644
--- a/keystore/Android.bp
+++ b/keystore/Android.bp
@@ -76,6 +76,13 @@ cc_binary {
pdk: {
enabled: false,
},
+ debuggable: {
+ cflags: [
+ // Allow VTS tests running as root to have
+ // additional permissions.
+ "-DGRANT_ROOT_ALL_PERMISSIONS",
+ ],
+ },
},
required: ["keystore_cli_v2"],
diff --git a/keystore/keystore_client_impl.cpp b/keystore/keystore_client_impl.cpp
index 6d998ad..994e3f2 100644
--- a/keystore/keystore_client_impl.cpp
+++ b/keystore/keystore_client_impl.cpp
@@ -366,7 +366,7 @@ bool KeystoreClientImpl::doesKeyExist(const std::string& key_name) {
int32_t result;
auto binder_result = keystore_->exist(key_name16, kDefaultUID, &result);
if (!binder_result.isOk()) return false; // binder error
- return result;
+ return result == static_cast<int32_t>(ResponseCode::NO_ERROR);
}
bool KeystoreClientImpl::listKeys(const std::string& prefix,
diff --git a/keystore/permissions.cpp b/keystore/permissions.cpp
index 1ba91d9..b297c59 100644
--- a/keystore/permissions.cpp
+++ b/keystore/permissions.cpp
@@ -68,7 +68,14 @@ static user_perm user_perms[] = {
{AID_SYSTEM, static_cast<perm_t>((uint32_t)(~0))},
{AID_VPN, static_cast<perm_t>(P_GET | P_SIGN | P_VERIFY)},
{AID_WIFI, static_cast<perm_t>(P_GET | P_SIGN | P_VERIFY)},
+ {AID_BLUETOOTH, static_cast<perm_t>(P_GET | P_INSERT | P_DELETE | P_EXIST | P_SIGN | P_VERIFY)},
+
+#ifdef GRANT_ROOT_ALL_PERMISSIONS
+ // Allow VTS tests running as root to perform all operations
+ {AID_ROOT, static_cast<perm_t>((uint32_t)(~0))},
+#else
{AID_ROOT, static_cast<perm_t>(P_GET)},
+#endif
};
static const perm_t DEFAULT_PERMS = static_cast<perm_t>(