Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Inheritance bugs #571

Merged
merged 4 commits into from
Oct 7, 2024
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
2 changes: 1 addition & 1 deletion apps/inheritance_app/inheritance_auth_wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static bool auth_wallet_get_seed_entropy() {

static bool auth_wallet_pair_card() {
card_error_type_e status = single_card_pair_operation(
(char *)ui_text_tap_the_card, ui_text_place_card_below);
TejasvOnly marked this conversation as resolved.
Show resolved Hide resolved
(char *)ui_text_tap_a_card, ui_text_place_card_below);
if (status != CARD_OPERATION_SUCCESS) {
SET_ERROR_TYPE(AUTH_WALLET_PAIRING_ERROR);
return false;
Expand Down
13 changes: 8 additions & 5 deletions apps/inheritance_app/inheritance_decrypt_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,14 @@ static bool deserialize_packet(void) {
}

static bool decrypt_message_data(void) {
return card_fetch_decrypt_data(decryption_context->wallet_id,
decryption_context->data,
decryption_context->data_count) ==
CARD_OPERATION_SUCCESS;
if (card_fetch_decrypt_data(decryption_context->wallet_id,
decryption_context->data,
decryption_context->data_count) !=
CARD_OPERATION_SUCCESS) {
return false;
}
set_app_flow_status(INHERITANCE_DECRYPT_DATA_STATUS_MESSAGE_DECRYPTED);
return true;
}

static bool decrypt_data(void) {
Expand All @@ -521,7 +525,6 @@ static bool decrypt_data(void) {
}

} while (0);
set_app_flow_status(INHERITANCE_DECRYPT_DATA_STATUS_MESSAGE_DECRYPTED);
delay_scr_init(ui_text_processing, DELAY_TIME);
return status;
}
Expand Down
10 changes: 1 addition & 9 deletions src/card_operations/card_fetch_wallet_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,7 @@ bool card_fetch_wallet_name(const uint8_t *wallet_id, char *wallet_name) {
}
nfc_deselect_card();

// P0 abort is the only condition we want to exit the flow
// Card abort error will be explicitly shown here as error codes
if (card_data.error_type == CARD_OPERATION_P0_OCCURED) {
return false;
}

// If the tapped card is not paired, it is a terminal case in the flow
if (card_data.nfc_data.pairing_error) {
delay_scr_init(ui_text_device_and_card_not_paired, DELAY_TIME);
if (result != CARD_OPERATION_SUCCESS) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/card_operations/card_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static card_error_type_e handle_wait_for_card_selection(
evt_status = get_events(EVENT_CONFIG_NFC, MAX_INACTIVITY_TIMEOUT);

if (true == evt_status.p0_event.flag) {
return CARD_OPERATION_P0_OCCURED;
NFC_RETURN_ERROR_TYPE(card_data, CARD_OPERATION_P0_OCCURED);
}

/* This API call is required to select the detected card as `get_events` calls
Expand Down
1 change: 0 additions & 1 deletion src/constant_texts.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,6 @@ const char *ui_text_inheritance_wallet_auth_success =
"Wallet\nauthenticated\nsuccessfully";
const char *ui_text_inheritance_wallet_auth_fail =
"Wallet\nauthentication\nfailed";
const char *ui_text_tap_the_card = "Tap the card";

const char *ui_text_inheritance_encryption_flow_confirmation =
"Proceed to encrypt data for %s?";
Expand Down
1 change: 0 additions & 1 deletion src/constant_texts.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ extern const char *ui_text_inheritance_wallet_auth_flow_confirmation_generic;
extern const char *ui_text_inheritance_wallet_authenticating;
extern const char *ui_text_inheritance_wallet_auth_success;
extern const char *ui_text_inheritance_wallet_auth_fail;
extern const char *ui_text_tap_the_card;

extern const char *ui_text_inheritance_encryption_flow_confirmation;
extern const char *ui_text_inheritance_encryption_flow_success;
Expand Down
Loading