Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions apps/inheritance_app/inheritance_auth_wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,7 @@ static void auth_wallet_error_default() {
SET_ERROR_TYPE(AUTH_WALLET_DEFAULT_ERROR);
}

static void auth_wallet_handle_errors() {
auth_wallet_error_type_e type = auth_wallet_error.type;
if (type == AUTH_WALLET_OK) {
return;
}
LOG_ERROR("inheritance_auth_wallet error code:%d ", auth_wallet_error.type);

static void auth_wallet_display_errors() {
// Display any error msg if exists
if (0 != strlen(error_screen.core_error_msg)) {
if (error_screen.ring_buzzer) {
Expand All @@ -187,6 +181,14 @@ static void auth_wallet_handle_errors() {
delay_scr_init(error_screen.core_error_msg, DELAY_SHORT);
clear_core_error_screen();
}
}

static void auth_wallet_handle_errors() {
auth_wallet_error_type_e type = auth_wallet_error.type;
if (type == AUTH_WALLET_OK) {
return;
}
LOG_ERROR("inheritance_auth_wallet error code:%d ", auth_wallet_error.type);

switch (type) {
case AUTH_WALLET_USER_ABORT_ERROR: {
Expand Down Expand Up @@ -471,6 +473,7 @@ auth_wallet_error_type_e inheritance_auth_wallet(inheritance_query_t *query) {
delay_scr_init(ui_text_inheritance_wallet_auth_success, DELAY_TIME);
SET_ERROR_TYPE(AUTH_WALLET_OK);
} else {
auth_wallet_display_errors();
delay_scr_init(ui_text_inheritance_wallet_auth_fail, DELAY_TIME);
}
auth_wallet_handle_errors();
Expand Down
12 changes: 12 additions & 0 deletions apps/inheritance_app/inheritance_decrypt_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@ static void decryption_set_defaults() {
SET_ERROR_TYPE(DECRYPTION_ERROR_DEFAULT);
}

static void decryption_display_errors() {
// Display any error msg if exists
if (0 != strlen(error_screen.core_error_msg)) {
if (error_screen.ring_buzzer) {
buzzer_start(BUZZER_DURATION);
}
delay_scr_init(error_screen.core_error_msg, DELAY_TIME);
clear_core_error_screen();
}
}

static void decryption_handle_errors() {
if (decryption_error.type == DECRYPTION_OK) {
return;
Expand Down Expand Up @@ -676,6 +687,7 @@ decryption_error_type_e inheritance_decrypt_data(inheritance_query_t *query) {
delay_scr_init(ui_text_inheritance_decryption_flow_success, DELAY_SHORT);
SET_ERROR_TYPE(DECRYPTION_OK);
} else {
decryption_display_errors();
delay_scr_init(ui_text_inheritance_decryption_flow_failure, DELAY_SHORT);
}
decryption_handle_errors();
Expand Down
19 changes: 11 additions & 8 deletions apps/inheritance_app/inheritance_encrypt_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,7 @@ static void encryption_set_defaults() {
SET_ERROR_TYPE(ENCRYPTION_ERROR_DEFAULT);
}

static void encryption_handle_errors() {
if (encryption_error.type == ENCRYPTION_OK) {
return;
}
LOG_ERROR("inheritance_encrypt_data Error Code:%d Flow Tag:%d ",
encryption_error.type,
encryption_error.flow);

static void encryption_display_errors() {
// Display any error msg if exists
if (0 != strlen(error_screen.core_error_msg)) {
if (error_screen.ring_buzzer) {
Expand All @@ -327,6 +320,15 @@ static void encryption_handle_errors() {
delay_scr_init(error_screen.core_error_msg, DELAY_TIME);
clear_core_error_screen();
}
}

static void encryption_handle_errors() {
if (encryption_error.type == ENCRYPTION_OK) {
return;
}
LOG_ERROR("inheritance_encrypt_data Error Code:%d Flow Tag:%d ",
encryption_error.type,
encryption_error.flow);

encryption_error_type_e type = encryption_error.type;
switch (type) {
Expand Down Expand Up @@ -808,6 +810,7 @@ encryption_error_type_e inheritance_encrypt_data(inheritance_query_t *query) {
delay_scr_init(ui_text_inheritance_encryption_flow_success, DELAY_TIME);
SET_ERROR_TYPE(ENCRYPTION_OK);
} else {
encryption_display_errors();
delay_scr_init(ui_text_inheritance_encryption_flow_failure, DELAY_TIME);
}
encryption_handle_errors();
Expand Down
6 changes: 3 additions & 3 deletions common/core/core_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ session_error_type_e session_aes_decrypt(uint8_t *InOut_data, uint16_t *len) {
ASSERT(InOut_data != NULL);
ASSERT(len != NULL);
if (session.state != SESSION_LIVE) {
LOG_ERROR("session_aes_encrypt error_code:%d\n",
LOG_ERROR("session_aes_decrypt error_code:%d\n",
SESSION_INVALID_STATE_ERROR);
return SESSION_INVALID_STATE_ERROR;
}
Expand All @@ -468,13 +468,13 @@ session_error_type_e session_aes_decrypt(uint8_t *InOut_data, uint16_t *len) {
aes_decrypt_ctx ctx = {0};

if (EXIT_SUCCESS != aes_decrypt_key256(session.session_key, &ctx)) {
LOG_ERROR("session_aes_encrypt error_code:%d\n", SESSION_ENCRYPTION_ERROR);
LOG_ERROR("aes_decrypt_key256 error_code:%d\n", SESSION_DECRYPTION_ERROR);
return SESSION_DECRYPTION_ERROR;
}

if (aes_cbc_decrypt(payload, InOut_data, size, session.session_iv, &ctx) !=
EXIT_SUCCESS) {
LOG_ERROR("session_aes_encrypt error_code:%d\n", SESSION_ENCRYPTION_ERROR);
LOG_ERROR("aes_cbc_decrypt error_code:%d\n", SESSION_DECRYPTION_ERROR);
return SESSION_DECRYPTION_ERROR;
}

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
firmware version=000:006:005:002
firmware version=000:006:005:003
hardware version=000:001:000:000
magic number=45227A01
Loading