1
0
Commit Graph

17543 Commits

Author SHA1 Message Date
ThomasV
f7d0ac27a6 new wizard: set keystore password. fixes #9147 2024-10-14 15:17:24 +00:00
Darsey Litzenberger
d20e01b604 trezor: Fix for trezor library version 0.13.9
This enables support for the Trezor Safe 5.
2024-10-14 15:16:21 +00:00
SomberNight
ebfc701b97 qt gui: clean-up efilter when exiting
related: https://github.com/spesmilo/electrum/issues/6889#issuecomment-2184052577
2024-10-14 15:15:49 +00:00
SomberNight
9d6c818283 trustedcoin: Wallet_2fa.make_unsigned_transaction to use **kwargs
We often forget updating the method signature of Wallet_2fa.make_unsigned_transaction
when changing Abstract_Wallet.make_unsigned_transaction.
2024-10-14 15:14:50 +00:00
SomberNight
c42cbd0577 trustedcoin: sanitize error messages coming from 2fa server
related https://github.com/spesmilo/electrum/issues/9096
2024-10-14 15:14:30 +00:00
SomberNight
546d570ca2 util.error_text_str_to_safe_str: truncate long errors
The messages are sometimes logged and sometimes shown to the user,
- for logging we might not want to truncate or have higher limits,
- but when shown to the user, we definitely want to truncate the error text.
It is simplest to just do the truncation here, at the lowest level.

Note that we usually prepend the error text with a header e.g. "[DO NOT TRUST THIS MESSAGE]"
and if the error text is too long, this header at the beginning might get "lost" in some way.
Hence we should truncate the error text.
2024-10-14 15:13:01 +00:00
SomberNight
73d667f986 trustedcoin: rm dead code 2024-10-14 15:12:29 +00:00
SomberNight
178f139543 mnemonic: make_seed: add sanity-check
When going through the wizard, this case would previously have errored later in the flow. (for '2fa' at least)
2024-10-14 15:11:57 +00:00
SomberNight
cb4539c73f mnemonic: rename seed_type() fn
Some functions have an argument named "seed_type" in which it was annoying to call the seed_type() fn.
(especially for functions inside the same module)
2024-10-14 15:11:43 +00:00
SomberNight
d6006b0942 soothe flake8
```
./tests/test_mnemonic.py:249:9: B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
        with self.assertRaises(Exception):
        ^
1     B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
```
2024-10-14 15:10:17 +00:00
SomberNight
8def0bd6c2 wizard: fix regression: allow passphrase for some '2fa' seeds
fixes https://github.com/spesmilo/electrum/issues/9088
2024-10-14 15:08:07 +00:00
SomberNight
abea2bb268 tests: wallet_vertical: re pre-2.7 "2fa" seeds, test both 24 and 25 len 2024-10-14 15:07:33 +00:00
SomberNight
7fae4649c6 interface: nicer error for CA-signed "Hostname mismatch" certs
Previously when encountering a CA-signed cert that failed verification with "Hostname mismatch",
we would
1. erroneously mark it as self-signed
2. save its cert to pin it
3. when connecting to it later, and being served a CA-signed cert, we would reject the connection
  - I think this is because we use the saved cert (the peer cert, just the last cert in the chain) as if it was a root CA,
    and then during the connection we try to verify against that root. This fails as we are served a different root then.
Error logged in step(3):
```
  3.85 | W | i/interface.[wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion:50002] | Cannot connect to main server due to SSL error (maybe cert changed compared to "/home/user/.electrum/testnet/certs/wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion"). Exc: ConnectError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))
```

This commit fixes step(1), we won't mark the cert as self-signed, instead the error is propagated out and the connection closed.
```
 35.05 | I | i/interface.[wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion'. (_ssl.c:1007)")))
```

Compare:
- SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion'. (_ssl.c:1007)")
  - verify_code=62
- SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1007)')
  - verify_code=18

