aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm/mgmt-masterkey.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2016-07-21 16:32:43 -0400
committerPaul Selkirk <paul@psgd.org>2016-07-21 16:32:43 -0400
commite3fe7d89b6094bfef42f42329e15631f684f0748 (patch)
treedbaca9b4ce50dca6950a658cef99d20d5d7922ae /projects/hsm/mgmt-masterkey.c
parent91cc61352451093e26605f4a9bbe83798da02fd0 (diff)
Use a fresh port of libcli, which retains more of the original API.
Diffstat (limited to 'projects/hsm/mgmt-masterkey.c')
-rw-r--r--projects/hsm/mgmt-masterkey.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/projects/hsm/mgmt-masterkey.c b/projects/hsm/mgmt-masterkey.c
index 6aa7338..33ce395 100644
--- a/projects/hsm/mgmt-masterkey.c
+++ b/projects/hsm/mgmt-masterkey.c
@@ -168,19 +168,22 @@ static int cmd_masterkey_unsecure_erase(struct cli_def *cli, const char *command
void configure_cli_masterkey(struct cli_def *cli)
{
- /* masterkey */
- cli_command_root(masterkey);
+ struct cli_command *c = cli_register_command(cli, NULL, "masterkey", NULL, 0, 0, NULL);
+
/* masterkey status */
- cli_command_node(masterkey, status, "Show status of master key in RAM/flash");
+ cli_register_command(cli, c, "status", cmd_masterkey_status, 0, 0, "Show status of master key in RAM/flash");
/* masterkey set */
- cli_command_node(masterkey, set, "Set the master key in the volatile Master Key Memory");
+ cli_register_command(cli, c, "set", cmd_masterkey_set, 0, 0, "Set the master key in the volatile Master Key Memory");
+
/* masterkey erase */
- cli_command_node(masterkey, erase, "Erase the master key from the volatile Master Key Memory");
+ cli_register_command(cli, c, "erase", cmd_masterkey_erase, 0, 0, "Erase the master key from the volatile Master Key Memory");
+
+ struct cli_command *c_unsecure = cli_register_command(cli, c, "unsecure", NULL, 0, 0, NULL);
- cli_command_branch(masterkey, unsecure);
/* masterkey unsecure set */
- cli_command_node(masterkey_unsecure, set, "Set master key in unprotected flash memory (if unsure, DON'T)");
+ cli_register_command(cli, c_unsecure, "set", cmd_masterkey_unsecure_set, 0, 0, "Set master key in unprotected flash memory (if unsure, DON'T)");
+
/* masterkey unsecure erase */
- cli_command_node(masterkey_unsecure, erase, "Erase master key from unprotected flash memory");
+ cli_register_command(cli, c_unsecure, "erase", cmd_masterkey_unsecure_erase, 0, 0, "Erase master key from unprotected flash memory");
}