Merge changes from topics "niap-asym-write-pi-dev", "niap-asym-write-api-pi-dev" into pi-dev
* changes:
Restore "Add "Unlocked device required" parameter to keys"
Add "unlocked device required" keystore API
diff --git a/keystore/key_store_service.cpp b/keystore/key_store_service.cpp
index a716498..9bd76fd 100644
--- a/keystore/key_store_service.cpp
+++ b/keystore/key_store_service.cpp
@@ -552,8 +552,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"),