summaryrefslogtreecommitdiff
path: root/keystore
diff options
context:
space:
mode:
authorJanis Danisevskis <jdanis@google.com>2021-05-17 13:25:07 -0700
committerJanis Danisevskis <jdanis@google.com>2021-05-17 13:41:32 -0700
commit2cb4f090ae08e0dc4e4ee13df10418c7466c9246 (patch)
tree3e205467cd4b61a11f1c5c89d024e5ac51b786af /keystore
parent8176ec07ce217bd5aaca53c6dceb2d27b4253b1a (diff)
downloadsecurity-2cb4f090ae08e0dc4e4ee13df10418c7466c9246.tar.gz
Keystore 2.0: CLI fixes.
* Fix keystore_cli_v2 and have it installed on the device by default again. * Fix confirmationui invocation test by statically linking dependencies. Bug: 188450250 Test: atest confirmationui_invocation_test run any keystore_cli_v2 command Merged-In: I7097646b6714214782cf15c51dffb7368d62761b Change-Id: I7097646b6714214782cf15c51dffb7368d62761b
Diffstat (limited to 'keystore')
-rw-r--r--keystore/keystore_cli_v2.cpp4
-rw-r--r--keystore/tests/Android.bp2
2 files changed, 3 insertions, 3 deletions
diff --git a/keystore/keystore_cli_v2.cpp b/keystore/keystore_cli_v2.cpp
index 6e45ee27..43f72a99 100644
--- a/keystore/keystore_cli_v2.cpp
+++ b/keystore/keystore_cli_v2.cpp
@@ -56,7 +56,7 @@ struct TestCase {
keymint::AuthorizationSet parameters;
};
-constexpr const char keystore2_service_name[] = "android.system.keystore2";
+constexpr const char keystore2_service_name[] = "android.system.keystore2.IKeystoreService/default";
int unwrapError(const ndk::ScopedAStatus& status) {
if (status.isOk()) return 0;
@@ -769,7 +769,7 @@ int GenerateKey(const std::string& name, keymint::SecurityLevel securityLevel, b
sec_level->generateKey(keyDescriptor(name), {} /* attestationKey */, params.vector_data(),
0 /* flags */, {} /* entropy */, &keyMetadata);
- if (rc.isOk()) {
+ if (!rc.isOk()) {
std::cerr << "GenerateKey failed: " << rc.getDescription() << std::endl;
return unwrapError(rc);
}
diff --git a/keystore/tests/Android.bp b/keystore/tests/Android.bp
index 249cb77a..39601ebb 100644
--- a/keystore/tests/Android.bp
+++ b/keystore/tests/Android.bp
@@ -62,9 +62,9 @@ cc_test {
"libgtest_main",
"libutils",
"liblog",
+ "android.security.apc-ndk_platform",
],
shared_libs: [
- "android.security.apc-ndk_platform",
"libbinder_ndk",
],
sanitize: {