Skip to content

Commit 3b71827

Browse files
committed
fix(app): Pin display decryption
1 parent e3d6f63 commit 3b71827

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

apps/inheritance_app/inheritance_decrypt_data.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#include "status_api.h"
8181
#include "ui_core_confirm.h"
8282
#include "ui_screens.h"
83+
#include "ui_state_machine.h"
8384
#include "utils.h"
8485
#include "wallet.h"
8586
#include "wallet_list.h"
@@ -355,7 +356,7 @@ STATIC bool inheritance_decryption_handle_initiate_query(
355356
result.decrypt.which_response =
356357
INHERITANCE_DECRYPT_DATA_WITH_PIN_RESPONSE_CONFIRMATION_TAG;
357358
inheritance_send_result(&result);
358-
delay_scr_init(ui_text_processing, DELAY_TIME);
359+
delay_scr_init(ui_text_processing, DELAY_SHORT);
359360
return true;
360361
}
361362

@@ -608,7 +609,7 @@ static bool decrypt_data(void) {
608609
}
609610

610611
} while (0);
611-
delay_scr_init(ui_text_processing, DELAY_TIME);
612+
delay_scr_init(ui_text_processing, DELAY_SHORT);
612613
return status;
613614
}
614615

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

622623
if (tag == INHERITANCE_ONLY_SHOW_ON_DEVICE) {
623-
message_scr_init(
624-
(const char *)&decryption_context->data[i]
625-
.plain_data[3]); ///< sizeof (tag) + sizeof (length) = 3
624+
char msg[100] = {0};
625+
snprintf(msg,
626+
sizeof(msg),
627+
UI_TEXT_PIN, ///< TODO: Make this generic
628+
&decryption_context->data[i].plain_data[3]);
629+
message_scr_init(msg); ///< sizeof (tag) + sizeof (length) = 3
630+
// Do not care about the return value from confirmation screen
631+
(void)get_state_on_confirm_scr(0, 0, 0);
626632
} else {
627633
uint16_t offset = 1; // Skip tag
628634
decryption_context->response_payload.decrypted_data[response_count]
@@ -661,10 +667,10 @@ decryption_error_type_e inheritance_decrypt_data(inheritance_query_t *query) {
661667
if (inheritance_decryption_handle_initiate_query(query) &&
662668
inheritance_get_encrypted_data(query) && decrypt_data() && show_data() &&
663669
send_decrypted_data(query)) {
664-
delay_scr_init(ui_text_inheritance_decryption_flow_success, DELAY_TIME);
670+
delay_scr_init(ui_text_inheritance_decryption_flow_success, DELAY_SHORT);
665671
SET_ERROR_TYPE(DECRYPTION_OK);
666672
} else {
667-
delay_scr_init(ui_text_inheritance_decryption_flow_failure, DELAY_TIME);
673+
delay_scr_init(ui_text_inheritance_decryption_flow_failure, DELAY_SHORT);
668674
}
669675
decryption_handle_errors();
670676

src/constant_texts.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
#define UI_TEXT_BLIND_SIGNING_WARNING \
5454
LV_SYMBOL_WARNING " Blind Signing\nProceed at your own risk!"
5555
#define UI_TEXT_VERIFY_HD_PATH "Verify Derivation Path"
56-
#define UI_TEXT_PIN "PIN"
56+
#define UI_TEXT_PIN "PIN\n %s"
5757
#define UI_TEXT_VERIFY_DESTINATION_TAG "Verify Destination Tag\n%lu"
5858

5959
// product hash

0 commit comments

Comments
 (0)