aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm/mgmt-keystore.c
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hsm/mgmt-keystore.c')
-rw-r--r--projects/hsm/mgmt-keystore.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/projects/hsm/mgmt-keystore.c b/projects/hsm/mgmt-keystore.c
index 0104265..b79a5fe 100644
--- a/projects/hsm/mgmt-keystore.c
+++ b/projects/hsm/mgmt-keystore.c
@@ -59,6 +59,8 @@ static int cmd_keystore_set_pin(struct cli_def *cli, const char *command, char *
hal_error_t status;
hal_client_handle_t client = { -1 };
+ command = command;
+
if (argc != 2) {
cli_print(cli, "Wrong number of arguments (%i).", argc);
cli_print(cli, "Syntax: keystore set pin <user|so|wheel> <pin>");
@@ -91,6 +93,8 @@ static int cmd_keystore_clear_pin(struct cli_def *cli, const char *command, char
hal_error_t status;
hal_client_handle_t client = { -1 };
+ command = command;
+
if (argc != 1) {
cli_print(cli, "Wrong number of arguments (%i).", argc);
cli_print(cli, "Syntax: keystore clear pin <user|so|wheel>");
@@ -122,6 +126,8 @@ static int cmd_keystore_set_pin_iterations(struct cli_def *cli, const char *comm
hal_error_t status;
hal_client_handle_t client = { -1 };
+ command = command;
+
if (argc != 1) {
cli_print(cli, "Wrong number of arguments (%i).", argc);
cli_print(cli, "Syntax: keystore set pin iterations <number>");
@@ -145,6 +151,8 @@ static int cmd_keystore_delete_key(struct cli_def *cli, const char *command, cha
hal_error_t status;
hal_uuid_t name;
+ command = command;
+
if (argc != 1) {
cli_print(cli, "Wrong number of arguments (%i).", argc);
cli_print(cli, "Syntax: keystore delete key <name>");
@@ -205,7 +213,7 @@ static int show_keys(struct cli_def *cli, const char *title)
if (!done)
previous_uuid = uuids[sizeof(uuids)/sizeof(*uuids) - 1];
- for (int i = 0; i < n; i++) {
+ for (unsigned i = 0; i < n; i++) {
if ((status = hal_uuid_format(&uuids[i], key_name, sizeof(key_name))) != LIBHAL_OK) {
cli_print(cli, "Could not convert key name, skipping: %s",
@@ -276,6 +284,10 @@ static int show_pin(struct cli_def *cli, char *label, hal_user_t user)
static int cmd_keystore_show_keys(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
int err = 0;
err |= show_keys(cli, "Keystore:");
@@ -291,7 +303,9 @@ static int cmd_keystore_show_keys(struct cli_def *cli, const char *command, char
static int cmd_keystore_erase(struct cli_def *cli, const char *command, char *argv[], int argc)
{
hal_error_t err;
- int status;
+ HAL_StatusTypeDef status;
+
+ command = command;
if (argc != 1 || strcmp(argv[0], "YesIAmSure") != 0) {
cli_print(cli, "Syntax: keystore erase YesIAmSure");
@@ -299,7 +313,7 @@ static int cmd_keystore_erase(struct cli_def *cli, const char *command, char *ar
}
cli_print(cli, "OK, erasing keystore, this will take about 45 seconds...");
- if ((status = keystore_erase_bulk()) != 1) {
+ if ((status = keystore_erase_bulk()) != CMSIS_HAL_OK) {
cli_print(cli, "Failed erasing token keystore: %i", status);
return CLI_ERROR;
}