Skip to content

Commit 136559d

Browse files
authored
Merge pull request #12 from blooo-io/fix/audit-fix
fix: audit fix
2 parents 2d4a233 + 91ca8a3 commit 136559d

File tree

185 files changed

+97
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+97
-147
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ doc/html
3737
doc/latex
3838

3939
tests/snapshots-tmp
40+
tests/bitcoin

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include $(BOLOS_SDK)/Makefile.defines
3939
CURVE_APP_LOAD_PARAMS = secp256k1
4040

4141
# Application allowed derivation paths.
42-
PATH_APP_LOAD_PARAMS = ""
42+
PATH_APP_LOAD_PARAMS = "44'/0'" "44'/1'" "84'/0'" "84'/1'" "86'/0'" "86'/1'"
4343

4444
# Allowed SLIP21 paths
4545
PATH_SLIP21_APP_LOAD_PARAMS = "LEDGER-Wallet policy"
@@ -76,7 +76,6 @@ endif
7676
# Application custom permissions #
7777
########################################
7878
HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1
79-
HAVE_APPLICATION_FLAG_GLOBAL_PIN = 1
8079
HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1
8180
HAVE_APPLICATION_FLAG_LIBRARY = 1
8281

src/boilerplate/dispatcher.h

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ static inline void SEND_SW(struct dispatcher_context_s *dc, uint16_t sw) {
3030
dc->send_response();
3131
}
3232

33+
#define SAFE_SEND_SW(dc, sw) \
34+
do { \
35+
if (dc != NULL) { \
36+
SEND_SW(dc, sw); \
37+
} else { \
38+
PRINTF("Error: Null dispatcher context\n"); \
39+
} \
40+
} while (0)
41+
3342
static inline void SET_RESPONSE(struct dispatcher_context_s *dc,
3443
void *rdata,
3544
size_t rdata_len,

src/handler/withdraw.c

+83-131
Large diffs are not rendered by default.

src/ui/display.c

-10
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,6 @@ bool ui_validate_withdraw_data_and_confirm(dispatcher_context_t *context,
172172
return io_ui_process(context, SET_UX_DIRTY);
173173
}
174174

175-
// bool ui_display_message_confirm(dispatcher_context_t *context) {
176-
// #ifdef HAVE_AUTOAPPROVE_FOR_PERF_TESTS
177-
// return true;
178-
// #endif
179-
180-
// (void) context;
181-
// ui_sign_message_confirm_flow();
182-
183-
// return io_ui_process(context, SET_UX_DIRTY);
184-
// }
185175
#ifdef HAVE_BAGL
186176
bool ui_display_register_wallet(dispatcher_context_t *context,
187177
const policy_map_wallet_header_t *wallet_header,

test_utils/authproxy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import time
4848
import urllib.parse
4949

50-
HTTP_TIMEOUT = 30
50+
HTTP_TIMEOUT = 60
5151
USER_AGENT = "AuthServiceProxy/0.1"
5252

5353
log = logging.getLogger("BitcoinRPC")

tests/test_register_wallet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def test_register_wallet_unsupported_policy(navigator: Navigator, firmware: Firm
200200
assert DeviceException.exc.get(e.value.status) == NotSupportedError
201201
assert len(e.value.data) == 0
202202

203-
203+
@pytest.mark.timeout(0) # disable timeout
204204
def test_register_miniscript_long_policy(navigator: Navigator, firmware: Firmware, client:
205205
RaggerClient, test_name: str, speculos_globals):
206206
# This test makes sure that policies longer than 256 bytes work as expected on all devices
@@ -397,7 +397,7 @@ def test_register_wallet_tr_with_nums_keypath(navigator: Navigator, firmware: Fi
397397
instructions=register_wallet_instruction_approve(firmware),
398398
test_name=test_name)
399399

400-
400+
@pytest.mark.timeout(0) # disable timeout
401401
def test_register_wallet_tr_script_sortedmulti(navigator: Navigator, firmware: Firmware, client:
402402
RaggerClient, test_name: str, speculos_globals):
403403
run_register_test(navigator, client, speculos_globals, WalletPolicy(

tests/test_sign_psbt_with_sighash_types.py

-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ def test_sighash_single_3_ins_2_out(navigator: Navigator, firmware: Firmware, cl
284284
assert DeviceException.exc.get(e.value.status) == NotSupportedError
285285
assert len(e.value.data) == 0
286286

287-
288287
def test_sighash_all_anyone_sign(navigator: Navigator, firmware: Firmware, client: RaggerClient, test_name: str):
289288
psbt = open_psbt_from_file(f"{tests_root}/psbt/sighash/sighash-all-anyone-can-pay-sign.psbt")
290289

0 commit comments

Comments
 (0)