1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-06 05:21:05 +00:00
Commit Graph

7182 Commits

Author SHA1 Message Date
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
matejcik
c3112fd83d embed/trezorhal: only poll CTPM when touch is detected
Because CTPM dislikes being polled when no touches are seen, keeps
resetting, and maybe freezes once in a while. This is very likely a fix
for #334.

Before, we would simply read the touch registers on every loop. Now we
first check whether the interrupt line is down, which indicates that the
CTPM has data to tell us.

Tracking the `touching` flag is necessary, as sometimes we don't poll
frequently enough to catch the TOUCH_END event before interrupt line
goes up again.
The `last_packet` handling miiight not be necessary - AFAICT, the CTPM
has some sort of buffer and always returns TOUCH_START at first and
TOUCH_END at last. Still, better safe than sorry.
2018-11-26 14:47:06 +01:00
Tomas Susanka
72bc784f7f Revert "TEMPORARY: run tests against tsusanka/paths python-trezor branch"
This reverts commit 2acf0d10bd.
2018-11-21 17:21:28 +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
matejcik
a1265b48d1 support: add ETH and ETC as supported in webwallet
also use this information when generating coins_details.json
2018-11-20 18:00:38 +01:00
matejcik
88fa3c7381 cointool: fix uniformity check
also uniformize misc.json
2018-11-20 17:59:15 +01:00
matejcik
56fbd816c9 improve wallet lists
- move bitcoin wallet links from coins_details.override.json to a separate
wallets.json file
- drop NanoWallet links from nem nem_mosaics.json, auto-add them in
coins_details.py instead
- move misc wallet links to misc.json
- clean out override file
- change wallet format in coins_details.json:
  - they're now list instead of dict, so that we can specify ordering
- add Trezor Beta wallet link to ETH/ETC and their tokens
- somewhat stricter checking of trezor.io wallet data
2018-11-20 17:27:12 +01:00
martin
beb8bb6dec increase version for DGB
Increase version for DGB to 1.6.3 and 2.0.7. Motivation is to make it work seamlessly in current webwallet. Lower versions would need some workarounds.
2018-11-20 14:18:46 +01:00
Jan Pochyla
1782b0273c
Merge pull request #341 from trezor/tsusanka/paths
Bip 44 path checks
2018-11-19 15:54:11 +01:00
Tomas Susanka
016a71c6d0 protobuf: eth fix 2018-11-16 14:14:18 +01:00
Tomas Susanka
ff34e73f9c protobuf: EthereumPublicKey 2018-11-16 14:12:52 +01:00
Pavol Rusnak
caa4a87c5c
defs: remove USDT erc20 2018-11-16 01:45:53 +01:00
Pavol Rusnak
b646fe1928
defs: regenerate coins_details.json 2018-11-16 01:44:46 +01:00
Pavol Rusnak
b4e5684093
defs/misc: add maid, omni, usdt 2018-11-16 01:43:32 +01:00
Pavol Rusnak
b1b592f062
defs: fix t2 support version 2018-11-16 01:31:02 +01:00
Pavol Rusnak
1fa013ddca
defs: EOS erc20 not required anymore in override.json 2018-11-16 01:26:17 +01:00
Pavol Rusnak
67d699ca3f
defs: add Tezos SimpleStaking wallet 2018-11-16 01:21:44 +01:00
Pavol Rusnak
b1725e7264
fsm: return xpub for multisig 2018-11-15 13:43:08 +01:00
Pavol Rusnak
b1566e9d57
src/apps/wallet/get_public_key: return xpub for multisig 2018-11-15 13:41:19 +01:00
Pavol Rusnak
da3223d703
tests: change flags for test_msg_signtx_capricoin.py 2018-11-14 17:36:19 +01:00
Tibor Arpas
be58549fd9
src/apps/wallet/sign_tx: handle timestamp field 2018-11-14 17:33:03 +01:00
Pavol Rusnak
1d43322d21
src/trezor/messages: regenerate 2018-11-14 17:31:17 +01:00
Pavol Rusnak
b3e668db8b
embed/extmod/modtrezorconfig: small refactor to storage 2018-11-14 16:25:36 +01:00
Pavol Rusnak
113a557f17
embed/trezorhal+unix: small refactor to flash.c 2018-11-14 15:12:19 +01:00
Pavol Rusnak
8d7dd590ff
defs: change trc contact 2018-11-14 11:17:28 +01:00
Pavol Rusnak
d2f1a4db11
changelog: update 2018-11-13 16:52:34 +01:00
Pavol Rusnak
ca24156eb5
changelog: update 2018-11-13 16:51:26 +01:00
Pavol Rusnak
9cd261c81a
layout: parse and show OMNI transactions 2018-11-13 16:50:10 +01:00
Pavol Rusnak
10a284f6ee
src/apps/wallet/sign_tx: make check for OMNI more strict 2018-11-13 16:33:14 +01:00
Pavol Rusnak
4693c071b4
src/apps/wallet/sign_tx: implement OMNI parsing in OP_RETURN layout 2018-11-13 14:29:40 +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
Pavol Rusnak
0f2ec16609
vendor: update trezor-common
bump fw version to 1.7.2
2018-11-12 14:17:25 +01:00
Pavol Rusnak
342c3646e1
vendor: update trezor-common 2018-11-12 14:14:25 +01:00
Pavol Rusnak
8c53177626
defs: remove eos, trx erc20 tokens 2018-11-12 14:12:26 +01:00
Pavol Rusnak
3600af0c8e
defs: add eos, trx 2018-11-12 14:03:10 +01:00
Pavol Rusnak
9f02376c70
support: replace soon with version where applicable 2018-11-12 14:03:10 +01:00
matejcik
780236ca77 build: add typing_extensions requirement 2018-11-12 12:55:28 +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