aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hsm')
-rw-r--r--projects/hsm/mgmt-bootloader.c4
-rw-r--r--projects/hsm/mgmt-cli.c2
-rw-r--r--projects/hsm/mgmt-firmware.c4
-rw-r--r--projects/hsm/mgmt-fpga.c20
-rw-r--r--projects/hsm/mgmt-keystore.c14
-rw-r--r--projects/hsm/mgmt-masterkey.c16
-rw-r--r--projects/hsm/mgmt-misc.c4
-rw-r--r--projects/hsm/mgmt-task.c4
8 files changed, 66 insertions, 2 deletions
diff --git a/projects/hsm/mgmt-bootloader.c b/projects/hsm/mgmt-bootloader.c
index 738686e..ce24560 100644
--- a/projects/hsm/mgmt-bootloader.c
+++ b/projects/hsm/mgmt-bootloader.c
@@ -60,6 +60,10 @@ static int _flash_write_callback(uint8_t *buf, size_t len)
static int cmd_bootloader_upload(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
if (user < HAL_USER_SO) {
cli_print(cli, "Permission denied.");
return CLI_ERROR;
diff --git a/projects/hsm/mgmt-cli.c b/projects/hsm/mgmt-cli.c
index ab9cf44..23a0a40 100644
--- a/projects/hsm/mgmt-cli.c
+++ b/projects/hsm/mgmt-cli.c
@@ -103,6 +103,8 @@ static uint8_t uart_rx;
*/
void HAL_UART1_RxCpltCallback(UART_HandleTypeDef *huart)
{
+ huart = huart;
+
ringbuf_write_char(&uart_ringbuf, uart_rx);
task_wake(cli_task);
}
diff --git a/projects/hsm/mgmt-firmware.c b/projects/hsm/mgmt-firmware.c
index ec8a69d..85eb78b 100644
--- a/projects/hsm/mgmt-firmware.c
+++ b/projects/hsm/mgmt-firmware.c
@@ -49,6 +49,10 @@ extern hal_user_t user;
static int cmd_firmware_upload(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
if (user < HAL_USER_SO) {
cli_print(cli, "Permission denied.");
return CLI_ERROR;
diff --git a/projects/hsm/mgmt-fpga.c b/projects/hsm/mgmt-fpga.c
index 06f2a26..f6c6f20 100644
--- a/projects/hsm/mgmt-fpga.c
+++ b/projects/hsm/mgmt-fpga.c
@@ -62,13 +62,17 @@ static int _flash_write_callback(uint8_t *buf, size_t len)
if (fpgacfg_erase_sector(dfu_offset / FPGACFG_SECTOR_SIZE) != 1)
return CLI_ERROR;
- int res = fpgacfg_write_data(dfu_offset, buf, BITSTREAM_UPLOAD_CHUNK_SIZE) == 1;
- dfu_offset += BITSTREAM_UPLOAD_CHUNK_SIZE;
+ int res = fpgacfg_write_data(dfu_offset, buf, len) == 1;
+ dfu_offset += len;
return res;
}
static int cmd_fpga_bitstream_upload(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
if (user < HAL_USER_SO) {
cli_print(cli, "Permission denied.");
return CLI_ERROR;
@@ -96,6 +100,10 @@ static int cmd_fpga_bitstream_upload(struct cli_def *cli, const char *command, c
static int cmd_fpga_bitstream_erase(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
fpgacfg_access_control(ALLOW_ARM);
cli_print(cli, "Checking if FPGA config memory is accessible");
@@ -123,6 +131,10 @@ static int cmd_fpga_bitstream_erase(struct cli_def *cli, const char *command, ch
static int cmd_fpga_reset(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
fpgacfg_access_control(ALLOW_FPGA);
fpgacfg_reset_fpga(RESET_FULL);
hal_core_reset_table();
@@ -136,6 +148,10 @@ static int cmd_fpga_show_cores(struct cli_def *cli, const char *command, char *a
hal_core_t *core;
const hal_core_info_t *info;
+ command = command;
+ argv = argv;
+ argc = argc;
+
if (! fpgacfg_check_done()) {
cli_print(cli, "FPGA has not loaded a bitstream");
return CLI_OK;
diff --git a/projects/hsm/mgmt-keystore.c b/projects/hsm/mgmt-keystore.c
index 9bd9dbf..100c428 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>");
@@ -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:");
@@ -293,6 +305,8 @@ static int cmd_keystore_erase(struct cli_def *cli, const char *command, char *ar
hal_error_t err;
int status;
+ command = command;
+
if (argc != 1 || strcmp(argv[0], "YesIAmSure") != 0) {
cli_print(cli, "Syntax: keystore erase YesIAmSure");
return CLI_ERROR;
diff --git a/projects/hsm/mgmt-masterkey.c b/projects/hsm/mgmt-masterkey.c
index 9f5e4d0..8675637 100644
--- a/projects/hsm/mgmt-masterkey.c
+++ b/projects/hsm/mgmt-masterkey.c
@@ -82,6 +82,10 @@ static int cmd_masterkey_status(struct cli_def *cli, const char *command, char *
{
hal_error_t status;
+ command = command;
+ argv = argv;
+ argc = argc;
+
cli_print(cli, "Status of master key:\n");
status = hal_mkm_volatile_read(NULL, 0);
@@ -132,6 +136,8 @@ static int _masterkey_set(struct cli_def *cli, char *argv[], int argc,
static int cmd_masterkey_set(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+
return _masterkey_set(cli, argv, argc, "volatile", hal_mkm_volatile_write);
}
@@ -139,6 +145,10 @@ static int cmd_masterkey_erase(struct cli_def *cli, const char *command, char *a
{
hal_error_t err;
+ command = command;
+ argv = argv;
+ argc = argc;
+
if ((err = hal_mkm_volatile_erase(KEK_LENGTH)) == LIBHAL_OK) {
cli_print(cli, "Erased master key from volatile memory");
} else {
@@ -149,6 +159,8 @@ static int cmd_masterkey_erase(struct cli_def *cli, const char *command, char *a
static int cmd_masterkey_unsecure_set(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+
return _masterkey_set(cli, argv, argc, "flash", hal_mkm_flash_write);
}
@@ -156,6 +168,10 @@ static int cmd_masterkey_unsecure_erase(struct cli_def *cli, const char *command
{
hal_error_t err;
+ command = command;
+ argv = argv;
+ argc = argc;
+
if ((err = hal_mkm_flash_erase(KEK_LENGTH)) == LIBHAL_OK) {
cli_print(cli, "Erased unsecure master key from flash");
} else {
diff --git a/projects/hsm/mgmt-misc.c b/projects/hsm/mgmt-misc.c
index ccd032b..e834b7d 100644
--- a/projects/hsm/mgmt-misc.c
+++ b/projects/hsm/mgmt-misc.c
@@ -115,6 +115,10 @@ int cli_receive_data(struct cli_def *cli, uint8_t *buf, size_t len, cli_data_cal
static int cmd_reboot(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
cli_print(cli, "\n\n\nRebooting\n\n\n");
HAL_NVIC_SystemReset();
diff --git a/projects/hsm/mgmt-task.c b/projects/hsm/mgmt-task.c
index ac1a737..beffc32 100644
--- a/projects/hsm/mgmt-task.c
+++ b/projects/hsm/mgmt-task.c
@@ -52,6 +52,10 @@ extern size_t request_queue_max(void);
static int cmd_task_show(struct cli_def *cli, const char *command, char *argv[], int argc)
{
+ command = command;
+ argv = argv;
+ argc = argc;
+
cli_print(cli, "name state stack high water");
cli_print(cli, "-------- -------- ----------------");