Skip to content

Commit

Permalink
fix(core): Fix style and unix build.
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
andrewkozlik committed Jun 24, 2024
1 parent da068fb commit f396d00
Show file tree
Hide file tree
Showing 3 changed files with 1,474 additions and 1,474 deletions.
8 changes: 4 additions & 4 deletions core/embed/trezorhal/optiga/optiga.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int optiga_sign(uint8_t index, const uint8_t *digest, size_t digest_size,
&signature[2], max_sig_size - 2, sig_size);
if (ret == OPTIGA_ERR_CMD) {
uint8_t error_code = 0;
(void) optiga_get_error_code(&error_code);
(void)optiga_get_error_code(&error_code);
return error_code + OPTIGA_COMMAND_ERROR_OFFSET;
}

Expand Down Expand Up @@ -672,7 +672,7 @@ int optiga_pin_verify_v4(OPTIGA_UI_PROGRESS ui_progress,
memzero(stretched_pin, sizeof(stretched_pin));
if (res == OPTIGA_ERR_CMD) {
uint8_t error_code = 0;
(void) optiga_get_error_code(&error_code);
(void)optiga_get_error_code(&error_code);
return error_code + OPTIGA_COMMAND_ERROR_OFFSET;
}

Expand Down Expand Up @@ -736,7 +736,7 @@ static int optiga_pin_stretch_hmac(
memzero(digest, sizeof(digest));
if (res != OPTIGA_SUCCESS) {
uint8_t error_code = 0;
(void) optiga_get_error_code(&error_code);
(void)optiga_get_error_code(&error_code);
if (error_code + OPTIGA_COMMAND_ERROR_OFFSET ==
OPTIGA_ERR_ACCESS_COND_NOT_SAT) {
return OPTIGA_ERR_COUNTER_EXCEEDED;
Expand Down Expand Up @@ -777,7 +777,7 @@ int optiga_pin_verify(OPTIGA_UI_PROGRESS ui_progress,
memzero(digest, sizeof(digest));
if (res == OPTIGA_ERR_CMD) {
uint8_t error_code = 0;
(void) optiga_get_error_code(&error_code);
(void)optiga_get_error_code(&error_code);
return error_code + OPTIGA_COMMAND_ERROR_OFFSET;
}

Expand Down
6 changes: 3 additions & 3 deletions core/embed/trezorhal/unix/optiga.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,21 @@ bool optiga_random_buffer(uint8_t *dest, size_t size) {

int optiga_pin_set(OPTIGA_UI_PROGRESS ui_progress,
uint8_t stretched_pin[OPTIGA_PIN_SECRET_SIZE]) {
ui_progress(OPTIGA_PIN_DERIVE_MS);
ui_progress(OPTIGA_PIN_SET_MS);
return OPTIGA_SUCCESS;
}

int optiga_pin_verify_v4(OPTIGA_UI_PROGRESS ui_progress,
const uint8_t pin_secret[OPTIGA_PIN_SECRET_SIZE],
uint8_t out_secret[OPTIGA_PIN_SECRET_SIZE]) {
memcpy(out_secret, pin_secret, OPTIGA_PIN_SECRET_SIZE);
ui_progress(OPTIGA_PIN_DERIVE_MS);
ui_progress(OPTIGA_PIN_VERIFY_MS);
return OPTIGA_SUCCESS;
}

int optiga_pin_verify(OPTIGA_UI_PROGRESS ui_progress,
uint8_t stretched_pin[OPTIGA_PIN_SECRET_SIZE]) {
ui_progress(OPTIGA_PIN_DERIVE_MS);
ui_progress(OPTIGA_PIN_VERIFY_MS);
return OPTIGA_SUCCESS;
}

Expand Down
Loading

0 comments on commit f396d00

Please sign in to comment.