Skip to content

Commit

Permalink
Fix Jade signing issues with Swan Vault (#2421)
Browse files Browse the repository at this point in the history
* update jade api to version 2.0.2 and update jade hwi client to the latest hwi code (version

* change chain default for initialising the jade client back to MAIN

* add "unlock" to jade's enumerate method and its hwi client

* use is_startup property to prevent jade unlocking on startup + change to skip_hwi_initialisation + some simplifications

* pass chain param on every request for enumerate call as well + some changes to be on the safe side (avoid name collusion with built-in fetch + random id)

* always use timeout when calling enumerate from hwi.jinja

* add ui to register multisigs for multisig wallets using a jade

* updated requirements.txt

* rename myFetch to requestToHwiBridge

* address jamie's comments: change logic to skip_unlocking + move early return up in jade client
  • Loading branch information
moneymanolis authored Mar 27, 2024
1 parent a052373 commit 7970c3d
Show file tree
Hide file tree
Showing 18 changed files with 2,496 additions and 702 deletions.
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ psutil==5.9.0
pyopenssl==23.0.0
flask_wtf==0.15.1
pgpy==0.6.0
cbor==1.0.0
cbor2==5.4.6
mnemonic==0.20
cryptography==39.0.1
Flask-APScheduler==1.12.4
Expand Down
47 changes: 42 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --generate-hashes --resolver=backtracking requirements.in
# pip-compile --generate-hashes requirements.in
#
aniso8601==9.0.1 \
--hash=sha256:1d2b7ef82963909e93c4f24ce48d4de9e66009a21bf1c1e1c85bdd0812fe412f \
Expand All @@ -26,9 +26,45 @@ bitbox02==6.1.1 \
# via hwi
cbor==1.0.0 \
--hash=sha256:13225a262ddf5615cbd9fd55a76a0d53069d18b07d2e9f19c39e6acb8609bbb6
# via
# -r requirements.in
# hwi
# via hwi
cbor2==5.4.6 \
--hash=sha256:0b956f19e93ba3180c336282cd1b6665631f2d3a196a9c19b29a833bf979e7a4 \
--hash=sha256:0bd12c54a48949d11f5ffc2fa27f5df1b4754111f5207453e5fae3512ebb3cab \
--hash=sha256:0d2b926b024d3a1549b819bc82fdc387062bbd977b0299dd5fa5e0ea3267b98b \
--hash=sha256:1618d16e310f7ffed141762b0ff5d8bb6b53ad449406115cc465bf04213cefcf \
--hash=sha256:181ac494091d1f9c5bb373cd85514ce1eb967a8cf3ec298e8dfa8878aa823956 \
--hash=sha256:1835536e76ea16e88c934aac5e369ba9f93d495b01e5fa2d93f0b4986b89146d \
--hash=sha256:1c12c0ab78f5bc290b08a79152a8621822415836a86f8f4b50dadba371736fda \
--hash=sha256:24144822f8d2b0156f4cda9427f071f969c18683ffed39663dc86bc0a75ae4dd \
--hash=sha256:309fffbb7f561d67f02095d4b9657b73c9220558701c997e9bfcfbca2696e927 \
--hash=sha256:3316f09a77af85e7772ecfdd693b0f450678a60b1aee641bac319289757e3fa0 \
--hash=sha256:3545b16f9f0d5f34d4c99052829c3726020a07be34c99c250d0df87418f02954 \
--hash=sha256:39452c799453f5bf33281ffc0752c620b8bfa0b7c13070b87d370257a1311976 \
--hash=sha256:3950be57a1698086cf26d8710b4e5a637b65133c5b1f9eec23967d4089d8cfed \
--hash=sha256:456cdff668a50a52fdb8aa6d0742511e43ed46d6a5b463dba80a5a720fa0d320 \
--hash=sha256:4b9f3924da0e460a93b3674c7e71020dd6c9e9f17400a34e52a88c0af2dcd2aa \
--hash=sha256:4bbbdb2e3ef274865dc3f279aae109b5d94f4654aea3c72c479fb37e4a1e7ed7 \
--hash=sha256:4ce1a2c272ba8523a55ea2f1d66e3464e89fa0e37c9a3d786a919fe64e68dbd7 \
--hash=sha256:56dfa030cd3d67e5b6701d3067923f2f61536a8ffb1b45be14775d1e866b59ae \
--hash=sha256:6709d97695205cd08255363b54afa035306d5302b7b5e38308c8ff5a47e60f2a \
--hash=sha256:6e1b5aee920b6a2f737aa12e2b54de3826b09f885a7ce402db84216343368140 \
--hash=sha256:6f9c702bee2954fffdfa3de95a5af1a6b1c5f155e39490353d5654d83bb05bb9 \
--hash=sha256:78304df140b9e13b93bcbb2aecee64c9aaa9f1cadbd45f043b5e7b93cc2f21a2 \
--hash=sha256:79e048e623846d60d735bb350263e8fdd36cb6195d7f1a2b57eacd573d9c0b33 \
--hash=sha256:7bbd3470eb685325398023e335be896b74f61b014896604ed45049a7b7b6d8ac \
--hash=sha256:80ac8ba450c7a41c5afe5f7e503d3092442ed75393e1de162b0bf0d97edf7c7f \
--hash=sha256:9394ca49ecdf0957924e45d09a4026482d184a465a047f60c4044eb464c43de9 \
--hash=sha256:94f844d0e232aca061a86dd6ff191e47ba0389ddd34acb784ad9a41594dc99a4 \
--hash=sha256:96087fa5336ebfc94465c0768cd5de0fcf9af3840d2cf0ce32f5767855f1a293 \
--hash=sha256:b893500db0fe033e570c3adc956af6eefc57e280026bd2d86fd53da9f1e594d7 \
--hash=sha256:c285a2cb2c04004bfead93df89d92a0cef1874ad337d0cb5ea53c2c31e97bfdb \
--hash=sha256:d2984a488f350aee1d54fa9cb8c6a3c1f1f5b268abbc91161e47185de4d829f3 \
--hash=sha256:d54bd840b4fe34f097b8665fc0692c7dd175349e53976be6c5de4433b970daa4 \
--hash=sha256:db9eb582fce972f0fa429d8159b7891ff8deccb7affc4995090afc61ce0d328a \
--hash=sha256:e5094562dfe3e5583202b93ef7ca5082c2ba5571accb2c4412d27b7d0ba8a563 \
--hash=sha256:e73ca40dd3c7210ff776acff9869ddc9ff67bae7c425b58e5715dcf55275163f \
--hash=sha256:ff95b33e5482313a74648ca3620c9328e9f30ecfa034df040b828e476597d352
# via -r requirements.in
certifi==2022.12.7 \
--hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \
--hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18
Expand Down Expand Up @@ -796,5 +832,6 @@ wtforms==3.0.1 \
# via flask-wtf

# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag.
# pinned when the requirements file includes hashes and the requirement is not
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# setuptools
10 changes: 5 additions & 5 deletions src/cryptoadvance/specter/cli/cli_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def cli():
help="Start the hwi-bridge to use your HWWs with a remote specter.",
)
@click.option(
"--enforcehwiinitialisation",
"--skiphwiinitialisation",
is_flag=True,
help="calls enumerate() which is known to cause issues with certain usb-devices plugged in at startup.",
help="Skips to call HWI's enumerate() on start-up",
)
@click.option(
"--devstatus-threshold",
Expand Down Expand Up @@ -88,7 +88,7 @@ def server(
filelog,
tor,
hwibridge,
enforcehwiinitialisation,
skiphwiinitialisation,
devstatus_threshold,
specter_data_folder,
config,
Expand Down Expand Up @@ -154,8 +154,8 @@ def server(
kwargs = configure_ssl(kwargs, app.config, ssl)

app.app_context().push()
if enforcehwiinitialisation:
app.config["ENFORCE_HWI_INITIALISATION_AT_STARTUP"] = True
if skiphwiinitialisation:
app.config["SKIP_HWI_INITIALISATION_AT_STARTUP"] = True
init_app(app, hwibridge=hwibridge)

if filelog:
Expand Down
6 changes: 3 additions & 3 deletions src/cryptoadvance/specter/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class BaseConfig(object):
CERT = os.getenv("CERT", None)
KEY = os.getenv("KEY", None)

# It might be necessary to enforce the HWI initialisation
ENFORCE_HWI_INITIALISATION_AT_STARTUP = _get_bool_env_var(
"ENFORCE_HWI_INITIALISATION_AT_STARTUP", False
# It might be necessary / useful for testing to skip the HWI initialisation (i.e. calling enumerate on startup)
SKIP_HWI_INITIALISATION_AT_STARTUP = _get_bool_env_var(
"SKIP_HWI_INITIALISATION_AT_STARTUP", False
)

# This will be used to search for a bitcoin.conf in order to enable the
Expand Down
Loading

0 comments on commit 7970c3d

Please sign in to comment.