1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-23 16:08:17 +00:00
Commit Graph

283 Commits

Author SHA1 Message Date
matejcik
cf9106ff5d client: only normalize passphrase if not entered on device 2018-12-17 14:01:52 +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
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
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
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
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
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
560a5215c5 client: do not coerce self.features.vendor to string
There is no good reason to do that and it hides situations when
the field mistakenly doesn't exist.

Added comment explains that missing "vendor" field might by caused
by trezor-common mismatch, which fixes #328
2018-11-06 14:16:53 +01:00
matejcik
99278f7d08 client: PassphraseState is not mandatory (missing on T1 in fact) 2018-11-06 13:36:25 +01:00
matejcik
c269d67cde trezorlib: finalize BTC API changes
- drop set_tx_api method and its usage from trezorctl
- drop _prepare_sign_tx which is not used anymore
- adapt trezorctl to new signing API
- make trezorctl signing smarter, ahead of moving it elsewhere
2018-11-06 13:36:25 +01:00
matejcik
ea675f1e58 client: inline PassphraseState flow into Passphrase flow 2018-11-06 13:36:25 +01:00
matejcik
3e7b26b454 exceptions: smarter, nicer exceptions from Failures 2018-10-12 15:49:17 +02:00
matejcik
ffff11a462 style: isort & autopep 2018-10-10 13:15:28 +02:00
matejcik
c37bc9c38e debug: improve infrastructure and expected message reporting 2018-10-10 13:15:28 +02:00
matejcik
a5abd70619 trezorlib: drop TrezorClientDebugLink from client.py 2018-10-10 13:15:28 +02:00
matejcik
06927e003e trezorlib: get rid of TextUIMixin
This also moves DebugLinkMixin to debuglink.py and converts the mixin to
a subclass of TrezorClient (which is finally becoming a
reasonable-looking class). This takes advantage of the new UI protocol
and is ready for further improvements, namely, queuing input for tests
that require swipes.

The ui.py module contains a Click-based implementation of the UI
protocol. Use of callback_* methods has been limited and will probably
be cleaned up further (The contract has changed so we'll try to make
third party code fail noisily. It is unclear whether a backwards
compatible approach will be possible).

Furthermore, device.recovery() now takes a callback as an argument. This
way we can get rid of WordRequest callbacks, which are only used in the
recovery flow.
2018-10-10 13:15:28 +02:00
matejcik
4fb3acb029 style: uppercase hex constants to conform with black 18.9b0 style 2018-10-01 14:01:33 +02:00
Pavol Rusnak
4a0ca873eb trezorlib+tools: remove usage of binascii 2018-09-27 16:52:28 +02:00
matejcik
305cb55d02 style: reformat client.py 2018-09-06 17:09:37 +02:00
Pavol Rusnak
434f279069
use implicit encoding in encode/decode 2018-09-06 16:22:38 +02:00
matejcik
e5c2329b80 client: drop stellar_get_public_key from compatibility links 2018-09-04 15:51:38 +02:00
matejcik
3d3e9b67b4 style: apply black/isort 2018-08-13 18:22:19 +02:00
matejcik
5259146a0b style: remove unused imports with autoflake 2018-08-10 15:48:39 +02:00
matejcik
d5dee0c897 trezorlib: move mostly-debug methods from device to debuglink 2018-08-10 13:33:14 +02:00
matejcik
65d8adb0be trezorlib: rename device.*_device to device.* 2018-08-10 13:32:50 +02:00
matejcik
a3d560529c trezorlib: post-merge updates 2018-08-06 16:15:44 +02:00
matejcik
7083eb7a5c trezorlib: drop @field decorator
its function is replaced by @expect(field="name") -- it doesn't make sense
to use @field without @expect anyway
2018-07-09 13:57:30 +02:00
matejcik
00617817c3 trezorlib: disable encrypt/decrypt message functionality
it is disabled in Trezors and its utility is unclear
2018-07-09 13:56:22 +02:00
matejcik
7e90e89e69 client: get rid of TrezorClient._convert_prime 2018-07-09 13:56:22 +02:00
matejcik
23b58cc0cb flake8: fix complaints 2018-07-09 13:56:22 +02:00
matejcik
f3a042db80 trezorlib: split out methods from ProtocolMixin 2018-07-09 13:56:22 +02:00
matejcik
1820f529fc trezorlib: shuffling things from client 2018-07-09 13:50:25 +02:00
matejcik
2f3a32f8e8 trezorlib: drop support for EncryptMessage and DecryptMessage 2018-07-09 13:46:18 +02:00
matejcik
54f1599a5a regenerate license headers
This clarifies the intent: the project is licenced under terms
of LGPL version 3 only, but the standard headers cover only "3 or later",
so we had to rewrite them.

In the same step, we removed author information from individual files
in favor of "SatoshiLabs and contributors", and include an AUTHORS
file that lists the contributors.

Apologies to those whose names are missing; please contact us if you wish
to add your info to the AUTHORS file.
2018-06-21 16:49:13 +02:00
Pavol Rusnak
1477c9aa9e
trezorctl/trezorlib: add show_display to StellarGetAddress/StellarGetPublicKey 2018-06-11 18:55:52 +02:00
Tomas Susanka
22872c53c2 tests/stellar: missing field annotation 2018-06-11 18:42:23 +02:00
Tomas Susanka
d3d9ceb0c4 tests: stellar test for get address 2018-06-11 18:42:23 +02:00
matejcik
73f016c465 trezorctl: update firmware_update to work better with TT (fix #269)
This removes the --erase option which was fishy before (and is now superseded
by wipe_device in bootloader mode).

Also adds a draft of "local fingerprint check" functionality for T1. This will
be expanded to work with TT in future releases.
2018-06-07 17:06:31 +02:00
Aleksey Popov
922748e348 lisk: restore Lisk sign and verify message functionality 2018-06-07 14:07:26 +02:00
Pavol Rusnak
e4dcc8d8c6
zcash overwinter support 2018-06-05 16:05:14 +02:00
matejcik
99bc267301 client: hide uninteresting functions from test tracebacks 2018-05-28 14:45:54 +02:00
matejcik
9982ef98f9 Merge branch 'master' into matejcik/refactor 2018-05-24 19:18:26 +02:00
matejcik
e779a251fb transport: better ways to handle errors when enumerating devices 2018-05-24 19:14:05 +02:00