Commit Graph

449 Commits

Author SHA1 Message Date
Peter D. Gray
3d86374905
Coldcard v2.10 and above does multisig 2019-06-17 12:40:23 -04:00
Andrew Chow
9b722055c4
Merge #183: Officially support Trezor T and tests for it
84315dd Build and test with Trezor T emulator (Andrew Chow)
ef81662 Switch to Trezor monorepo (Andrew Chow)
6952edd Introduce full_type in tests for distinguishing between device models (Andrew Chow)
9484803 Update Trezor T support (Andrew Chow)

Pull request description:

  Fills out the table in the README with the rest of the Trezor T support.

  Changes the Trezor emulator stuff to use their new monorepo. Also adds Trezor T tests.

  Built on #157

ACKs for commit 84315d:

Tree-SHA512: f4f19574d4f7b177dc98e5770017c7801fec35f481d1b50cc5ec8bf95ce483327c47626d824cea372c28ebd807c19adb412aec58d0a016643ab5366bb0eb528e
2019-06-16 13:42:09 -04:00
Andrew Chow
84315dd5de Build and test with Trezor T emulator 2019-06-16 13:02:32 -04:00
Andrew Chow
ef816628e1 Switch to Trezor monorepo 2019-06-16 10:45:08 -04:00
Andrew Chow
6952edd879 Introduce full_type in tests for distinguishing between device models 2019-06-16 10:45:08 -04:00
Andrew Chow
9484803b71 Update Trezor T support 2019-06-16 10:45:08 -04:00
Andrew Chow
d8cf9f120b
Merge #157: Indicate in enumerate whether a device needs a passphrase or a pin
4d21f29 ignore other devices when checking that the coldcard has started (Andrew Chow)
54e14ba Change the order devices are tested in (Andrew Chow)
1c33312 Test need_passphrase_sent and need_pin_sent (Andrew Chow)
bca8535 Add needs_pin_sent to indicate whether promptpin needs to be used (Andrew Chow)
d2696cf Add needs_passphrase_sent to enumerate output (Andrew Chow)

Pull request description:

  This adds two fields to `numerate`: `needs_passphrase_sent` and `needs_pin_sent` which indicate whether a command with a `-p` option is needed or `promptpin` and `sendpin` need to be done. These fields will be true in the instances that a passphrase needs to be sent and have not been cached by the device. To avoid a chicken and egg problem with fingerprints on Trezors, if the device needs a passphrase but one was not specified in `enumerate`, the fingerprint won't be retrieved in order to not contaminate the passphrase cache on device.

  Built on #152 because it has some interactions with it that needed to be addressed.

ACKs for commit 4d21f2:

Tree-SHA512: 4164a8e541a9441b615205b84561966dd2f199f5f5e738cc55f12c60866483e458f3a5c05ac22c69baf862c37f6beeb3ca78f01c7b63770b9440f47a56811173
2019-06-16 10:44:09 -04:00
Andrew Chow
4d21f29127 ignore other devices when checking that the coldcard has started 2019-05-30 18:44:18 -04:00
Andrew Chow
54e14ba301 Change the order devices are tested in
Test the digitalbitbox first because it will self wipe if the wrong
password is given too many times (by other tests) which causes test
to fail.

Then, group up tests by simulator, those with simulators started at
the beginning (dbb and coldcard) go first. Then those with simulators
started for each test (trezor and keepkey). Lastly the test that
requires a physical device.
2019-05-30 18:44:18 -04:00
Andrew Chow
1c33312bb1 Test need_passphrase_sent and need_pin_sent 2019-05-30 18:44:18 -04:00
Andrew Chow
bca85354f9 Add needs_pin_sent to indicate whether promptpin needs to be used 2019-05-30 18:44:18 -04:00
Andrew Chow
d2696cfadf Add needs_passphrase_sent to enumerate output 2019-05-30 18:44:17 -04:00
Andrew Chow
a4a3aff89b
Merge #169: Add installudevrules command for linux
cada7f5 Add installudevrules command for linux (lontivero)

Pull request description:

  This PR is for discussing the concept and the implementation. The idea is to make it easier for Linux users to install the udev rules in their systems by running:

  ```
  $ hwi installudevrules
  ```

