1
0
Commit Graph

524 Commits

Author SHA1 Message Date
ThomasV
f6312366e6 swapserver: raise exception if client uses deprecated API 2024-03-01 17:25:37 +01:00
SomberNight
85ea2dfc48 trezor: add_slip_19_ownership_proofs_to_tx to not skip complete inputs
closes https://github.com/spesmilo/electrum/issues/8910
2024-02-23 12:50:25 +00:00
SomberNight
b4712397cc logging: (trivial) use repr() of seed_type
for more obvious empty string

related: https://github.com/spesmilo/electrum/issues/4326#issuecomment-1903747632
2024-02-22 11:45:18 +00:00
SomberNight
96f28607f2 keystore: "old"-type seeds cannot have a passphrase
related: https://github.com/spesmilo/electrum/pull/8906
2024-02-21 14:30:13 +00:00
Sander van Grieken
da1727b2f7 trustedcoin: validate numeric format of OTP user entry (fixes #8905) 2024-02-21 13:33:46 +01:00
ThomasV
e2db5ca2ef Merge pull request #8871 from SomberNight/202402_slip19_trezor
support SLIP-19 ownership proofs, for trezor-based Standard_Wallets
2024-02-21 13:06:28 +01:00
SomberNight
0925f15280 wallet/keystore: add apis for "add_slip_19_ownership_proofs_to_tx"
- implement it specifically for the "singlesig trezor" case
- aimed to be generic enough that support for more complex scripts
  and other keystores could be added later
2024-02-21 11:56:13 +00:00
Sander van Grieken
643fbecc15 wizard: fix co-signing hardware wallets data incorrectly referenced 2024-02-14 12:42:15 +01:00
SomberNight
6172898a03 trezor: minor things for better model "safe 3" support 2024-02-14 09:48:13 +00:00
SomberNight
fffbc178cd qt wizard: hww dialogs: log some exceptions more aggressively
sort of related: https://github.com/spesmilo/electrum/issues/8892
2024-02-14 09:05:21 +00:00
SomberNight
130baf13c8 trezor: show descriptive error if trying to init device without fw
closes https://github.com/spesmilo/electrum/issues/8892
2024-02-14 08:52:23 +00:00
SomberNight
7cf22d4b9f coldcard: wallet info dlg: fix missing "Export for Coldcard" btn
regression from 711a325085

```
 47.97 | E | plugin | Plugin error. plugin: coldcard, hook: wallet_info_buttons
Traceback (most recent call last):
  File "...\electrum\electrum\plugin.py", line 261, in run_hook
    r = f(*args)
  File "...\electrum\electrum\plugins\hw_wallet\plugin.py", line 344, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\plugins\coldcard\qt.py", line 51, in wallet_info_buttons
    wallet = main_window.wallet
AttributeError: 'WalletInfoDialog' object has no attribute 'wallet'
```
2024-02-13 13:35:19 +00:00
Sander van Grieken
2882c4be46 qt: consistency HWW wizard page translations 2024-02-06 10:59:59 +01:00
Sander van Grieken
0a2a22b822 qt: use selected_key instead of selected_item[0] for ChoiceWidgets 2024-02-05 14:39:03 +01:00
SomberNight
87214c004e trezor: don't try to sign non-ismine inputs
progress towards coinjoin

related https://github.com/spesmilo/electrum/issues/8868
2024-02-05 07:21:28 +00:00
SomberNight
3e81cd1f1d trezor: fix regression in sign_transaction for trezor one for multisig
fixes https://github.com/spesmilo/electrum/issues/8813
regression from eef9680743

We started setting the witness field in above commit to be able to provide the witnesses for already pre-signed
external inputs to the device, e.g. for a coinjoin.

Trezor One fw has pretty strict limits on the witness field: max 109 bytes,
probably because that's a ~tight upper bound for a p2wpkh witness:
  <num_witness_items> <len(sig)> <sig> <len(pubkey)> <pubkey>, it comes out to 3+73(high-S and high-R)+33.
ed1785a985/legacy/firmware/protob/messages-bitcoin.options (L35)

Trezor model T seems to have higher limits.

tx_inputs is called for the tx being signed (for_sig=True), and for its parents/prev_txes (for_sig=False).
The witness is only useful for the tx being signed, I think.

Users reported seeing a "DataError: bytes overflow" exception when using a Trezor One to sign 2of3 p2wsh multisig txs.
There were no external inputs involved so for the tx being signed all witnesses were None, however we were also
setting the witness for the inputs of prev_txes.
The witness for a 2of3 pw2sh multisig input is around ~253 bytes.

To sidestep the problem, we now only set the witness in the for_sig=True case.
Note that this means if someone tries to do a coinjoin with a Trezor One involving non-trivial external inputs,
they will run into the same limit and exception.
2024-02-04 00:14:59 +00:00
Sander van Grieken
28042c61c1 qml: trustedcoin: remove redundant slot parameter in createKeystore 2024-01-22 13:32:59 +01:00
SomberNight
7007a0c1c9 mnemonic: add type hints 2024-01-22 03:27:17 +00:00
SomberNight
f30d81a98f swapserver plugin: fix doc 2024-01-17 01:15:14 +00:00
Sander van Grieken
d8f579ccfc Consistently use translated strings for UserFacingException raises 2024-01-16 16:25:33 +01:00
Sander van Grieken
3d9996ab8b trustedcoin: disable OTP entry after successful validation 2024-01-16 12:30:24 +01:00
Sander van Grieken
ec81f00896 trustedcoin: cannot reset OTP when seed is not available (online wallet creation continuation) 2024-01-15 17:45:29 +01:00
ThomasV
14ec36dba1 Merge pull request #8741 from accumulator/labels_update
add labels_received callback and update labels even when set for item
2024-01-11 16:05:04 +01:00
ThomasV
df1b9a223c remove qt module from swapserver plugin (unused since a300b8968a) 2024-01-10 17:32:31 +01:00
ThomasV
d6c45113e4 trustedcoin: do not db.write() from daemon thread. fixes #8791 2024-01-09 12:36:09 +01:00
SomberNight
66b8ec1833 trustedcoin: rm some dead code
used by old qt wizard
2024-01-05 15:29:21 +00:00
SomberNight
1d4a5052ef labels plugin: add FIXMEs. don't roll your own crypto...
```
 23.76 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 180
set_label. label='a1'. item='444dffaf758a1b17893cbc8dda4032f9b6e9f61115e7c1a6d486a0950de50c11'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
 28.10 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 181
set_label. label='a1'. item='4812e9844c958a913a71a5a728ea6d73e42d0618f96a4259bad1895b4f427f8e'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
set_label. label='a1'. item='c5daddf7972e16e25c1362d492888a8bbf3d8dcfc789342d71dc83d9a8faaa6c'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
 36.51 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 182
set_label. label='a1'. item='be5973ddf9b6ae6949e544c3cf43a16e2a8719dcf14a1171ec94cfa25d4a3325'. bundle['encryptedLabel']='WzqTZD+cnoQEUrfYsBz0rg=='
 45.68 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 183
set_label. label=''. item='444dffaf758a1b17893cbc8dda4032f9b6e9f61115e7c1a6d486a0950de50c11'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
 55.99 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 184
 58.69 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 185
set_label. label=''. item='4812e9844c958a913a71a5a728ea6d73e42d0618f96a4259bad1895b4f427f8e'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
set_label. label=''. item='c5daddf7972e16e25c1362d492888a8bbf3d8dcfc789342d71dc83d9a8faaa6c'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
 60.98 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 186
set_label. label=''. item='be5973ddf9b6ae6949e544c3cf43a16e2a8719dcf14a1171ec94cfa25d4a3325'. bundle['encryptedLabel']='yErvsmjQUEt4Ry8c55S3Mg=='
 62.80 | I | plugins.labels.qt.Plugin | set test_segwit_2 nonce to 187
```
2023-12-19 01:24:17 +00:00
ThomasV
2d954bb554 payserver plugin: remove support for qt GUI.
(This plugin is not useful without a daemon)

fixes #8748
2023-12-14 11:14:16 +01:00
Sander van Grieken
3a22cb9c48 labels: emit callback when labels received.
write labels regardless if there's already a label set for an ID.
2023-12-12 16:24:13 +01:00
Sander van Grieken
4c8287358a qt, qml: remove email entry from 2FA wallet ToS pages 2023-12-08 12:07:03 +01:00
accumulator
3f742a14b4 Merge pull request #8716 from accumulator/cosigner_pool_proxy
plugins: add proxy aware XMLRPCProxyTransport for xmlrpc.client calls…
2023-12-07 16:54:44 +01:00
xiaolou86
50e5b0efd1 electrum: fix typos 2023-12-04 14:15:39 +08:00
Sander van Grieken
134fe73f1a plugins: add proxy aware XMLRPCProxyTransport for xmlrpc.client calls in cosigner plugin 2023-12-01 14:31:10 +01:00
SomberNight
03778b6e0c add FIXMEs to instances where we don't use the network proxy
so that it at least does not get forgotten

related https://github.com/spesmilo/electrum/issues/4754
2023-11-30 19:31:14 +00:00
SomberNight
262c009c67 pyinstaller build: towards fixing missing "gui/common_qt" folder
pyinstaller tries to import electrum and its different submodules at build-time
during the "Analysis" phase. sys._GUI_QT_VERSION was not getting set there,
and the resulting exception was blocking pyinstaller from discovering that
gui/common_qt is being used.

at runtime:
```
$ ./dist/Electrum.app/Contents/MacOS/run_electrum
  1.53 | E | daemon.Daemon | GUI raised exception: Exception('Error loading trustedcoin plugin: ModuleNotFoundError("No module named \'electrum.gui.common_qt\'")'). shutting down.
  1.53 | E | __main__ | daemon.run_gui errored
Traceback (most recent call last):
  File "electrum/plugin.py", line 135, in load_plugin
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/vagrant/electrum/dist/Electrum.app/Contents/MacOS/electrum/plugins/trustedcoin/qt.py", line 51, in <module>
    from .common_qt import TrustedcoinPluginQObject
  File "/Users/vagrant/electrum/dist/Electrum.app/Contents/MacOS/electrum/plugins/trustedcoin/common_qt.py", line 16, in <module>
    from electrum.gui.common_qt.plugins import PluginQObject
ModuleNotFoundError: No module named 'electrum.gui.common_qt'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run_electrum", line 456, in handle_cmd
    d.run_gui()
  File "electrum/daemon.py", line 617, in run_gui
    self.gui_object = gui.ElectrumGui(config=self.config, daemon=self, plugins=self._plugins)
  File "electrum/util.py", line 473, in do_profile
    o = func(*args, **kw_args)
  File "electrum/gui/qt/__init__.py", line 153, in __init__
    self.plugins.load_plugin('trustedcoin')
  File "electrum/plugin.py", line 138, in load_plugin
    raise Exception(f"Error loading {name} plugin: {repr(e)}") from e
Exception: Error loading trustedcoin plugin: ModuleNotFoundError("No module named 'electrum.gui.common_qt'")
```
2023-11-30 13:43:50 +00:00
SomberNight
9f1b8613d0 swaps: code style clean-up, add type hints, force kwargs
no intended functional changes
2023-11-22 17:50:29 +00:00
ThomasV
fb4eb86e7c submarine swaps: remove support for 'old' normal swaps,
where the user has the preimage.

The CLTV requirements between old and new flow are imcompatible.
With the current locktime value, the server was vulnerable to an
attack where the client does not settle the lightning payment
and claims a refund. In order to support both old and new flows,
one would need to use different locktimes.
2023-11-10 10:35:34 +01:00
Sander van Grieken
be801f30e8 gui: make common_qt compatible with both Qt5 and Qt6 2023-11-07 10:17:10 +01:00
Sander van Grieken
6270eae5c9 qml: port PyQt5 to PyQt6 2023-11-07 10:16:18 +01:00
SomberNight
0273659e6e trustedcoin: fix keystore name (2)
follow-up 56e80c20d7
2023-10-17 14:33:05 +00:00
ThomasV
0a732a0b52 trustedcoin: fix keystore name (follow-up 56e80c20d7) 2023-10-17 10:00:17 +02:00
Sander van Grieken
6222b5ad40 followup 94a6f6cd0e 2023-09-25 16:10:19 +02:00
Sander van Grieken
94a6f6cd0e coldcard: don't raise when get_soft_device_id can't get xpub.
This allows uninitialized coldcards to show up in the device list.
2023-09-25 16:07:18 +02:00
ThomasV
56e80c20d7 wallet_db upgrade: do not use '/' in StoredDict keys 2023-09-23 11:05:36 +02:00
SomberNight
0a3dd8e5e5 keepkey: fix TIM_RECOVER restore method
follow-up 8be3c4dadd
related: https://github.com/spesmilo/electrum/pull/8560#discussion_r1329127300
2023-09-22 16:23:10 +00:00
Sander van Grieken
78fbc27ec0 qt: remove potentially confusing reference to 'install wizard' in trezor, keepkey, safe_t hww settings dialogs 2023-09-22 12:13:21 +02:00
Sander van Grieken
81089a1ef9 wizard: keepkey scope pin lineedit to instance 2023-09-20 14:34:31 +02:00
Sander van Grieken
22d3a5edbb wizard: fix trezor initialisation/recover not setting page valid to True
add auto-proceed to next page after init to trezor, safe_t, keepkey
2023-09-20 14:34:31 +02:00
Sander van Grieken
ec0dbc78c2 wizard: fix assumption 'keystore_type' is present in wizard_data, fix unexpected keystore type msg 2023-09-20 14:34:31 +02:00
SomberNight
1a91da67ea coldcard: factor out manipulate_keystore_dict_during_wizard_setup 2023-09-20 14:34:31 +02:00