Note: the verify_code constants look stable, though they might be openssl-specific. I guess that's ok(?)
140540189c/include/openssl/x509_vfy.h.in (L224)
2024-10-14 15:06:13 +00:00
ThomasV
9ee998c3be maybe_cleanup_forwarding: fix crash if payment_key not in self.received_mpp_htlcs 2024-10-14 15:02:35 +00:00
SomberNight
7e29214219 daemon error-handling: fix traceback.format_exception() on old python
The new API for traceback.format_exception was only added in python 3.10 (91e93794d5).
2024-10-14 15:00:10 +00:00
SomberNight
559184dc09 network: (trivial) simplify send_http_on_proxy 2024-10-14 14:58:49 +00:00
SomberNight
78050fb999 lnurl: better error messages
re https://github.com/spesmilo/electrum/issues/9078
2024-10-14 14:57:57 +00:00
Sander van Grieken
0d46e20ed3 typo 2024-10-14 12:35:06 +02:00
Sander van Grieken
37d63f5017 update release notes 2024-10-14 12:34:17 +02:00
Sander van Grieken
c93928e642 trustedcoin: fix continuation of 2fa wallet file with keystore-only encryption 2024-10-14 12:21:29 +02:00
Sander van Grieken
1c2c016f55 coldcard: small fixes 2024-10-14 12:20:19 +02:00
avirgovi
0bdfcb600a coldcard: rebase #7682 and fix CC bugs 2024-10-14 12:19:59 +02:00
Sander van Grieken
a68d9b8489 qml: styling Pin dialog, fix size glitching 2024-10-10 09:10:55 +02:00
Sander van Grieken
f7896ddd3c qt: new_channel_dialog: unfreeze amount when pressing Min while Max is checked 2024-10-10 09:09:53 +02:00
Sander van Grieken
2c624df72c openalias: only consider TXT records, as DNS can return other records we did not ask for. 2024-10-10 09:09:41 +02:00
Sander van Grieken
e14148f347 payment_identifier: regard BIP21 without address and without bolt11 invalid 2024-10-10 09:09:33 +02:00
Sander van Grieken
5a8cc85df8 qml: add seed passphrase property to QEWallet, show in WalletDetails 2024-10-08 10:02:47 +02:00
Sander van Grieken
4dc64e4cf9 qt: fix scanning multi (privkeys, addresses) from QR. 2024-10-08 10:02:22 +02:00
Sander van Grieken
e638a832e4 qml: styling HelpDialog 2024-10-08 10:02:07 +02:00
Sander van Grieken
608f9db766 update RELEASE-NOTES 2024-09-14 12:42:57 +02:00
Sander van Grieken
363cf001f5 qml: fix handling of channel backup import on lightning-disabled wallets 2024-09-14 12:24:32 +02:00
SomberNight
babf108ee4 qml: "wallet_else_pin" auth should only use the wallet pw if is unified
related https://github.com/spesmilo/electrum/pull/9074
2024-09-14 12:14:46 +02:00
SomberNight
c319a842ad fix typo
note: "everytime" even appears in the old_mnemonic wordlist, but it is a misspelling.
2024-09-14 12:14:23 +02:00
Sander van Grieken
6e84266367 qml: don't unbind/unregister the ActivityResultListener from within the ActivityResultListener handler func.
instead, schedule a queued finished signal to unregister the listener after the handler has finished.
See PythonActivity.java in P4A for why this probably causes the most often occurring crash we see on the Play Store:

```
Exception java.lang.RuntimeException:
  at android.app.ActivityThread.deliverResults (ActivityThread.java:5164)
  at android.app.ActivityThread.handleSendResult (ActivityThread.java:5205)
  at android.app.servertransaction.ActivityResultItem.execute (ActivityResultItem.java:51)
  at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:135)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:95)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2136)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:8061)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:656)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
Caused by java.util.ConcurrentModificationException:
  at java.util.ArrayList$Itr.next (ArrayList.java:860)
  at org.kivy.android.PythonActivity.onActivityResult (PythonActivity.java:218)
  at android.app.Activity.dispatchActivityResult (Activity.java:8501)
  at android.app.ActivityThread.deliverResults (ActivityThread.java:5157)
```
2024-09-14 12:14:08 +02:00
ThomasV
c7988b5c0e wallet_db: show electrum version in error dialog 2024-09-14 12:13:58 +02:00
Sander van Grieken
e525168d80 qml: don't rely on wallet when deactivating PIN and no wallet loaded (fixes #8366) 2024-09-14 12:13:27 +02:00
SomberNight
9b7cb0e264 bip21: trivial follow-up
follow-up bb4ee2b50b
2024-09-14 12:13:20 +02:00
SomberNight
4be192b317 release.sh: print warning on unexpected arg value
I keep mixing up sombernight and sombernight_releasekey.
2024-09-14 12:13:10 +02:00
Sander van Grieken
7263a49129 followup 4159ceee35 4.5.5 2024-05-29 15:14:46 +00:00
Sander van Grieken
1e18e532de qt: fix ReceiveWidget layout (fixes #9049) 2024-05-29 15:14:36 +00:00
SomberNight
bae2c8d802 update locale 2024-05-29 14:58:28 +00:00
SomberNight
f6702a7800 update block header checkpoints 2024-05-29 14:50:25 +00:00
SomberNight
1f652cf3e8 prepare release 4.5.5 2024-05-29 14:49:36 +00:00
SomberNight
3fbd8df7df bump libsecp256k1 version (0.4.1->0.5.0) 2024-05-29 14:49:32 +00:00
SomberNight
7f7a7857b2 Revert "qt: fix ReceiveWidget layout (fixes #9049)"
This reverts commit 21ffe32157.

This layout is difficult to get right. Both the old and the new layout are somewhat buggy.
Reverting this only on the 4.5.x release branch. We can improve it on master.
The old layout has been out there in releases for many months, so it is safer to just use
that in the release branch for now.
2024-05-29 14:38:36 +00:00
Sander van Grieken
21ffe32157 qt: fix ReceiveWidget layout (fixes #9049) 2024-05-29 15:35:32 +02:00
Sander van Grieken
8e240f4de7 bip21: add testcases for amount bounds 2024-05-29 15:35:26 +02:00
Sander van Grieken
bac49910e9 bip21: consider amount=0 in bip21 uri invalid 2024-05-29 15:35:22 +02:00
SomberNight
fec11d141c qt wizard: fix offline 2fa wallet creation in some cases
fixes https://github.com/spesmilo/electrum/issues/9037
2024-05-28 15:41:04 +00:00
SomberNight
632859866b qml wizard: even stricter validation for new wallet name
related: 07dc80dd9a
2024-05-28 15:40:45 +00:00