ACKs for commit cada7f:
  achow101:
    ACK cada7f5ce0

Tree-SHA512: 54a11b9bbbf8f4258a32a8503694026fda6adfe301bc3f44ed85c155426b894d512698046f14d9b62600d80614f2a6bd28d1d77ff0cfd2859c0f0786bc4013d6
2019-05-28 15:31:52 -04:00
lontivero
cada7f5ce0 Add installudevrules command for linux 2019-05-28 15:43:54 -03:00
Andrew Chow
64153a8a65
Merge #182: Fix displayaddress with descriptors and its tests
54bd668 Actually test that displayaddress is returning correct output (Andrew Chow)
0974f69 Ensure the client's fingerprint is available for descriptor displayaddress (Andrew Chow)
cea784e tests: Replace remaining process_commands with self.do_command in tests (Andrew Chow)
70e31ca tests: Properly escape arguments for cli interface (Andrew Chow)

Pull request description:

  `displayaddress` with descriptors wasn't working correctly nor was it being tested correctly. Fixed it and the tests.

ACKs for commit 54bd66:

Tree-SHA512: 84d27925a0bdb26e6ab844ded23e08d7b5f3e2aa78964d324c9223c04aaa26252a1e60e556696937b90518072fd62765fb38a15bc5f54600f837e4867cf1b148
2019-05-28 14:29:04 -04:00
Andrew Chow
1fb5eb42c7
Merge #181: Provide error codes in enumerate output
129e91d Provide error codes in enumerate output (Andrew Chow)

Pull request description:

  Adds error codes to `enumerate`'s output as suggested here: https://github.com/bitcoin-core/HWI/pull/175#discussion_r286126395

ACKs for commit 129e91:

Tree-SHA512: ba82b5a9764dd56c2872dd4b71f9bef60b7eb41437fc02099191f8dd92dfbd078a8d73aa279ae42ff5f351ac3c168bd0a429d4737695aec35f2c9f6a30102b5c
2019-05-28 14:27:37 -04:00
Andrew Chow
54bd6687cc Actually test that displayaddress is returning correct output 2019-05-21 19:34:15 -04:00
Andrew Chow
0974f6944c Ensure the client's fingerprint is available for descriptor displayaddress 2019-05-21 19:33:45 -04:00
Andrew Chow
cea784ef60 tests: Replace remaining process_commands with self.do_command in tests 2019-05-21 19:09:18 -04:00
Andrew Chow
70e31cad0c tests: Properly escape arguments for cli interface 2019-05-21 19:09:10 -04:00
Andrew Chow
129e91d9f0 Provide error codes in enumerate output 2019-05-21 17:19:56 -04:00
Andrew Chow
c14896c6eb
Merge #152: Keep Trezor sessions open unless state becomes inconsistent
d00ae56 Don't send Initialize when first connecting to a Trezor (Andrew Chow)

Pull request description:

  When the client is opened, we would send an `Initialize` message. However because a client may end up being opened many times in the process of executing one command, the saved state (in particular cached passphrases) would be lost each time the client is opened due to `Initialize` being sent. In order to have it keep that state, we don't want to send `Initialize` every time. Instead we will send `GetFeatures` which does the other part of what `Initialize` does (get the features for the device). `GetFeatures` failing would indicate that the state is inconsistent (which can be caused by command abort, exceptions, etc.), so in that case, `Initialize` is sent to clear the inconsistent state.

  I tested this using the Trezor T emulator and the password prompt does not appear multiple times per command. Additionally the password prompt does not appear for every command.

  Fixes #151

ACKs for commit d00ae5:

Tree-SHA512: 76bde488bf9a486267cc0c84668db79e9f1706f10f4d12d093829bcf1a5f713a7aec9da3eae674b152071d3d5c7219c163fe01465dea9e02f1e56298d318058a
2019-05-03 16:45:39 -04:00
Andrew Chow
6275418c90
Merge #166: Have setup_environment.sh remove emulator.img files for trezor and keepkey
6735983 Have setup_environment.sh remove emulator.img files for trezor and keepkey (Andrew Chow)

