Skip to content

Commit

Permalink
fix(app): Pin display decryption
Browse files Browse the repository at this point in the history
  • Loading branch information
vrockz747 committed Nov 14, 2024
1 parent 649e7af commit 328e0ab
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions apps/inheritance_app/inheritance_decrypt_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
#include "status_api.h"
#include "ui_core_confirm.h"
#include "ui_screens.h"
#include "ui_state_machine.h"
#include "utils.h"
#include "wallet.h"
#include "wallet_list.h"
Expand Down Expand Up @@ -355,7 +356,7 @@ STATIC bool inheritance_decryption_handle_initiate_query(
result.decrypt.which_response =
INHERITANCE_DECRYPT_DATA_WITH_PIN_RESPONSE_CONFIRMATION_TAG;
inheritance_send_result(&result);
delay_scr_init(ui_text_processing, DELAY_TIME);
delay_scr_init(ui_text_processing, DELAY_SHORT);
return true;
}

Expand Down Expand Up @@ -608,7 +609,7 @@ static bool decrypt_data(void) {
}

} while (0);
delay_scr_init(ui_text_processing, DELAY_TIME);
delay_scr_init(ui_text_processing, DELAY_SHORT);
return status;
}

Expand All @@ -620,9 +621,14 @@ static bool show_data(void) {
uint8_t tag = decryption_context->data[i].plain_data[0];

if (tag == INHERITANCE_ONLY_SHOW_ON_DEVICE) {
message_scr_init(
(const char *)&decryption_context->data[i]
.plain_data[3]); ///< sizeof (tag) + sizeof (length) = 3
char msg[100] = {0};
snprintf(msg,
sizeof(msg),
UI_TEXT_PIN, ///< TODO: Make this generic
&decryption_context->data[i].plain_data[3]);
message_scr_init(msg); ///< sizeof (tag) + sizeof (length) = 3
// Do not care about the return value from confirmation screen
(void)get_state_on_confirm_scr(0, 0, 0);
} else {
uint16_t offset = 1; // Skip tag
decryption_context->response_payload.decrypted_data[response_count]
Expand Down Expand Up @@ -661,10 +667,10 @@ decryption_error_type_e inheritance_decrypt_data(inheritance_query_t *query) {
if (inheritance_decryption_handle_initiate_query(query) &&
inheritance_get_encrypted_data(query) && decrypt_data() && show_data() &&
send_decrypted_data(query)) {
delay_scr_init(ui_text_inheritance_decryption_flow_success, DELAY_TIME);
delay_scr_init(ui_text_inheritance_decryption_flow_success, DELAY_SHORT);
SET_ERROR_TYPE(DECRYPTION_OK);
} else {
delay_scr_init(ui_text_inheritance_decryption_flow_failure, DELAY_TIME);
delay_scr_init(ui_text_inheritance_decryption_flow_failure, DELAY_SHORT);
}
decryption_handle_errors();

Expand Down
2 changes: 1 addition & 1 deletion src/constant_texts.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#define UI_TEXT_BLIND_SIGNING_WARNING \
LV_SYMBOL_WARNING " Blind Signing\nProceed at your own risk!"
#define UI_TEXT_VERIFY_HD_PATH "Verify Derivation Path"
#define UI_TEXT_PIN "PIN"
#define UI_TEXT_PIN "PIN\n %s"
#define UI_TEXT_VERIFY_DESTINATION_TAG "Verify Destination Tag\n%lu"

// product hash
Expand Down

0 comments on commit 328e0ab

Please sign in to comment.