7b9c137 Fix der serialization bug (Andrew Chow)
de4ff1e Update digital bitbox encryption scheme for firmware v5 (Andrew Chow)
Pull request description:
Firmvware v5.0.0 changed how messages are encrypted and authenticated, so update the encryption methodolgy to handle that.
The changes come from https://github.com/digitalbitbox/mcu/blob/master/py/dbb_utils.py with some minor changes to accommodate older firmware versions.
A bug in DER serialization which is only used by the bitbox is also fixed here.
Tree-SHA512: 01063f76dd132a8ad6938def01196e122b0eec7df63aaa5d688f6618b56294ec192607bbff5e385a9a8edf9fd2576293886aeb7b2efbe417e56558be3e8e11f3
b404a50 Include the device type in test case output (Andrew Chow)
a0fa208 Show full test case names in output (Andrew Chow)
Pull request description:
Increases the verbosity level of the test runner to 2 which outputs the `str()` representation of each test case. This includes the test name by default. This has been modified to also print out the device types for the tests in `test_devices.py`. This will allow us to be able to see what tests each device is passing so debugging is easier.
Tree-SHA512: bf454b98b6d8d5701bd51ea8eaace95891e02d2765df4ea016f854e7d9b4f8e9b56e44c7988b38a521bb72f07ac3f26145698de70b974d6a6bcda667b74c8899
8ddf434 Refactor tests to optionally have emulator start and stop for each test (Andrew Chow)
a3f31aa Add keepkey automated test (Andrew Chow)
b7f5288 Use DebugLink for Keepkey UDPTransport (Andrew Chow)
8d53b7d Build keepkey emulator in setup_environment (Andrew Chow)
113bbe9 Enumerate the keepkey emulator (Andrew Chow)
50e72ad Update documentation for keepkey (Andrew Chow)
6857593 Implement multisig input signing and fixes to signtx for keepkey (Andrew Chow)
9d6949d Implement displayaddress for keepkey (Andrew Chow)
80873f9 Implement signmessage for keepkey (Andrew Chow)
bf67fc6 Use keepkey 6.0.1 from keepkey/python-keepkey repo (Andrew Chow)
Pull request description:
Implements the signmessage, displayaddress, and signtx commands for the keepkey. This also completes its implementation and the documentation is updated as such.
Note that because the Keepkey is a clone of the Trezor, these implementations are copies of the Trezor ones modified slightly to work with the Keepkey library.
This also adds an automated test for the KeepKey using the KeepKey simulator.
Tree-SHA512: 3e2491f4909df2a34e85dd7f051762cad8a12e948eb87709a6c943b9a62f2a208eb36966a80b50ffa2f976c49c775e944b796855f1caa00c1c812c2a8bf7b3c9
The trezor and keepkey emulators use the same port so they cannot
be run at the same time. To work around this, the emulators are
instead started and stopped before and after each test using
unittest's setUp and tearDown functions. However, other devices
which do not have conflicts can still be run at test suite creation
time. This is still done for the coldcard.
Furthermore, since the trezor and keepkey both create and use
emulator.img files in the current working directory, when they are
started, the working directory is changed to be the one containing
the emulator executable to avoid conflicting emulator.img files
Allows enumerating the UDPTransport in order to connect to the
Keepkey emulator.
Because the keepkey and trezor emulators use the same interface, some
conditions are used to avoid enumerating the emulator as the wrong type.
41d3fae Digital Bitbox manual tests (Andrew Chow)
a834e13 Allow providing device passwords for manual tests (Andrew Chow)
Pull request description:
Like the ledger test, but for bitbox.
Also lets you specify the password for the device. This is currently only used for the bitbox.
Tree-SHA512: 04ee87cc9b176d151c1d0367c6dca6d03b9fc1087837185180cc9ba89f97b059ef29571d6c32fa2a445ca7ab1d738c1fc7f19c76aa421c97532fcb18c757b335
c54bc33 Ensure that a bogus signature will always be created for ignored inputs (Andrew Chow)
Pull request description:
Fixes the issue where multisig inputs not belonging to the trezorwould cause an error. Also re-enables that test for the trezor
Fixes#100
Tree-SHA512: abbda04827a942eeb4c8b61ebd8b803fc6ae58871ec0646ebb8468889b7d4dcd5e0f92e58f47c1dd2ec8b6c6b67b3f663f65843b3d0708a001deb80407d362dc
0d6ad3a Test signtx with unknown inputs by wiping master fingerprint and processing (Gregory Sanders)
Pull request description:
For now I'm excepting Trezor from these specific test cases because it cannot handle multisig inputs that it won't sign yet.
Tree-SHA512: 37bf6ce641cb86692cbc4a93f12d06734f8434233fd75acd60939355e7d5c72dba3013b1195a22eb7618794285621a2ee0f0e7bbf9280c45197f37ca5ddf1ba3
d8d74ac Enable multisig tests for Trezor (Andrew Chow)
3b0429b Go through the signing process multiple times so that multisigs are fully signed (Andrew Chow)
cde7dfe Update documentation for Trezor (Andrew Chow)
c5b5a91 Implement signmessage for Trezor (Andrew Chow)
327f1e0 Have trezor ignore inputs it cannot sign rather than throwing an error (Andrew Chow)
f2f8b5d Implement multisig input signing for Trezor (Andrew Chow)
Pull request description:
This PR implements the ability to sign multisig inputs with a Trezor and the ability to sign a transaction that has inputs that do not belong to the device for Trezor. Documentation is also updated to reflect these changes and the Trezor implementation is marked as completed.
Multisig inputs can now be signed.
Although the Trezor has an `EXTERNAL` input type, it appears that the firmware does not recognize this type. So to work around this, for inputs that are not the Trezor's, a signature will still be create and instead just ignored at the end so the signature does not go into the resulting psbt.
Fixes#49
Tree-SHA512: 84325b7172ae587aebfa8b8f38d7e7be093d79ccf50b8cbb4031da525a004f1c09b5c4881cea12002e5f54723b52b3055a61489914dde1e46908d821d33f1503
Instead of erroring and failing to sign the transaction when an input
cannot be signed, just ignore that input. Ideally this would be done
using InputScriptType.EXTERNAL, but the firmware does not support this
So to achieve this, we instead fill in the input with bogus data and
let the Trezor sign it anyways. Then we just ignore the signature
that was produced.
68a4935 multisig test (Gregory Sanders)
Pull request description:
When device is marked as multi-sig enabled
create and spend 3 standard multisig types:
sh(wsh(multi()), sh(multi()), wsh(multi())
Tree-SHA512: 9d1300b0e98d4ee1ca073096d1043119b544e5ae9f161b48690b613215756cccd5a21e9bccf00d69b72b228454e625f253d7dd12ca7891c8a6f906f5492e1e1f
dd5533f Adapt signing test to support devices that can't do mixed input signing (Gregory Sanders)
08f1a94 Add basic physical Ledger test with ./run_tests.py --ledger option. (Gregory Sanders)
Pull request description:
Built on https://github.com/achow101/HWI/pull/94 to properly test for the mixed-input case.
This has to be done with a physical device since there is no simulator. It bootstraps itself by grabbing the xpub and other info using enumerate(which is kind of cheating yes but you can't initialize via software), then goes through the rest of the test normally.
Tree-SHA512: 6113885348f58f13b88319f4b01046ae5442c2eaf5b7537662b2e96b02b14f8506b9a2d905187a9cf2018acb9b0eb535569a09671aa3179b6ddab20384b2e239
106c231 Send the full amount of funds in TestSignTx to test all input types (Gregory Sanders)
Pull request description:
Also beef up the signing test a bit to try combinations of 1 to 3 inputs to catch corner cases in signing logic.
I am writing a Ledger test and this case was not failing previously because it can handle legacy or witness, but not both.
Tree-SHA512: 815d620e9051c5f031cea2fd3ff4a9a36ada07e8903c906b92b802b72dd9a0c41cc23e471b1c1ca021a7457bdef10ae424971bc5cd08060151f9110d6e3b2de3
bdadd8e Coldcard: send keypresses to the simulator for user input things (Andrew Chow)
942969c Ensure RPC is available for each test case (Andrew Chow)
47c3951 Install all necessary libraries correctly (Andrew Chow)
0f6081f Return correct error code from tests (Andrew Chow)
Pull request description:
Apparently `run_tests.py` was not exiting with a failure status code which caused travis to think that everything was fine when tests were actually failing. This fixes that by having it exit with the right status code.
Some tests were also failing, so those were fixed. The Coldcard tests needed have `ckcc-protocol[cli]` installed (previously the `cli` extra was not being installed), so that was added to setup.py. At the same time, `ecdsa` was added to fix#74.
Additionally, the tests for `displayaddress` and `signmessage` on the Coldcard were not working because a keypress is needed on the device. It turns out a keypress can be sent to the device if it is a simulator, so those commands have been changed to send the keypress necessary to simulators. Since `signtx` needs that too, I added it there and enabled the `signtx` test for Coldcard.
Lastly there were broken pipe errors when sending RPC commands to bitcoind. This was fixed by making a new RPC object when setting up each test case.
Tree-SHA512: 61ab5b552dfbeb7a55a398a575f0a52d409855f96fcacd3f051bbf2ea4178148edd051026af1adf7d72f2442e81fd35401a2bb53f3a3ff475653ef016ca0d578
signtx, signmessage, and displayaddress need user input which can't
be sent on the headless simulator. So instead send the keypresses
in those commands if it's the simulator.
f3dcf95 Update Coldcard docs for signmessage (Andrew Chow)
14a1345 Implement signmessage for the Coldcard with a simple test (Andrew Chow)
Pull request description:
Implements the `signmessage` command for the Coldcard. This completes the Coldcard implementation and the documentation is updated as such.
Requires #84 and #82 which add the other commands for the Coldcard.
Tree-SHA512: 3a1f64c997dc41e37bbbb90aa95290a70b2e1ff4e429b98b00bbee0788a0a4ea01bb06b66d1f08370b2fc8166428549b386c90391a3ff3e30b597c5ef858966c