Add "unlocked device required" keystore API
am: 9371e95bb0
Change-Id: If9dd8570d0b7f6ba1594391be9e5283be9a930db
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index 8be07f8..13b3df1 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -550,8 +550,11 @@
hidl_vec<uint8_t> legacy_out;
KeyStoreServiceReturnCode res =
doLegacySignVerify(name, data, &legacy_out, hidl_vec<uint8_t>(), KeyPurpose::SIGN);
+ if (!res.isOk()) {
+ return Status::fromServiceSpecificError((res));
+ }
*out = legacy_out;
- return Status::fromServiceSpecificError((res));
+ return Status::ok();
}
Status KeyStoreService::verify(const String16& name, const ::std::vector<uint8_t>& data,
diff --git a/keystore/keystore_cli_v2.cpp b/keystore/keystore_cli_v2.cpp
index 870a548..6377ec1 100644
--- a/keystore/keystore_cli_v2.cpp
+++ b/keystore/keystore_cli_v2.cpp
@@ -502,7 +502,7 @@
}
if (promptText.size() == 0) {
- printf("The --promptText parameter cannot be empty.\n");
+ printf("The --prompt_text parameter cannot be empty.\n");
return 1;
}
@@ -615,7 +615,7 @@
command_line->GetSwitchValueASCII("in"),
command_line->GetSwitchValueASCII("out"));
} else if (args[0] == "confirmation") {
- return Confirmation(command_line->GetSwitchValueASCII("prompt_text"),
+ return Confirmation(command_line->GetSwitchValueNative("prompt_text"),
command_line->GetSwitchValueASCII("extra_data"),
command_line->GetSwitchValueASCII("locale"),
command_line->GetSwitchValueASCII("ui_options"),