1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00
Commit Graph

1382 Commits

Author SHA1 Message Date
Pavol Rusnak
bf6e9b4cad
fix(core): always recalculate header hashes 2020-10-15 16:28:12 +02:00
Martin Milata
9ed25a718a ci: handle full dependencies in shell.nix
Handling of full dependencies (multiple python versions, Monero tests)
was moved from Dockerfile to shell.nix.

The Python packages are installed from the pinned nixpkgs revision and
do not depend on channel state at the time of docker build anymore.

The Monero test binary is now downloaded using fetchurl which fails the
build if checksum doesn't match.
2020-10-15 15:59:20 +02:00
Andrew Kozlik
c67ecb984b chore(crypto): Move XPUB_MAXLEN and ADDRESS_MAXLEN from modtrezorcrypto to bip32.h. 2020-10-13 13:13:49 +02:00
Andrew Kozlik
c21ca81a1e fix(core): Prevent sensitive data from being left on the call stack in modtrezorcrypto. 2020-10-13 13:13:49 +02:00
Pavol Rusnak
d8534b5ee6
perf(core/extmod): replace HMAC Python implementation with C
We keep Python implementation of HMAC for Monero in
core/src/apps/monero/xmr/crypto/__init__.py
2020-10-12 16:33:13 +02:00
Andrew Kozlik
d90c3af6ea docs(core): Fix typos in slip39.py. 2020-10-11 00:31:24 +02:00
Tomas Susanka
b9dc44a849 docs(core): note 2.3.4 as released in Changelog 2020-10-08 09:02:52 +02:00
Martin Milata
542f32d3b1 feat(core): add auto_lock_delay and display_rotation to Features 2020-10-02 11:06:16 +02:00
Martin Milata
b2c4bbdaa2 feat(common): add auto_lock_delay and display_rotation to Features 2020-10-02 11:06:16 +02:00
matejcik
e4785d47e0 style: apply black 20.8b1 2020-09-29 11:30:40 +02:00
Rafael Korbas
2173ad97bc Refactor t<page number> to page<page_number> in cardano get_address call 2020-09-29 08:55:28 +02:00
Rafael Korbas
66dbdc2462 Enforce network id/protocol magic consistency for cardano show address 2020-09-29 08:55:28 +02:00
Juraj Muravsky
638977db7d Swap path with address type on screen in cardano get address 2020-09-29 08:55:28 +02:00
Pavol Rusnak
649e31cef0 chore(core/bootloader): regenerate messages with nanopb 0.4.3 2020-09-24 10:52:31 +02:00
Pavol Rusnak
71058eedd5 chore(vendor/nanopb): update nanopb from 0.4.1 to 0.4.3 2020-09-24 10:52:31 +02:00
Tomas Susanka
0317877297 chore(core): bump version to 2.3.5 2020-09-24 10:17:32 +02:00
matejcik
0eed360037 chore: make tx type names shorter
as suggested by @andrewkozlik:
TxAckInputType -> TxInput
TxAckOutputType -> TxOutput
TxAckPrevTxType -> PrevTx
TxAckPrevInputType -> PrevInput
TxAckPrevOutputType -> PrevOutput
2020-09-23 16:00:10 +02:00
matejcik
b6b65bffff docs(core): update changelog 2020-09-23 16:00:10 +02:00
matejcik
35035dabcb ci: omit generated protobuf classes from coverage report 2020-09-23 16:00:10 +02:00
matejcik
8b2e46eb2d chore(core): update unit tests to kwargs usage and new TxAck subtypes 2020-09-23 16:00:10 +02:00
matejcik
d89c42e139 feat(core): add more mypy targets 2020-09-23 16:00:10 +02:00
matejcik
244b264b47 chore(core): fix typing and kwargs usage 2020-09-23 16:00:10 +02:00
matejcik
ef4022fbf5 auto: regenerate protobuf classes 2020-09-23 16:00:10 +02:00
matejcik
37025e2a84 feat(core): use specialized protobufs in apps.bitcoin, enable typing 2020-09-23 16:00:10 +02:00
matejcik
b0a2297b14 feat(core): convert protobuf decoding errors to DataErrors 2020-09-23 16:00:10 +02:00
matejcik
6ba08526e1 fix(core): fix type annotations on CoinInfo 2020-09-23 16:00:10 +02:00
matejcik
7e5d9e295b fix(core): help mypy understand micropython's module management 2020-09-23 16:00:10 +02:00
matejcik
90ee5f3d38 feat!: implement protobuf required fields and default values
BREAKING CHANGE: this makes arguments to protobuf constructors
keyword-only, and arguments corresponding to required fields are now
mandatory
2020-09-23 16:00:10 +02:00
Pavol Rusnak
f8489f16e4 fix(common/defs): remove FSN, ICX which migrated to mainnet 2020-09-23 11:31:09 +02:00
Martin Milata
cff4955f93 core: implement SafetyChecks.PromptTemporarily
Also reword safety checks confirmation dialogs.
2020-09-18 09:02:40 +02:00
Martin Milata
7d37b2c90f common: add PromptTemporarily to SafetyChecks enum 2020-09-18 09:02:40 +02:00
Martin Milata
9d2ad96ad4 core: add SafetyCheckLevel to Features 2020-09-18 09:02:40 +02:00
Martin Milata
9f066e877d common: add SafetyCheckLevel to Features 2020-09-18 09:02:40 +02:00
Martin Milata
163ccedb39 core: allow const() values to have Literal type 2020-09-18 09:02:40 +02:00
Tomas Susanka
cd1d5195fd docs(core): add changelog for Oct release 2020-09-16 15:24:15 +02:00
Pavol Rusnak
65e20119ea
docs(changelog): fix typo 2020-09-15 14:25:02 +02:00
Andrew Kozlik
295710c37d core/bitcoin: Check ownership proofs using the provided commitment data. 2020-09-08 19:36:10 +02:00
Andrew Kozlik
5d745d5d04 common/protob: Add commitment_data to TxInputType. 2020-09-08 19:36:10 +02:00
Dusan Klinec
9d7b0bf50c xmr: fix new transaction type for CLSAG, HF=13 2020-09-07 17:50:38 +02:00
Andrew Kozlik
9774c99e90 core/tests: Fix unit tests for streamimg prev_tx after confirmation. 2020-09-04 14:36:39 +02:00
Andrew Kozlik
dad2852db9 core/bitcoin: Stream prev_tx after confirmation. 2020-09-04 14:36:39 +02:00
Tomas Susanka
ebc99435ab Revert "core: remove ownership messages from the public api for now"
This reverts commit 0d5f00668f.
2020-09-03 14:56:27 +02:00
Tomas Susanka
b99b8b3df3 Merge remote-tracking branch 'origin/release/2020-09' 2020-09-03 13:17:23 +02:00
Pavol Rusnak
c1dd07a2e4
core+legacy: update dates in changelogs 2020-09-02 15:36:36 +02:00
Martin Milata
f3fd98a7ba core: remove 1px of space on the left of each glyph
For PixelOperator (T1) fonts only.
2020-09-01 19:57:46 +02:00
Martin Milata
b8bb63fbef core: drop unused FONT_SIZE constant 2020-09-01 19:57:46 +02:00
Tomas Susanka
19461398d7 core/cardano: reuse derived Shamir seed (fixes #1007) 2020-09-01 16:14:41 +02:00
Tomas Susanka
0d5f00668f
core: remove ownership messages from the public api for now 2020-09-01 15:56:57 +02:00
Ondřej Vejpustek
09667a676e core/tools: update hid-bridge readme 2020-09-01 14:18:57 +02:00
matejcik
e0583dd5cb all: use a specific error code for "invalid session" 2020-08-28 15:37:06 +02:00
matejcik
4909821f35 core: implement EndSession 2020-08-28 15:37:06 +02:00
Martin Milata
c7934116ec
core: introduce TREZOR_MODEL flag (#1233) 2020-08-28 14:50:38 +02:00
Martin Milata
df5421e7d6 common/defs: update maxfee_kb to 10USD/tx
Except bitcoin.

(cherry picked from commit f51fac3410)
2020-08-25 18:06:54 +02:00
Martin Milata
f51fac3410 common/defs: update maxfee_kb to 10USD/tx
Except bitcoin.
2020-08-25 18:05:29 +02:00
matejcik
032a65e1cf python: export toif as public module 2020-08-25 11:30:33 +02:00
Pavol Rusnak
41f5237967
common/defs: enable extra_data for FLO
(cherry picked from commit 534695313c)
2020-08-24 11:08:02 +02:00
Pavol Rusnak
534695313c
common/defs: enable extra_data for FLO 2020-08-24 11:06:12 +02:00
Tomas Susanka
d080464cc5 core, legacy: bump versions (also in changelogs) 2020-08-24 09:31:49 +02:00
Tomas Susanka
e137f196f8 core/changelog: update 2020-08-21 21:30:15 +02:00
Andrew Kozlik
f2d669ecdc core/bitcoin: Use dynamic dispatch for confirmation dialogs in sign_tx. 2020-08-21 21:30:15 +02:00
Andrew Kozlik
02da5b7593 core/bitcoin: Show warning if nLockTime is set but ineffective due to all nSequence values being 0xffffffff. 2020-08-21 21:30:15 +02:00
Pavol Rusnak
146ee7af89 update changelogs 2020-08-21 21:30:15 +02:00
Pavol Rusnak
cdf0f68bb0 core: show passphrase on device 2020-08-21 21:30:15 +02:00
Pavol Rusnak
21b4c5b60e
core/bootloader_ci: fix typos in the previous commit 2020-08-21 14:47:35 +02:00
Ondrej Mikle
8d3d3be09c
core/bootloader_ic: introduce CI bootloader for TT device tests (#1182) 2020-08-21 14:39:56 +02:00
Martin Milata
1b982659c4
core: fix boot loop after uploading invalid homescreen (#1205) 2020-08-21 12:00:42 +02:00
Pavol Rusnak
0620911e46 core: allow spending coins from Bitcoin paths if the coin ...
has implemented strong replay protection via SIGHASH_FORKID
2020-08-21 11:49:03 +02:00
Alexis Hernandez
96c38315df
common/defs: enable extra_data for XSN (#1208) 2020-08-20 20:40:30 +02:00
Andrew Kozlik
dd540a2ccd core/ui: Initialize Qr class properly. 2020-08-20 18:13:09 +02:00
gabrielkerekes
431a25b119 Add Cardano README.md 2020-08-20 16:02:10 +02:00
Pavol Rusnak
c3ce9de3ea core: regenerate coins+tokens 2020-08-19 19:29:18 +02:00
Pavol Rusnak
fd87c62b68 common/defs: remove coins with no Trezor-compatible wallets 2020-08-19 19:29:18 +02:00
Martin Milata
71c5bc4e3b ci: fail if coverage falls under threshold 2020-08-18 21:08:46 +02:00
Martin Milata
3f21e8f400 core: display coin name when signing message
Also when verifying message.
2020-08-18 13:45:49 +02:00
Martin Milata
927ee0812b core: add hard limit for transaction fees
The hard limit is set to 10*fee_warning_threshold. The limit is not
enforced when `safety_checks` is set to "Prompt".
2020-08-17 16:12:33 +02:00
Tomas Susanka
c9dc38c9f3 core: allow 49/x not 49/x' for Casa 2020-08-17 08:54:08 +02:00
Pavol Rusnak
5536fbb98a python: use stdlib blake2s on python 3.6+
commit 6d407c84d7 did not replace everything
2020-08-10 23:35:38 +02:00
Pavol Rusnak
d1973b7486
pipenv: update Pipfile 2020-08-08 18:03:32 +02:00
Pavol Rusnak
02b6656471
core: update changelog 2020-08-07 15:09:48 +02:00
Pavol Rusnak
4e11735d22 core/modtrezorui: remove prefill from text functions
use display.bar where needed to prefill the areas
2020-08-07 15:08:14 +02:00
matejcik
2e5771db79 core: add changelog entry 2020-08-07 13:54:32 +02:00
matejcik
5385617eda core: increase address length limit to accomodate CRW (fixes #1139) 2020-08-07 12:45:43 +02:00
matejcik
51ea8ccecd common: update token support 2020-08-07 11:49:26 +02:00
Pavol Rusnak
fd2ddbfb03
core+legacy: expand month names in changelogs 2020-08-05 23:07:11 +02:00
Pavol Rusnak
65805c9145
core: fix non-determinism in resources.py.mako 2020-08-05 17:10:22 +02:00
matejcik
cea634158a core: make sure Homescreen is properly initialized (fixes #1095) 2020-08-05 14:22:06 +02:00
Tomas Susanka
16827c3135 core: make templates 2020-08-05 13:55:36 +02:00
Pavol Rusnak
3fffa9ae68
common/defs: enable XVG 2020-08-05 12:10:52 +02:00
gabrielkerekes
afa26e7560 Use correct paths for Cardano Byron witnesses 2020-08-04 20:35:13 +02:00
Andrew Kozlik
292d909235 core/base: Implement CancelAuthorization message. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
8bcb3d8fb6 core/storage: Add delete() method to storage.cache. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
5c1f197602 common/protob: Add CancelAuthorization message. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
a6c06b5c5f core: Update changelog with CoinJoin flow. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
791a74aeb2 core/tests: Add unit tests for CoinJoinApprover and CoinJoinAuthorization. 2020-08-04 17:32:44 +02:00
matejcik
cd86f9f477 core/bitcoin: make change check more robust against short paths 2020-08-04 17:32:44 +02:00
Andrew Kozlik
07d9b780a6 core/bitcoin: Change CoinJoin round ID length to 32 bytes and remove rate limiting. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
377bff68f4 core/bitcoin: Implement DoPreauthorized message. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
2c30dd62fc common: Add DoPreauthorized message. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
b9cfecb8b8 core/bitcoin: Support preauthorization in SignTx message for CoinJoin. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
97fc9b74ab core/bitcoin: Implement CoinJoinApprover. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
472e853f0a core/tests: Fix unit tests to work with BasicApprover in sign_tx. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
d6ee542deb core/bitcoin: Move transaction confirmation logic from Bitcoin to BasicApprover class. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
00258f2d4d core/bitcoin: Support preauthorization in GetOwnershipProof message. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
c772de9d3c core/bitcoin: Support preauthorization in @with_keychain decorator. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
208283e13e core/bitcoin: Implement AuthorizeCoinJoin message. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
48a331aa1d core/bitcoin: Add CoinJoinAuthorization class. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
dc32a17335 core/bitcoin: Move BIP32_WALLET_DEPTH to common. 2020-08-04 17:32:44 +02:00
Andrew Kozlik
bbab13f6e7 common/protob: Add AuthorizeCoinJoin message. 2020-08-04 17:32:44 +02:00
Ondřej Vejpustek
59002118c0 core/extmod: explicitly initialize automatic variables 2020-08-04 14:50:07 +02:00
gabrielkerekes
683d7420ff Fix Cardano Shelley public key validation
In Shelley Cardano started using the purpose 1852'. Unfortunately,
we completely missed that the public key path validation fuction checks
for purpose 44' explicitly, which means that the user is shown a warning
when deriving public key with the purpose 1852'. Which is always when
"logging in" to a wallet. This commit should fix that.

I've also updated type hinting in get_public_key.
2020-08-04 13:03:57 +02:00
matejcik
c3afb93837 core/tests: improve test harness (fixes #1157) 2020-08-04 10:27:44 +02:00
Pavol Rusnak
efc5ccdaf0
core: remove src1 2020-08-03 15:59:57 +02:00
Tomas Susanka
16a5858544 core: add Casa/Greenaddress paths exceptions to Changelog 2020-08-03 15:51:35 +02:00
Martin Milata
e5bdca655a core: don't scale emulator background image
Makes the emulator look nicer in tiling window managers.
2020-07-31 12:27:43 +02:00
Gabriel Kerekeš
c0eba979c6 Fix bare 'except' style error - catch Exception instead
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
2020-07-30 17:17:03 +02:00
gabrielkerekes
7a1e773b49 Validate transaction metadata 2020-07-30 17:17:03 +02:00
gabrielkerekes
f2ee450410 Include metadata in transaction signing 2020-07-30 17:17:03 +02:00
gabrielkerekes
0438f318b4 Bring back cbor.Raw - to be used for metadata 2020-07-30 17:17:03 +02:00
gabrielkerekes
1ed8b56b7c Include Byron witness once for each input path 2020-07-30 17:17:03 +02:00
gabrielkerekes
7bf5cab840 Update sign_tx
Add certificates, withdrawals and metadata hash
2020-07-30 17:17:03 +02:00
gabrielkerekes
a25444efd1 Move to_account_path() to utils 2020-07-30 17:17:03 +02:00
gabrielkerekes
e92baf5b02 Update protobuf 2020-07-30 17:17:03 +02:00
Andrew Kozlik
7d07161efe common/fido: Unify application labeling between U2F and FIDO2. 2020-07-30 15:29:54 +02:00
Pavol Rusnak
063aba910d core: rename emulator to trezor-emu-core 2020-07-30 15:27:34 +02:00
matejcik
8502412dbc core/emulator: assume -m main when no arguments are provided
fixes #1115
2020-07-30 15:27:34 +02:00
Martin Milata
d955e3f1e5 core: rename class Overwintered to Zcashlike 2020-07-30 15:14:18 +02:00
Martin Milata
10387e1869 core: drop zcash v3 tx signing support 2020-07-30 15:14:18 +02:00
gabrielkerekes
6d02aa23d9 Raise wire.DataError when deriving invalid address type 2020-07-30 14:43:32 +02:00
gabrielkerekes
b5f3511c1c Add support for script addresses in tx outputs 2020-07-30 14:43:32 +02:00
gabrielkerekes
f1b6056edb Fix staking key hash message
When deriving an address with a foreign staking key Trezor would crash
due to forgotten `decode()` on hexlified staking key hash which was to
be displayed.

This wasn't discovered while testing because it weirdly would pass with
a `aaff00` string, but not with longer ones.
2020-07-30 14:43:32 +02:00
matejcik
c008600d08 core/debug: fail if wait_layout is sent without watch_layout 2020-07-29 11:50:47 +02:00
Pavol Rusnak
9a673db647
core: fix build on T1
file src/apps/base.py was added unconditionally breaking the T1 build
2020-07-28 12:12:53 +02:00
Pavol Rusnak
a6451dad46
core/fonts: update headers 2020-07-28 10:56:41 +02:00
Martin Milata
3021233eaf core: remove unimports from bitcoin sign_tx layouts 2020-07-28 10:51:28 +02:00
Pavol Rusnak
47e7550423
core/extmod: add font_pixeloperator{,mono}, use this font for T1 2020-07-28 09:40:30 +02:00
Pavol Rusnak
cec87bba50
core: remove mono bold font variant (not used anywhere) 2020-07-27 23:22:34 +02:00
Pavol Rusnak
e6baaa7ed9
core/src1: use display.text instead of display.print 2020-07-27 17:40:34 +02:00
Pavol Rusnak
de43dde1e9
core: make emu.sh respect TREZOR_MODEL env variable 2020-07-27 17:38:55 +02:00
Pavol Rusnak
8bc32d035b
core/extmod: enable display_text* methods for other models than T 2020-07-27 17:24:13 +02:00
Pavol Rusnak
df03534955
core: print inverted question mark for nonprintable characters 2020-07-27 16:29:11 +02:00
Pavol Rusnak
89d701ed08
core+legacy: bump versions (also in changelogs) 2020-07-27 13:59:49 +02:00
matejcik
4eb5b927c0 core/cardano: simplify keychain implementation 2020-07-27 13:24:51 +02:00
Gabriel Kerekeš
d2c1624602 Cardano shelley update 2/3 (#1112) 2020-07-27 13:11:23 +02:00
gabrielkerekes
e1615e60ec Update Cardano to support Shelley era 1/3
Update protobuf

- Previous transactions don't need to be sent anymore, because fee is
  included in the transaction now. Thus transactions_count can be
  removed from CardanoSignTx message and the CardanoTxAck and
  CardanoTxRequest messages can be removed altogether.
- CardanoTxInputType.type is unused so remove it

Add NULL (None type) serialisation to CBOR

- Transaction metada must either have a valid structure or CBOR NULL
  must be used (if metadata is empty) - it can't be simply left out.

Add protocol_magics file

- Just to have a nicer way of representing protocol magics

Update transaction signing

- Previous transactions no longer need to be requested
- Output building is simplified, since fee doesn't need to be calculated
- Remove transaction class since it is no longer needed (only functions
  remained)
- Reorder functions so it reads top to bottom

Add protocol magic to byron address on testnet

- This has always been a part of the spec, but it hasn't been
  implemented before, because it wasn't really needed.

Update trezorlib

Update tests

- Transaction messages are no longer required
- Expected values are different since tx format changed
- Common values in test cases have been extracted

Remove unused file

- Progress was used when receiving previous transactions

Add CRC check to output address validation
2020-07-27 13:04:49 +02:00
Pavol Rusnak
88aa3cf168
core: convert old changelogs to new format 2020-07-27 12:14:00 +02:00
Pavol Rusnak
8dacad0782
core/bootloader: update protobuf definitions 2020-07-26 00:00:37 +02:00
matejcik
fdcb64ac24 all: rename protobuf unsafe_prompts to safety_checks 2020-07-24 16:37:58 +02:00
matejcik
19ad1dae8b core/bitcoin: allow compatibility namespaces for Casa/Greenaddress 2020-07-24 16:37:58 +02:00
matejcik
b741560997 core/bitcoin: drop unused validate_path_for_bitcoin_public_key 2020-07-24 16:37:58 +02:00
matejcik
407375b0c4 core/bitcoin: move BITCOIN_NAMES to common 2020-07-24 16:37:58 +02:00