1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 21:48:13 +00:00
Commit Graph

2070 Commits

Author SHA1 Message Date
David Misiak
9f9535abb3 feat(cardano): add key hash stake credentials 2022-03-18 14:32:54 +01:00
David Misiak
2262602967 feat(cardano): add support for plutus transactions 2022-03-18 14:32:54 +01:00
David Misiak
1388912762 fix(cardano): add map key canonical order validation 2022-03-18 14:32:54 +01:00
David Misiak
143af80aea fix(cardano): add input validation 2022-03-18 14:32:54 +01:00
David Misiak
48587d83fe feat(cardano): add support for output datum hash and script data hash 2022-03-18 14:32:54 +01:00
David Misiak
2b3a53a6ae feat(cardano): add support for network id in tx body 2022-03-18 14:32:54 +01:00
Pavol Rusnak
6052e71bbb fix(core): fix build with FEATURE_FLAGS.SECP256K1_ZKP=False
[no changelog]
2022-03-18 12:03:41 +01:00
matejcik
cdca0bad9e fix(core): do not drop cashaddr prefix for QR code
[no changelog]
2022-03-18 11:59:04 +01:00
Pavol Rusnak
edb87359eb feat(core): headless emulator implies disabled animations
[no changelog]
2022-03-18 11:58:04 +01:00
Andrew Kozlik
9e346b05da chore(core): Don't check fairness of mining fees in CoinJoin.
[no changelog]
2022-03-17 15:46:01 +01:00
Andrew Kozlik
94d1a49eea chore(core): Rework checking of CoinJoin parameters.
[no changelog]
2022-03-17 15:46:01 +01:00
Andrew Kozlik
8be6689150 chore(common): Rework AuthorizeCoinJoin message parameters.
[no changelog]
2022-03-17 15:46:01 +01:00
Andrew Kozlik
556e8a147a chore(core): Make CoinJoin checks more lenient.
[no changelog]
2022-03-17 15:46:01 +01:00
Andrew Kozlik
605e128ca0 chore(core): Simplify path warning UI. 2022-03-17 09:44:03 +01:00
Andrew Kozlik
94fa6d2515 feat(core): Guess weight of unverified external inputs. 2022-03-17 09:44:03 +01:00
Andrew Kozlik
43f1d67289 feat(core): Support unverified external inputs. 2022-03-17 09:44:03 +01:00
Andrew Kozlik
c9e6ca30c9 feat(core): Ensure input's script type and path match the scriptPubKey. 2022-03-17 09:44:03 +01:00
matejcik
0b9f7db742 fix(core): support structs as array elements (fixes #2167) 2022-03-10 13:04:54 +01:00
matejcik
4e2129e0a0 feat(core): automatically choose best QR encoding 2022-03-10 11:27:21 +01:00
grdddj
b9858f00c5 chore(tools): simplify build_protobuf file sources creation 2022-03-04 11:42:51 +01:00
grdddj
3d505874aa feat(ci): create pyright tool and include it in CI
[no changelog]
2022-03-02 15:43:50 +01:00
matejcik
db9f89ed4e chore(core): update Bitcoin testcases to use valid prevtxes
[no changelog]

Co-authored-by: grdddj <jiri.musil06@seznam.cz>
2022-02-28 15:45:29 +01:00
matejcik
bbf286e050 fix(core/debug): only wait for layout when _enabling_ watch_layout 2022-02-21 14:37:25 +01:00
matejcik
390411098a build(core): enable ui_debug for non-frozen emulator 2022-02-18 11:27:23 +01:00
matejcik
59b5f48dc1 build(core): fix echo invocation for dash 2022-02-18 11:27:23 +01:00
Jan Pochyla
4c027a688c chore(core/rust): Simplify LayoutObj 2022-02-18 11:27:23 +01:00
Jan Pochyla
2b6f1a4d5c chore(core/rust): Use MultiTapKeyboard in passphrase 2022-02-17 15:17:11 +01:00
Jan Pochyla
3c337723b2 chore(core/rust): Add mnemonic keyboards 2022-02-17 15:17:11 +01:00
Pavol Rusnak
c6667fa0c2 feat(core): verify bip340 pubkeys used in p2tr addresses
Co-Authored-By: Ondřej Vejpustek <ondrej.vejpustek@satoshilabs.com>
2022-02-16 10:25:15 +01:00
Pavol Rusnak
b9bbd5fcd7 chore: update dependencies
[no changelog]

Co-Authored-By: Martin Milata <martin@martinmilata.cz>
2022-02-15 13:28:03 +01:00
Andrew Kozlik
d52a59e37b feat(core): Show "signature is valid" dialog when VerifyMessage succeeds. 2022-02-11 15:36:00 +01:00
Andrew Kozlik
4d40d6dbfc feat(core): Support Electrum signatures in VerifyMessage. 2022-02-11 15:36:00 +01:00
Andrew Kozlik
473657fd44 chore(core): Tweak validation of pre-authorized GetOwnershipProof.
In pre-authorized GetOwnershipProof requests ensure that the commitment data
starts with a length-prefixed name of the CoinJoin coordinator.

[no changelog]
2022-02-11 13:56:27 +01:00
Martin Milata
80655747d0 test(core/rust/ui): pagination unit test
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
ab0eef5de0 fix(core/rust/ui): adjust spacing for confirm_action
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
5378492ea9 chore(core/rust): wireframe rendering for ui debugging
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
10650af1fa refactor(core/rust/ui): paragraphs breaking
Also fix corner case.

[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
b5da6dc911 refactor(core/rust): geometry/display API improvements
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
f2b8822d76 refactor(core): improve build-time option for old/new UI
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
b64c69c3ff feat(core/rust/ui): implement confirm_action
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
6d1227d839 feat(core/rust/ui): SwipePage: add buttons, auto-disable scrolling
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
695d80bf54 refactor(core/rust/ui): uPy buffer support for TT buttons
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
f167a2bef2 feat(core/rust/ui): add model T title bar
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
c7b33e2bc0 feat(core/rust/ui): add new icons
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
b46901bc8b feat(core): add TT Hoves fonts, introduce medium variant
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>

[no changelog]
2022-02-10 14:57:42 +01:00
matejcik
abc593d19a tests: drop skip_ui support 2022-02-08 16:34:54 +01:00
Jan Pochyla
d979efc3ca chore(core/rust): Try to simplify pagination a bit
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
8fb28e4af5 feat(core/rust): impl Paginate for Paragraphs
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
f29ccf6009 fix(core/rust): UI tweaks
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
48f29ee0b9 refactor(core/rust): return bounding box after laying out text
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
7271606ca2 feat(core): smaller debug square on T1
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
bea696dfc9 feat(core/rust): Paginated for T1
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
19b2358084 refactor(core/rust): T1 title bar
[no changelog]
2022-02-08 15:40:37 +01:00
Martin Milata
7f224ab36d refactor(core/rust): model-agnostic Paginated
[no changelog]
2022-02-08 15:40:37 +01:00
matejcik
c236dfc814 style(core): type object doesn't have __slots__ 2022-02-08 14:27:23 +01:00
matejcik
a1c62098e9 fix(core/ethereum): implement hold-to-confirm for eip1559 transactions 2022-02-08 14:27:23 +01:00
grdddj
5d76144ef5 chore(common): always use resolve() when accessing parent of the Path
[no changelog]
2022-02-07 14:05:27 +01:00
Jan Pochyla
a3c79bf4f7 feat(core/rust): Add Paginated component 2022-02-01 10:51:02 +01:00
Jan Pochyla
a7a305d34d fix(core/rust): Fix request_complete_repaint for components without any Child descendants 2022-02-01 10:51:02 +01:00
Jan Pochyla
129363f080 feat(core/rust): Add Trace to Paragraph[s], improve size calculation 2022-02-01 10:51:02 +01:00
Jan Pochyla
d2c8c66385 feat(core/rust): First shot at Paragraphs API 2022-02-01 10:51:02 +01:00
Jan Pochyla
8c47b94b79 feat(core/rust): Add experimental LinearLayout 2022-02-01 10:51:02 +01:00
Jan Pochyla
3dd3d7f87b feat(core): Add HoldToConfirm example, improve Loader and animation frame support 2022-02-01 10:51:02 +01:00
Jan Pochyla
117a0bd518 feat(core): Add preliminary anim frame support 2022-02-01 10:51:02 +01:00
Jan Pochyla
be3e99b96d feat(core): Add WiP Loader & generic Animation type 2022-02-01 10:51:02 +01:00
matejcik
87a7e94f5c feat(core/rust): add saturating multiplication by f32 to Duration 2022-02-01 10:51:02 +01:00
Andrew Kozlik
83686d1be2 chore(core): Add HashContextInitable protocol class. 2022-01-31 18:00:22 +01:00
Andrew Kozlik
f17a435cdf refactor(core): Rename bitcoin_varint to compact_size. 2022-01-31 18:00:22 +01:00
Andrew Kozlik
0e58218f5f feat(core): Implement Bitcoin payment requests. 2022-01-31 18:00:22 +01:00
Andrew Kozlik
d0c3a6a2fa chore(core): Add mac field to Address message.
[no changelog]
2022-01-31 18:00:22 +01:00
Andrew Kozlik
2ac3d0acb4 feat(core): Implement GetNonce command. 2022-01-31 18:00:22 +01:00
Andrew Kozlik
0959947a88 chore(common): Add GetNonce, Nonce and TxAckPaymentRequest message.
[no changelog]
2022-01-31 18:00:22 +01:00
Jan Pochyla
baffe8fdf3 chore(core/rust): Add int variant to tracing 2022-01-28 09:58:49 +01:00
Jan Pochyla
5b0686f09a chore(core/rust): Forbid unsafe in components
To be expanded to other modules.
2022-01-28 09:58:49 +01:00
Jan Pochyla
12deedf3f6 chore(core/rust): Add backlight fading fn 2022-01-28 09:58:49 +01:00
Jan Pochyla
a54ca9cb05 chore(core/rust): Add micropython::time::sleep 2022-01-28 09:58:49 +01:00
Jan Pochyla
334a143b76 chore(core/rust): Split FormattedText into separate mod 2022-01-28 09:58:49 +01:00
Jan Pochyla
d5a74a8614 chore(core/rust): Rename Text to FormattedText 2022-01-28 09:58:49 +01:00
Jan Pochyla
39263144b7 chore(core): Various little improvements in Rust UI 2022-01-28 09:58:49 +01:00
Jan Pochyla
998210d569 feat(core): Add Instant and Duration types 2022-01-28 09:58:49 +01:00
grdddj
8524f4b6ba feat(ui): InfoConfirm layout accepting DebugLinkDecision
[no changelog]
2022-01-27 13:15:04 +01:00
Andrew Kozlik
ba4f046d6f feat(common): Add INFO button to DebugLinkDecision.
[no changelog]
2022-01-27 13:15:04 +01:00
Pavol Rusnak
37bd121394 chore(core/embed): check for negative values in trezor_get_uint
[no changelog]
2022-01-26 16:22:50 +01:00
Martin Milata
98b1159b0b Merge branch 'release/22.01'
Conflicts:
	core/src/apps/ethereum/tokens.py
2022-01-19 15:24:51 +01:00
Andrew Kozlik
ebc07fd6db ci: Suppress libSDL memory leaks.
[no changelog]
2022-01-19 15:22:03 +01:00
Andrew Kozlik
49ae8848db fix(core): Fix memory leaks in emulator.
[no changelog]
2022-01-19 15:22:03 +01:00
Andrew Kozlik
39b64b8569 fix(core): Fix stack-use-after-scope in display.c.
[no changelog]
2022-01-19 15:22:03 +01:00
Martin Milata
e3541997f0 ci(core): run nightly device tests with AddressSanitizer
[no changelog]
2022-01-19 15:22:03 +01:00
Pavol Rusnak
4a71d15b1d chore(core/embed): refactor trezor_obj_get_uint64 into trezorobj.h
[no changelog]
2022-01-19 11:16:47 +01:00
Alois Klink
5c4703c9bb fix(core,legacy): Fix domain-only ethTypedData
When doing Ethereum signTypedData, and the primaryType="EIP712Domain",
we completely ignore the "message" part and only sign the domain.

According to the community, this is technically allowed by the spec,
and may be used by ETH smart contracts to save on gas.

Test case generated by @MetaMask/eth-sig-util's library.

See: https://ethereum-magicians.org/t/eip-712-standards-clarification-primarytype-as-domaintype/3286
2022-01-14 14:22:46 +01:00
Andrew Kozlik
cdf2129b73 fix(core): Fix proof of ownership sighash computation. 2022-01-10 11:14:36 +01:00
Andrew Kozlik
88a08e3512 chore(core): Increase maximum CoinJoin coordinator name length to 36 (2 lines). 2022-01-10 11:14:36 +01:00
matejcik
e20879189f style(core): remove old-style annotations (Set, Tuple, Union) 2022-01-07 21:41:17 +01:00
matejcik
5e1dce35b3 style(core): remove unused type:ignore comments 2022-01-07 21:41:17 +01:00
matejcik
80f6463799 style(core): define obj_eq and obj_repr so that they pass type-check 2022-01-07 21:41:17 +01:00
matejcik
456959545c docs(core): add changelog for type-checking 2022-01-07 21:41:17 +01:00
matejcik
228c4db646 style(core): improve types in rlp.py 2022-01-07 21:41:17 +01:00
matejcik
8d8cfd6692 build: fully replace mypy with pyright
[no changelog]
2022-01-07 21:41:17 +01:00
matejcik
45787307ca style(core): support AnyStr in all hash function arguments 2022-01-07 21:41:17 +01:00
matejcik
dec89ea59e refactor(core): convert if/elif chains to if-chains
This way AST parsers won't get stack exceeded (because an elif counts as
an else { if {}} to an AST parser apparently?) and so automated tools
will like tokens.py and friends.
2022-01-07 21:41:17 +01:00
matejcik
c3f2db3be5 refactor(core): improve type signature of bech32.convertbits 2022-01-07 21:41:17 +01:00
grdddj
9fc5bb546b style(core): full pyright-based type-checking
Changes many fields to required -- as far as we were able to figure out,
signing would fail if these fields aren't provided anyway, so this
should not pose a compatibility problem.

Co-authored-by: matejcik <ja@matejcik.cz>
2022-01-07 21:41:17 +01:00
matejcik
9c5945a888 chore(core): add fake typing module (not included in build) 2022-01-07 21:41:17 +01:00
matejcik
1bfaec10e9 build(core): rewrite build_mocks with pathlib, add symlinks to ../mocks 2022-01-07 21:41:17 +01:00
matejcik
bda1fa9912 build(core): exclude all "from typing" imports from build 2022-01-07 21:41:17 +01:00
FujiCoin
33c243be8d
feat(common): enable taproot for Fujicoin, fix xpub versions
* fix fujicoin params

* add test_fujicoin/test_send_p2tr

* fix test

* fix serialized_tx.hex()

* Recreated based on a new transaction

* make gen, some fixes

Co-authored-by: matejcik <ja@matejcik.cz>
2022-01-05 12:43:34 +01:00
Pavol Rusnak
b0e0280465 chore: drop obsolete fw_vendor_keys field from Features
[no changelog]
2022-01-03 14:23:58 +01:00
Pavol Rusnak
35d40cc164 fix(core): change logic of vendor header comparison
Previously we checked whether the current vendor header and
the new vendor header are the same by comparing the embedded keyset.

What originally looked like a good idea is not that good, because
this disallows us from ever changing the vendor header signing keys
without causing erasure of the storage during the version update.

This commit fixes that by changing the logic to comparing just the
vendor string.

Change of function names is purely cosmetic:
* vendor_keys_hash -> vendor_header_hash
* check_vendor_keys_lock -> check_vendor_header_lock
2022-01-03 14:23:58 +01:00
Martin Milata
3f12742669 chore(common): update coin support status 2021-12-28 12:42:43 +01:00
Martin Milata
c0dbcf37e4 chore(common): update chains and tokens 2021-12-28 12:42:43 +01:00
gruve-p
3ab036a1d1
feat(common): enable Taproot on Groestlcoin
Add additional device tests for GRS

Add P2TR GetAddress for GRS mainnet and testnet

Add SignTX spending taproot UTXO (The resulting transaction from the SignTx device test was successfully mined on Testnet.)
2021-12-20 22:49:36 +01:00
Alisina Bahadori
77ab865386 feat(legacy): Implement EIP-712 signing 2021-12-19 20:36:30 +01:00
Carlosbogo
dd1240ef53
docs: update links in changelogs (#2013)
fixes #2011
2021-12-17 14:53:21 +01:00
Pavol Rusnak
56f0e2c5de
fix(core): add missing include
we were using `FILE` and `fprintf` without including the stdio header
2021-12-14 19:57:21 +01:00
Pavol Rusnak
30a77a76bc
chore(legacy): rename MEMORY_PROTECT flag to PRODUCTION to match core naming (#2003) 2021-12-12 15:45:10 +01:00
Martin Milata
ff5f965c44 Merge branch 'release/21.12'
Conflicts:
	tests/device_tests/test_msg_signtx_invalid_path.py
	tests/ui_tests/fixtures.json
2021-12-08 14:53:56 +01:00
Martin Milata
1734957685 build(core): update rust edition to 2021
[no changelog]
2021-12-07 17:12:43 +01:00
Andrew Kozlik
ef5994d9f3 feat(core): Support ownership proofs for Taproot addresses. 2021-12-06 18:23:48 +01:00
Martin Milata
e9fd1fc49f build(core/emulator): build with -fPIE
Otherwise "cargo test" fails with errors like:

   Compiling trezor_lib v0.1.0 (embed/rust)
error: linking with `cc` failed: exit status: 1
  |
  = note: ld: build/unix/rust/debug/build/trezor_lib-a046f8e3db087595/out/libcore_lib.a(obj.o): relocation R_X86_64_32S against `.rodata.types.1' can not be used when making a PIE object; recompile with -fPIE
2021-12-06 16:25:59 +01:00
Martin Milata
38c526719c chore(core): bump version to 2.4.4
[skip_ci]
2021-12-01 14:45:47 +01:00
matejcik
949dfe1f5d docs(core/cardano): add derivation scheme docs 2021-11-29 13:34:01 +01:00
Ondřej Vejpustek
f664734060 test(core): add unit tests for bip340 2021-11-26 20:16:59 +01:00
Ondřej Vejpustek
046beb4fde test(core): fix secp256k1 unit tests 2021-11-26 20:16:59 +01:00
Martin Milata
7cc9f13605 refactor(core/rust): allow model_t1 and model_tt at once
[no changelog]
2021-11-24 15:36:34 +01:00
Martin Milata
52f719ad81 ci: add core unit test t1
[no changelog]
2021-11-24 15:36:34 +01:00
Martin Milata
afd7cb3b01 feat(core/rust): add example layout for T1
[no changelog]
2021-11-24 15:36:34 +01:00
Martin Milata
4d60c10330 feat(core/rust): add support for T1 UI
[no changelog]
2021-11-24 15:36:34 +01:00
Martin Milata
3c49ef2f62 feat(core/rust): exposing vararg functions to uPy
[no changelog]
2021-11-24 15:36:34 +01:00
Ondrej Mikle
219e08d81e build(core): keep bootloader image even for non-production builds
[no changelog]
2021-11-23 16:29:38 +01:00
Martin Milata
595b14254c docs(core): changelog for 2.4.3 2021-11-23 14:57:25 +01:00
Andrew Kozlik
9052133fca fix(core): Ensure user is warned about non-standard paths. 2021-11-23 14:57:25 +01:00
Martin Milata
aa3784f726 build(core): place secp256k1-zkp in FLASH2 to make space for bootloader
[no changelog]
2021-11-23 14:51:11 +01:00
Martin Milata
d656f88572 style(all): reformat with clang-format 13.0 2021-11-19 10:54:31 +01:00
Ondřej Vejpustek
ad38d8e324 refactor(crypto,core): make zkp_context_init() return status 2021-11-18 19:05:40 +01:00
Ondřej Vejpustek
f918cf9a27 fix(core): fix typos in modtrezorcrypto-bip340.h 2021-11-18 19:05:40 +01:00
Ondřej Vejpustek
3612620268 build(crypto,core): make secp256k1-zkp context as small as possible 2021-11-18 19:05:40 +01:00
Andrew Kozlik
221977ad9d chore(core): Convert SIGHASH_* consts to SigHashType enum. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
aaceb5bcc6 chore(core): Remove USE_SECP256K1_ZKP_BIP340 build option. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
ae35086bb9 refactor(core): Rename Hash143 to SigHasher and replace preimage_hash() with two functions. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
398cea8f40 test(core): Add unit tests for BIP-341 signature hash. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
03b1b3bc6b feat(core): Show path warning for SignMessage. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
ef2ad57ec8 fix(core): Fix CoinJoin approval check.
After fixing the TxWeightCalculator the approver needs to account for the
weight of the coordinator's output.
2021-11-13 13:33:46 +01:00
Andrew Kozlik
56ac799626 feat(core): Support external inputs in TxWeightCalculator. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
f9f0b517e2 feat(core): Support Taproot in TxWeightCalculator. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
a635876807 test(core): Add multisig unit tests for TxWeightCalculator. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
9b579094c0 fix(core): Fix TxWeightCalculator.
- Refactor TxWeightCalculator to count inputs and outputs itself.
- Fix witness data weight by adding the weight of the witness stack item count
  for each input in segwit transactions and removing the weight of the
  nonsensical extra inputs count.
- Get multisig pubkey count from multisig.nodes or multisig.pubkeys like in
  multisig_get_pubkeys().
- Fix size of multisig script length encoding in segwit (varint vs. OP_PUSH).
- Improve comments.
2021-11-13 13:33:46 +01:00
Andrew Kozlik
a5bd1643fc fix(core): Fix OP_PUSH writing. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
7653efb415 chore(core): Disable Taproot for altcoins. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
c0f853dc78 chore(core): Disable ownership proof generation for Taproot. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
475b95b11e feat(core): Disable prevtx streaming for Taproot. 2021-11-13 13:33:46 +01:00