Pull request description:

  This makes travis stop hanging when it gets to the keepkey tests.

ACKs for commit 673598:

Tree-SHA512: 1eb37e4114e35a5636c69d9d0ba57a808d471f8675f1f02823bcb25aa1a6775d52bf4e5ab5fa12934fc79db8a82c4bfe589ccb0dddddf7b7761ee4a0e454c86a
2019-04-30 21:39:50 -04:00
Andrew Chow
67359835eb Have setup_environment.sh remove emulator.img files for trezor and keepkey 2019-04-30 19:29:15 -04:00
Andrew Chow
57a06836b9
Merge #163: commands.py: use fingerprint if already captured by client
0cf6bb9 commands.py: use fingerprint if already captured by client (Peter D. Gray)

Pull request description:

  For me with a `signmessage` to the Coldcard simulator, this saves 6-7 seconds. But this should speed up all devices, since they are already capturing the fingerprint value into the enumeration information.

ACKs for commit 0cf6bb:
  achow101:
    ACK 0cf6bb9998

Tree-SHA512: db2bb8eed855b70e8f1ee68c4eaf59eae191732246525669f9e600c10bee0dca1108685f1f508c24232151a792b8178d11bf80eee8cf880f0442e5f69dd81f56
2019-04-30 19:20:55 -04:00
Andrew Chow
c3f2521855
Merge #162: devices/coldcard.py: accelerate enumeration process
0c831e4 devices/coldcard.py: accelerate enum process by using fingerprint value revealed during connection setup (Peter D. Gray)

Pull request description:

  ... by using fingerprint value revealed during connection setup.

  For my system, with one Coldcard and CC simulator connected, this change saves six seconds.

ACKs for commit 0c831e:
  achow101:
    ACK 0c831e4f75

Tree-SHA512: d309dcc4730c54a47fc32329fed6adb9e6abe93e9068765874d32f6155d4e946359537a945afdc11f4fbcab692e0b8c29cd1e78d73c52d47ce21521d781970f4
2019-04-30 19:20:10 -04:00
Andrew Chow
d0c561e516
Merge #164: pin poetry version to 0.12.12 as 0.12.14 is broken
85eaf70 pin poetry version to 0.12.12 as 0.12.14 is broken (Andrew Chow)

Pull request description:

  The latest version of poetry (0.12.14) is broken which is causing travis to fail. Pin the version to 0.12.13 for now.

ACKs for commit 85eaf7:

Tree-SHA512: 9d024ddc52f688c8ec24018201113273a089ee36afb2f2b2c959cada5b982db61365222afc9f934657bdbc862401ab000ae59e4bf4f354121a7d8f22a0001a0c
2019-04-30 15:50:32 -04:00
Andrew Chow
85eaf70f36 pin poetry version to 0.12.12 as 0.12.14 is broken 2019-04-30 14:09:23 -04:00
Andrew Chow
4dd56fda3c
Merge #165: Add packages to pyproject.toml to allow generating a working setup.py
ae9bca3 Add packages to pyproject.toml to allow generating a working setup.py (Jonas Nick)

Pull request description:

  Fix of #159. Now setup.py was generated with `contrib/generate_setup.sh` after adding `hwi.py` and `hwilib` explicitly to `pyproject.toml`. This allows installing with `setup.py`.

ACKs for commit ae9bca:
  achow101:
    ACK ae9bca3ae3

Tree-SHA512: f31d2b81292d7fa324806ab4ff588f678e6d58dea37d209e423a20522c97a1a9dfeb18db8d02840f46aafc18b2533b8eef3913fd86dee5ef31db7e1b02e936ee
2019-04-29 15:58:06 -04:00
Jonas Nick
ae9bca3ae3 Add packages to pyproject.toml to allow generating a working setup.py 2019-04-29 19:47:46 +00:00
Andrew Chow
7201300e92
Merge #161: Mention in Ledger doc that Bitcoin App needs to be running
90f5e32 Mention in Ledger doc that Bitcoin App needs to be running (Jonas Nick)

Pull request description:

ACKs for commit 90f5e3:
  achow101:
    ACK 90f5e32cc3

