1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-23 07:58:09 +00:00
Commit Graph

850 Commits

Author SHA1 Message Date
matejcik
6fa8ccfeed transport: report proper exception when no device found 2019-01-09 13:51:37 +01:00
Tomas Susanka
897bc14a36 tests: add ripple test case with destination tag 2019-01-08 16:38:45 +01:00
strmci
402e72e36e device_tests: add input flow function to Ontology tests (#348) 2019-01-07 12:58:42 +01:00
Jochen Hoenicke
0428f5091c Don't require prevtx for coins with BIP-143 fork id (#352)
Coins like Bitcoin Cash and Bitcoin Gold always use BIP-143 signatures
that do not require previous transactions.
2019-01-07 12:57:12 +01:00
matejcik
369b704f6b trezorlib: bump to 0.11.1 2018-12-28 13:00:35 +01:00
ghost43
8c644cc03e qt: don't import PyQt5.Qt 2018-12-28 12:48:31 +01:00
matejcik
cf9106ff5d client: only normalize passphrase if not entered on device 2018-12-17 14:01:52 +01:00
Pavol Rusnak
831fde9c5c
tests: T1 now caches the PIN after PIN set/change 2018-12-14 15:17:41 +01:00
Jan Pochyla
0390c1da0a tests: use valid paths in various altcoin tests 2018-12-13 15:49:31 +01:00
matejcik
bfb6a196c0 tests: limit number of reported expected responses
so that our test logs are not spammed, esp. in that one test that has
20k messages
2018-12-13 14:10:44 +01:00
strmci
b0a227866a device_tests: add input flow function to NEM signing test 2018-12-06 17:41:24 +01:00
matejcik
d4bcabc224 trezorlib: set minimum firmware for TT to 2.0.10
even though it's not required now, it will be in ~2 weeks
2018-12-06 16:10:56 +01:00
matejcik
1179bd407b client: fix bug with old firmware that doesn't send the "model" field 2018-12-06 15:07:50 +01:00
matejcik
23feb24573 ui: allow empty passphrase in ClickUI 2018-12-06 15:05:41 +01:00
matejcik
4ab8bec901 transport/webusb: change type annotations to strings
otherwise it fails when usb1 is missing, because python's type
annotation system
2018-12-05 16:52:04 +01:00
matejcik
ea16d3c42a client: fix short-circuited ping
(it's using call_raw so it must open its own session)
2018-12-05 16:51:33 +01:00
matejcik
e89e6ca32e build: add script for fetching required release versions 2018-12-04 17:59:30 +01:00
matejcik
d9e5fd2682 client: refuse to work with outdated firmware
required firmware versions are hardcoded and should be updated by a
build script
2018-12-04 17:42:54 +01:00
matejcik
84339ae1ff client: properly sanitize and handle invalid inputs from UI functions 2018-12-04 17:42:54 +01:00
matejcik
3362f66724 client: make sure proto exists in client
because old Electrum imports it

also make sure it doesn't work anymore
2018-12-04 17:42:54 +01:00
matejcik
db1a5adee7 device_tests: style 2018-11-26 17:02:00 +01:00
Tomas Susanka
0d01298f71 tests/eth: add invalid signature test for verify 2018-11-26 16:30:34 +01:00
matejcik
4982fd1cf5 client: wrap clear_session in a session
because it's a different kind of session...
2018-11-26 16:06:56 +01:00
matejcik
c7c5653231 trezorlib: bump version (not releasing yet though) 2018-11-26 16:02:19 +01:00
matejcik
1ded85c746 tests/unit_tests: update test_transport 2018-11-26 15:58:19 +01:00
matejcik
36a81fd9e7 trezorlib: update CallException to match the old one
which is now TrezorFailure
2018-11-26 15:30:42 +01:00
matejcik
1f2db3666b ui: smarter ClickUI prompts only once
This also fixes #331 by moving the PIN matrix from trezorctl into the UI
class
2018-11-26 15:30:42 +01:00
matejcik
eb50d54ec2 device: add reasonable defaults for reset/recovery 2018-11-26 15:30:42 +01:00
matejcik
40eaa1fa36 transport/hid: reload serial when closing
because device.wipe() causes the device to change serial, which breaks
the connection unnecessarily.
2018-11-26 15:30:42 +01:00
matejcik
f3a13f50e0 transport/hid: check serial number when opening device
This fixes the problem where the user disconnects a device, connects a
different one, and the library doesn't notice because opening the same
HID path worked fine. (see https://github.com/spesmilo/electrum/issues/4806 )
2018-11-26 15:30:42 +01:00
matejcik
082adfd15d transport: derive TransportException from TrezorException 2018-11-26 15:30:42 +01:00
matejcik
69ef1f0acd transport: cleaner Transport list instantiation
Previously if an import of a dependent module (usb1, hid) failed, import
of the whole transport module would fail. This was resolved by catching
ImportErrors in the all_transports method.

This had two drawbacks:
- if something other than ImportError happened - e.g., libusb would
raise OSError if it couldn't find libusb.so - all_transports would crash
anyway
- at the same time, if a legitimately needed dependency
(typing_extensions) was missing, this would be masked by the ImportError
handling.

Instead, we unconditionally import the modules, and inside each one,
wrap dependencies in a try-except.

As an added benefit, it is now possible to disable a transport just by
setting SomeTransport.ENABLED = False
2018-11-26 15:30:42 +01:00
matejcik
f04458d6ea client: allow canceling pin/passphrase entry 2018-11-26 15:30:42 +01:00
matejcik
11e56a7e1b client: clean up constants 2018-11-26 15:30:42 +01:00
matejcik
3dda5e6534 client: proto -> messages 2018-11-26 15:30:42 +01:00
matejcik
4f9bdff564 client: simplify MovedTo now that we only need it to raise an error
this also removes most of client's imports, which will FINALLY let us
import client where it is needed without circular dependencies
2018-11-26 15:30:42 +01:00
matejcik
ef46bd38ef client: finish the move away from mixins
move all methods that are still relevant to TrezorClient (originally
BaseClient)

modify ProtocolMixin to be a compatibility shim

modify BaseClient to be a compatibility shim with a proxy to original
actual TrezorClient - this prevents early failures in Electrum for long
enough to show an error message
2018-11-26 15:30:42 +01:00
matejcik
f3f521b028 client: convert generic classname-based dispatch to a static list
Only a limited number of messages should be dispatched to handlers
that can be inserted anywhere in the protocol flow. Having a fixed list
of interjecting handlers makes this clearer and prevents hard-to-find
bugs.
2018-11-26 15:30:42 +01:00
Tomas Susanka
786bccfa34 tests/lisk: all all all seed 2018-11-21 17:08:18 +01:00
Tomas Susanka
29d3a21d84 tests/eth: all all all seed 2018-11-21 17:08:18 +01:00
Tomas Susanka
f5af12c043 paths: compatibility for derivation paths checks 2018-11-21 17:08:18 +01:00
Pavol Rusnak
da3223d703
tests: change flags for test_msg_signtx_capricoin.py 2018-11-14 17:36:19 +01:00
strmci
252f946f40 Add a test case for segwit inputs/outputs with very high amounts (#337)
Add a test case for segwit inputs/outputs with very high amount, fixes #332
2018-11-12 16:27:56 +01:00
matejcik
5bb7dc39b8 transport: consolidate USB-based transports
remove Trezor 2 support from HID transport, which never worked

use ProtocolV1 explicitly everywhere, as V2 doesn't exist in practice

move USB IDs and UDEV warning string to a common place

fix a bug where HID would return a list instead of bytes
2018-11-12 12:22:32 +01:00
matejcik
d3534a15c9 transport: fix typing after autoflake treatment
autoflake will remove all unused imports when `make style` is invoked,
but can't recognize typing names that are only used in comments.

this fixes it.
2018-11-12 12:22:32 +01:00
matejcik
bfb56451e8 bridge: support bridge 2.0.25+
which can do read/write separately and supports debuglink
2018-11-12 12:22:32 +01:00
matejcik
ed473e2e42 trezorlib: add licence headers where missing 2018-11-12 12:22:32 +01:00
matejcik
93d84539bd transport: fit log messages to lines 2018-11-12 12:22:32 +01:00
matejcik
85b85c67b3 trezorlib: reentrant session handling
This fixes the breakage introduced by transport reshuffles.
It's still not great and I'd love to see context manager based sessions.
But it's good enough for now.
2018-11-12 12:22:32 +01:00
matejcik
daf97afb37 bridge: refactor after merging old changes 2018-11-12 12:22:32 +01:00