Skip to content

Commit a2fe260

Browse files
committed
fix: Minor updates as per PR review
1 parent 8004cf4 commit a2fe260

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

apps/btc_family/btc_pub_key.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ static void send_public_key(const uint8_t *public_key);
161161
/*****************************************************************************
162162
* STATIC VARIABLES
163163
*****************************************************************************/
164-
static bool sign_address = false;
164+
#ifndef BTC_ONLY_BUILD
165+
static bool sign_address = false;
166+
#endif // BTC_ONLY_BUILD
165167

166168
static bool check_which_request(const btc_query_t *query,
167169
pb_size_t which_request) {
@@ -184,13 +186,13 @@ static bool validate_request_data(btc_get_public_key_request_t *request) {
184186
status = false;
185187
}
186188

189+
#ifndef BTC_ONLY_BUILD
187190
caq_node_data_t data = {.applet_id = get_btc_app_desc()->id};
188191

189192
memzero(data.params, sizeof(data.params));
190193
memcpy(data.params,
191194
request->initiate.wallet_id,
192195
sizeof(request->initiate.wallet_id));
193-
#ifndef BTC_ONLY_BUILD
194196
data.params[32] = EXCHANGE_FLOW_TAG_RECEIVE;
195197
sign_address = exchange_app_validate_caq(data);
196198
#endif // BTC_ONLY_BUILD
@@ -305,12 +307,12 @@ void btc_get_pub_key(btc_query_t *query) {
305307
delay_scr_init(ui_text_processing, DELAY_SHORT);
306308
size_t length = btc_get_address(seed, path, path_length, public_key, msg);
307309
memzero(seed, sizeof(seed));
308-
310+
311+
#ifndef BTC_ONLY_BUILD
309312
if (sign_address) {
310-
#ifndef BTC_ONLY_BUILD
311313
exchange_sign_address(msg, sizeof(msg));
312-
#endif // BTC_ONLY_BUILD
313314
}
315+
#endif // BTC_ONLY_BUILD
314316

315317
if (0 < length &&
316318
true == core_scroll_page(ui_text_receive_on, msg, btc_send_error)) {

apps/btc_family/btc_txn.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ static bool send_script_sig(btc_query_t *query, const scrip_sig_t *sigs);
281281
/*****************************************************************************
282282
* STATIC VARIABLES
283283
*****************************************************************************/
284-
static bool use_signature_verification = false;
285284
static btc_txn_context_t *btc_txn_context = NULL;
286285

287286
/*****************************************************************************
@@ -313,6 +312,7 @@ static bool validate_request_data(const btc_sign_txn_request_t *request) {
313312
status = false;
314313
}
315314
#ifndef BTC_ONLY_BUILD
315+
bool use_signature_verification = false; // Declare and initialize here
316316
caq_node_data_t data = {.applet_id = get_btc_app_desc()->id};
317317
memzero(data.params, sizeof(data.params));
318318
memcpy(data.params,
@@ -572,6 +572,14 @@ static bool get_user_verification() {
572572
char value[100] = "";
573573
char address[100] = "";
574574

575+
#ifndef BTC_ONLY_BUILD
576+
bool use_signature_verification = false;
577+
// This needs to be re-evaluated as validate_request_data will be called first and will set this variable.
578+
// The query is not accessible directly in get_user_verification.
579+
// For now, removing this re-evaluation part.
580+
// Keeping the if condition as is for the exchange_validate_stored_signature function call.
581+
#endif // BTC_ONLY_BUILD
582+
575583
for (int idx = 0; idx < btc_txn_context->metadata.output_count; idx++) {
576584
btc_sign_txn_output_t *output = &btc_txn_context->outputs[idx];
577585
btc_sign_txn_output_script_pub_key_t *script = &output->script_pub_key;
@@ -590,14 +598,14 @@ static bool get_user_verification() {
590598
return false;
591599
}
592600

601+
#ifndef BTC_ONLY_BUILD
593602
if (use_signature_verification) {
594-
#ifndef BTC_ONLY_BUILD
595603
if (!exchange_validate_stored_signature(address, sizeof(address))) {
596604
btc_send_error(ERROR_COMMON_ERROR_UNKNOWN_ERROR_TAG, status);
597605
return false;
598606
}
599-
#endif // BTC_ONLY_BUILD
600607
}
608+
#endif // BTC_ONLY_BUILD
601609

602610
if (!core_scroll_page(title, address, btc_send_error) ||
603611
!core_scroll_page(title, value, btc_send_error)) {
@@ -749,4 +757,4 @@ void btc_sign_transaction(btc_query_t *query) {
749757
free(btc_txn_context);
750758
btc_txn_context = NULL;
751759
}
752-
}
760+
}

common/core/core_flow_init.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ void core_init_app_registry() {
187187
registry_add_app(get_ltc_app_desc());
188188
registry_add_app(get_doge_app_desc());
189189
registry_add_app(get_dash_app_desc());
190-
registry_add_app(get_inheritance_app_desc());
191190

192191
registry_add_app(get_eth_app_desc());
193192
registry_add_app(get_near_app_desc());

0 commit comments

Comments
 (0)