Commit Graph

42 Commits

Author SHA1 Message Date
SomberNight 0647a2cf9f transaction.py: rm PartialTxInput.{num_sig, script_type} 2023-03-03 16:40:12 +00:00
SomberNight 1ce37c8bb1 transaction: rm hardcoded sighash magic numbers 2023-02-17 11:40:12 +00:00
SomberNight 01b5e3f8e0 flake8: enable more mandatory tests 2022-10-31 16:13:22 +00:00
SomberNight 79fec3417a crypto.py: rm {En,De}codeAES_base64. instead use {En,De}codeAES_bytes 2022-07-12 15:50:42 +02:00
SomberNight 6c50d3b0a3 hw plugins: (cleanup) rm no-op clear_client argument from keystore.give_error
The keystore does not have a "client" field.
One is supposed to use the "get_client" method instead (the generic API is `plugin.get_client(keystore)`)
Remnants of old code.
2022-05-11 19:30:14 +02:00
SomberNight aab8e664ed hw plugins: (cleanup) Plugin objects should not have a Client field
Clients are per-connected-device, plugins are ~singletons.
These were mostly remnants of old code.
2022-05-11 19:16:18 +02:00
SomberNight 30623c3529 hw plugins: (cleanup) Plugin objects should not have a Handler field
Handlers are per-client (connected device), plugins are ~singletons.
These were mostly remnants of old code.
2022-05-11 19:13:00 +02:00
SomberNight 9599254d43 hw: rm dead code from Hardware_KeyStore subclasses
- force_watching_only is long since unused
- comment was just duplicated from the base class
2022-05-09 20:09:10 +02:00
SomberNight 376fc01b27 keystore.sign_message: add optional script_type argument
this is used by trezor
(and also by bitbox02, which was using a workaround previously)

fixes https://github.com/spesmilo/electrum/issues/7670
2022-02-22 19:20:03 +01:00
SomberNight 5cdb4471ec signmessage: also accept Trezor-type sigs for p2wpkh and p2wpkh-p2sh addrs
The signatures we create are unchanged but we now also accept signatures created by Trezor and others.

see https://github.com/spesmilo/electrum/issues/3861
2022-02-16 19:25:46 +01:00
ghost43 21c3572600 hardware devices: run all device communication on dedicated thread (#6561)
hidapi/libusb etc are not thread-safe.

related: #6554
2020-09-08 15:52:53 +00:00
SomberNight 2cfa3bd6c8 hww hidapi usage: try to mitigate some thread-safety issues
related: #6097
2020-04-17 19:53:39 +02:00
SomberNight 98d2ab5bd6 hww: fix HardwareClientBase not having reference to plugin
it was incorrectly documented that it did (previously only for some plugins)
2020-04-17 19:53:35 +02:00
SomberNight e830ef309f hww: factor out part of hid scan code to HW_PluginBase
so that bitbox02 can override it
2020-04-12 15:34:19 +02:00
SomberNight 4b1d835304 wizard hww: scan devices fewer times and move away from GUI thread 2020-04-09 19:45:31 +02:00
SomberNight bf067f7558 HardwareClientBase: provide default implementation for label
and add warning about placeholders
2020-04-08 18:28:21 +02:00
SomberNight 4ef313a1ac hww: smarter auto-selection of which device to pair with
scenario1:
- 2of2 multisig wallet with trezor1 and trezor2 keystores
- only trezor2 connected
- previously we would pair first keystore with connected device and then display error.
  now we will pair the device with the correct keystore on the first try

scenario2:
- standard wallet with trezor1 keystore
- trezor2 connected (different device)
- previously we would pair trezor2 with the keystore and then display error.
  now we will prompt the user to select which device to pair with (out of one)

related: #5789
2020-04-08 17:53:33 +02:00
SomberNight 371f55a0f9 hww: fix some threading issues in wizard
fixes #3377
related: #6064  (passphrase dialog not rendered correctly)
2020-04-01 21:09:17 +02:00
SomberNight 81fc3fcce2 hww: rm some code duplication: add "scan_and_create_client_for_device" 2020-04-01 21:09:14 +02:00
SomberNight 276631fab7 digitalbitbox: (trivial) user handler instead of handler.win 2020-04-01 21:09:03 +02:00
SomberNight 7f1c7955dc DeviceMgr: clean-up locks a bit 2020-04-01 21:09:00 +02:00
SomberNight d2f132738a wallet: only select mature coins by default
this is a regression from #5721

Removed the `TxInput.is_coinbase` method as I think it is a confusing API,
instead we now have `TxInput.is_coinbase_input` and `TxInput.is_coinbase_output`.

related #5872
2020-01-02 00:43:49 +01:00
SomberNight c2b0039935 bitcoin.py: remove some remnants of TYPE_ADDRESS, TYPE_SCRIPT 2019-11-21 18:51:38 +01:00
SomberNight f8c84fbb1e hardware wallets: create base class for HW Clients. add some type hints 2019-11-11 17:04:12 +01:00
SomberNight dd14a3fde5 psbt: follow-ups: fix digital bitbox 2019-11-05 22:06:46 +01:00
SomberNight bafe8a2fff integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
TheCharlatan e7079f1bea Digital BitBox: Fix sending to self
Make sure that a pubkey is only appended to the checkpub array if it
corresponds to a change address. Signing will fail otherwise, if a
non-change pubkey is sent as part of the checkpub list to the Digital
BitBox.
2019-09-09 15:07:51 +02:00
SomberNight 3385a94753 logging: basics 2019-05-02 15:19:03 +02:00
SomberNight 85a7aa291e bip32: refactor whole module. clean-up. 2019-02-22 18:50:24 +01:00
benma 6c20340338 bitbox: fix seed command (#4906)
Entropy required to be 64 bytes.
2018-12-08 17:02:24 +01:00
Janus e1f4865844 digitalbitbox, trustedcoin: proxied http client
use common cross-thread HTTP method, which is put in network.py,
since that is where the proxy is. TrustedCoin tested successfully,
but DigitalBitbox can't be tested completely due to #4903

before this commit, digitalbitbox would not use any proxying
2018-12-07 19:19:40 +01:00
Janus 0169ec880c digitalbitbox: make constant strings 2018-12-07 19:18:33 +01:00
Janus 9a3f2e8fcc digitalbitbox: fix stretch_key bytes/str confusion 2018-12-07 18:41:40 +01:00
Marko Bencun 92a9cda4fc plugins/digitalbitbox: compatibility with firmware v5.0.0 2018-12-03 22:11:36 +01:00
SomberNight 48b0de7871 keystore: stronger pbkdf for encryption 2018-11-10 16:36:41 +01:00
SomberNight bd32b88f62 introduce UserFacingException
we should not raise generic Exception when wanting to communicate with
the user. it makes distinguishing programming errors and messages hard,
as the caller will necessarily need to catch all Exceptions then
2018-11-08 19:46:15 +01:00
SomberNight 082a83dd85 rename crypto.Hash to sha256d 2018-10-25 22:28:24 +02:00
SomberNight a88a2dea82 split bip32 from bitcoin.py 2018-10-25 22:20:33 +02:00
SomberNight 5f3408dd70 transaction.py: introduce TxOutputHwInfo namedtuple 2018-08-14 19:15:15 +02:00
SomberNight 2eb72d496f transaction: introduce TxOutput namedtuple 2018-08-01 19:10:08 +02:00
Janus 1e715113ab remove pbkdf2 dependency, use stdlib instead 2018-07-18 14:34:59 +02:00
Janus 097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00