diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2016-07-09 22:14:40 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2016-07-09 22:14:40 +0200 |
commit | b4dfbfa104b142b4e5585f33d03b22755704b1ff (patch) | |
tree | a24f29bc85fd885a90d114cfdb914f9685496235 /projects/hsm/mgmt-masterkey.c | |
parent | 055ba65f4a5b7435f22a52312d44b4dfe5433b0c (diff) |
Clean up the CLI.
A lot of the commands were just useful when testing/implementing
features for the Alpha. Remove them now that they have been merged to
projects/cli-test.
Diffstat (limited to 'projects/hsm/mgmt-masterkey.c')
-rw-r--r-- | projects/hsm/mgmt-masterkey.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/projects/hsm/mgmt-masterkey.c b/projects/hsm/mgmt-masterkey.c index 7938e33..3a48057 100644 --- a/projects/hsm/mgmt-masterkey.c +++ b/projects/hsm/mgmt-masterkey.c @@ -84,7 +84,6 @@ static int _parse_hex_groups(uint8_t *buf, size_t len, char *argv[], int argc) static int cmd_masterkey_status(struct cli_def *cli, const char *command, char *argv[], int argc) { hal_error_t status; - uint8_t buf[KEK_LENGTH] = {0}; cli_print(cli, "Status of master key:\n"); @@ -94,28 +93,6 @@ static int cmd_masterkey_status(struct cli_def *cli, const char *command, char * status = masterkey_flash_read(NULL, 0); cli_print(cli, " flash: %s / %s", _status2str(status), hal_error_string(status)); - /* XXX Temporary gaping security hole while developing the master key functionality. - * REMOVE READ-OUT OF MASTER KEY. - */ - - status = masterkey_volatile_read(&buf[0], sizeof(buf)); - if (status == LIBHAL_OK || status == HAL_ERROR_MASTERKEY_NOT_SET) { - cli_print(cli, "\nVolatile read-out:\n"); - uart_send_hexdump(STM_UART_MGMT, buf, 0, sizeof(buf) - 1); - cli_print(cli, "\n"); - } else { - cli_print(cli, "Failed reading from volatile memory: %s", hal_error_string(status)); - } - - status = masterkey_flash_read(&buf[0], sizeof(buf)); - if (status == LIBHAL_OK || status == HAL_ERROR_MASTERKEY_NOT_SET) { - cli_print(cli, "\nFlash read-out:\n"); - uart_send_hexdump(STM_UART_MGMT, buf, 0, sizeof(buf) - 1); - cli_print(cli, "\n"); - } else { - cli_print(cli, "Failed reading from flash: %s", hal_error_string(status)); - } - return CLI_OK; } @@ -126,7 +103,7 @@ static int cmd_masterkey_set(struct cli_def *cli, const char *command, char *arg int i; if ((i = _parse_hex_groups(&buf[0], sizeof(buf), argv, argc)) != 1) { - cli_print(cli, "Failed parsing master key (%i)", i); + cli_print(cli, "Failed parsing master key, expected up to 8 groups of 32-bit hex chars (%i)", i); return CLI_OK; } @@ -161,7 +138,7 @@ static int cmd_masterkey_unsecure_set(struct cli_def *cli, const char *command, int i; if ((i = _parse_hex_groups(&buf[0], sizeof(buf), argv, argc)) != 1) { - cli_print(cli, "Failed parsing master key (%i)", i); + cli_print(cli, "Failed parsing master key, expected up to 8 groups of 32-bit hex chars (%i)", i); return CLI_OK; } |