Tree-SHA512: 051d3e29f3e0d4e2e0ae4273d77fcd20e4adab66da5227438c6fd9972b6f1f0288d49c23dbf4d2efd51155c8bfdfa180dd8fee6fe3d04883ec39e4d09224a345
2019-04-29 13:15:44 -04:00
Andrew Chow
892b552bb3
Merge #160: Fix keypool refill instructions in docs
483b589 Fix keypool refill instructions in docs (Jonas Nick)

Pull request description:

  The current instructions both give the same results, so I presume the first should be non-internal.

ACKs for commit 483b58:
  achow101:
    ACK 483b589eeb

Tree-SHA512: 0c01de587c86e7b1df3e8781f83dab8f906ed0f89864f33f83992e0f724ceb3216e4aeee21a1d00c1ef74021c4975b823b0f20fe13b6ef7c0c6c2b61da5f9d8d
2019-04-29 13:15:07 -04:00
Peter D. Gray
0cf6bb9998
commands.py: use fingerprint if already captured by client 2019-04-29 10:54:19 -04:00
Peter D. Gray
0c831e4f75
devices/coldcard.py: accelerate enum process by using fingerprint value revealed during connection setup 2019-04-29 10:32:58 -04:00
Jonas Nick
90f5e32cc3 Mention in Ledger doc that Bitcoin App needs to be running 2019-04-29 09:21:59 +00:00
Jonas Nick
483b589eeb Fix keypool refill instructions in docs 2019-04-29 09:02:50 +00:00
Andrew Chow
c628206d31
Merge #154: Make versioned compressed packages for releases
cb2ed16 Build Windows binary in travis as well (Andrew Chow)
a86323d Make versioned compressed packages for releases (Andrew Chow)

Pull request description:

  The current build scripts produce binary files named `hwi` and `hwi.exe` which is both unversioned and conflicting for the Linux and MacOS binaries. For the 1.0.0 binaries, I had compressed these and named them myself before uploading. This PR changes the build scripts to compress and name the packages too. Additionally the names will include the version number which I forgot to do for 1.0.0.

ACKs for commit cb2ed1:

Tree-SHA512: 07a167f45ce3652c347350574c2dd0d2d7f39724665aa6b4ebb2b41212bf2526ff21fe36b732cb01890ff051e35d57dc91fa4220ec22f5395a02f3c9ed6bf266
2019-04-21 19:16:22 -04:00
Andrew Chow
cb2ed1654c Build Windows binary in travis as well 2019-04-21 18:18:50 -04:00
Andrew Chow
a86323d419 Make versioned compressed packages for releases 2019-04-21 18:18:50 -04:00
Andrew Chow
b5d74ec24c
Merge #153: Include Windows UCRT in Windows build
f109365 Install Windoew Universal C++ Runtime from Windows 10 SDK in Windows build (Andrew Chow)

Pull request description:

  Older versions of Windows needs to have the Windows Universal C++ Runtime packaged with the binary to work. This PR adds to the `build_wine.sh` build script to download the DLLs for the UCRT and package them with the Windows build.

  Fixes #150

ACKs for commit f10936:

Tree-SHA512: 7b9b98cdc4e329cf228dc42a09aa434f984c4db90b09b2ca6cb3dd7d8c1957cd717f761e8a1eeadbd8662f74452141a4df583ab40d939c57e20f0b0f83625b47
2019-04-21 18:08:02 -04:00
Andrew Chow
30146a26b8
Merge #156: Add Trezor Model T
95bd88e Add Trezor Model T (nopara73)

Pull request description:

  # Notes

  - I marked with `?` the functions I did not test myself.
  - I can make a PR in a way that I add Trezor Model T to the last row so the diff would be easier to see if you prefer.

ACKs for commit 95bd88:
  achow101:
    ACK 95bd88e41d

Tree-SHA512: fb2934f3a0cbc0ce4f473945be1f457f0e0a6fea17bdd6d89b8d375a249d251a68188de3d20a00a4954daa819734ebb3aad871e2b0aeb3ac231fc200cdba5eff
2019-04-21 18:05:45 -04:00
Andrew Chow
bfc29c26a5
Merge #155: Fix last command format at examples.md
9e82690 Fix last command format at `examples.md` (Roman Zeyde)

