@@ -281,7 +281,6 @@ static bool send_script_sig(btc_query_t *query, const scrip_sig_t *sigs);
281
281
/*****************************************************************************
282
282
* STATIC VARIABLES
283
283
*****************************************************************************/
284
- static bool use_signature_verification = false;
285
284
static btc_txn_context_t * btc_txn_context = NULL ;
286
285
287
286
/*****************************************************************************
@@ -313,6 +312,7 @@ static bool validate_request_data(const btc_sign_txn_request_t *request) {
313
312
status = false;
314
313
}
315
314
#ifndef BTC_ONLY_BUILD
315
+ bool use_signature_verification = false; // Declare and initialize here
316
316
caq_node_data_t data = {.applet_id = get_btc_app_desc ()-> id };
317
317
memzero (data .params , sizeof (data .params ));
318
318
memcpy (data .params ,
@@ -572,6 +572,14 @@ static bool get_user_verification() {
572
572
char value [100 ] = "" ;
573
573
char address [100 ] = "" ;
574
574
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
+
575
583
for (int idx = 0 ; idx < btc_txn_context -> metadata .output_count ; idx ++ ) {
576
584
btc_sign_txn_output_t * output = & btc_txn_context -> outputs [idx ];
577
585
btc_sign_txn_output_script_pub_key_t * script = & output -> script_pub_key ;
@@ -590,14 +598,14 @@ static bool get_user_verification() {
590
598
return false;
591
599
}
592
600
601
+ #ifndef BTC_ONLY_BUILD
593
602
if (use_signature_verification ) {
594
- #ifndef BTC_ONLY_BUILD
595
603
if (!exchange_validate_stored_signature (address , sizeof (address ))) {
596
604
btc_send_error (ERROR_COMMON_ERROR_UNKNOWN_ERROR_TAG , status );
597
605
return false;
598
606
}
599
- #endif // BTC_ONLY_BUILD
600
607
}
608
+ #endif // BTC_ONLY_BUILD
601
609
602
610
if (!core_scroll_page (title , address , btc_send_error ) ||
603
611
!core_scroll_page (title , value , btc_send_error )) {
@@ -749,4 +757,4 @@ void btc_sign_transaction(btc_query_t *query) {
749
757
free (btc_txn_context );
750
758
btc_txn_context = NULL ;
751
759
}
752
- }
760
+ }
0 commit comments