Pull request description:

ACKs for commit 9e8269:
  achow101:
    ACK 9e826909cf

Tree-SHA512: 55b039d8f4ad5205b83e92e6a2c36c9688055ed7083c6de75479a3e712b77087a82a1f8f6d5ee1d299fdd1c5d012ef368f4d741e52eca18a6119ea1d99b78bff
2019-04-21 18:04:35 -04:00
nopara73
95bd88e41d
Add Trezor Model T 2019-04-21 22:20:19 +02:00
Roman Zeyde
9e826909cf
Fix last command format at examples.md 2019-04-20 20:38:16 +03:00
Andrew Chow
f109365047 Install Windoew Universal C++ Runtime from Windows 10 SDK in Windows build
Download and extract the Universal C++ Runtime from the Windows 10 SDK
and copy the DLLs to C:\Windows\System32 when doing Windows build.
This will make sure that the proper DLLs are included in the Windows
binary so that it works on older Windows.
2019-04-19 22:37:49 -04:00
Andrew Chow
d00ae56eef Don't send Initialize when first connecting to a Trezor
Instead of sending Initialize, don't. This lets it stay in the
same "session" as previous commands so some state such as passphrases
are still cached by the device.

If GetFeatures fails, then try sending Initialize so that any
inconsistent state on the device is cleared.
2019-04-18 17:30:51 -04:00
Andrew Chow
6e92b7d40f
Merge #147: Add udev rules for all supported devices
397993b [ci skip] Document udev rules (Andrew Chow)
1222d9a Add udev rules for all supported devices (Andrew Chow)

Pull request description:

  It's useful to have all of the udev rules needed for all devices in one location instead of having to go to every vendor's webpage to find these.

  Original sources:
  `20-hw1.rules` (Ledger): https://github.com/LedgerHQ/udev-rules/blob/master/20-hw1.rules
  `51-coinkite.rules` (Coldcard): https://github.com/Coldcard/ckcc-protocol/blob/master/51-coinkite.rules
  `51-hid-digitalbitbox.rules`, `52-hid-digitalbitbox.rules` (Digital Bitbox): https://shiftcrypto.ch/start_linux
  `51-trezor.rules` (Trezor): https://github.com/trezor/trezor-common/blob/master/udev/51-trezor.rules
  `51-usb-keepkey.rules` (Keepkey): https://github.com/keepkey/udev-rules/blob/master/51-usb-keepkey.rules

ACKs for commit 397993:

Tree-SHA512: c2dbe4dcff6e54ecb71724faeacc1aaca06b5a90dbc22289694ff40e0af30c756f42af8e52208c155d9fef54b099ac51679d9f9cbc0f0de1384ce47e39c00b3c
2019-04-16 14:32:43 -04:00
Andrew Chow
397993bfdc [ci skip] Document udev rules 2019-04-16 14:30:36 -04:00
Andrew Chow
f94913739e
Merge #146: Import HID in Ledger driver
d065307 Import HID in Ledger driver (Andrew Chow)

Pull request description:

  Apparently this is needed, especially for newly setup environments.

  Fixes #143

ACKs for commit d06530:

Tree-SHA512: 4434f947a1cf1191445ffb5c51ebb00d221fd05f64b48b6cb403feeca378bfcd59f81e414b90b16552cf1af1df452603e54aa2e90f01c741ac3c376d96d7a47e
2019-04-16 14:18:36 -04:00
Andrew Chow
4814a293e8
Merge #142: Document how to handle binary format files from command line with bas…
f096c18 Document how to handle binary format files from command line with bash example (Gregory Sanders)

Pull request description:

  …h example

  Since these are quite standard utilities, we may want to take the unix philosophy and let other utils take care of these common conversions.

ACKs for commit f096c1:
  achow101:
    ACK f096c18478

Tree-SHA512: ee04a1e4e7f4106f7afcb5130cd8bb8fb1446a79b8babaf14c7aed4b753699b29ed8dfca057928289848f562b24663850377eccbbef27ba9c60f011a901cdc5a
2019-04-15 20:29:24 -04:00