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

265 Commits

Author SHA1 Message Date
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
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
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
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
cdf2129b73 fix(core): Fix proof of ownership sighash computation. 2022-01-10 11:14:36 +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
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
Andrew Kozlik
ef5994d9f3 feat(core): Support ownership proofs for Taproot addresses. 2021-12-06 18:23:48 +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
Andrew Kozlik
9052133fca fix(core): Ensure user is warned about non-standard paths. 2021-11-23 14:57:25 +01:00
Andrew Kozlik
221977ad9d chore(core): Convert SIGHASH_* consts to SigHashType enum. 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
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
381e8bc85a feat(core): Implement the BIP-341 common signature message computation. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
99e4ed6f42 chore(core): Support script_pubkey parameter for Bitcoin inputs. 2021-11-13 13:33:46 +01:00
matejcik
72924a016f tests(core): add unit tests for Icarus and Icarus-Trezor, fix failing tests 2021-11-10 13:57:57 +01:00
grdddj
73238135d6 feat(core/ethereum): EIP-712
Based on original contribution by Max Kupriianov <xlab@hey.com>

Implemented EIP-712 typed data signatures in Ethereum app.

Add eth_abi into pyproject deps

device test for EIP 712

fixed hex decoding for address

fixup! fixed hex decoding for address

code quality, more pythonic code, removing unused imports

running black and isort on changed files

trezorctl file input for EIP 712 data signing

fixup! code quality, more pythonic code, removing unused imports

fixup! fixup! code quality, more pythonic code, removing unused imports

necessary changes after rebase to master

unit tests for sign_typed_data.py

new protobuf messages, working for nonarray types

simplified and verified solution for our simple data

support for simple arrays, without their confirmation

reverting protobuf value messages to bytes, appropriate changes

showing arrays in Trezor, code quality improvements

data validation on Trezor, minor improvements

using custom types for storing type data instead of dicts, addressing feedback from review

moving helper functions to its own file, tests for decode_data

additional overall tests

support for arrays of structs

adding support for metamask_v4_compat variable

using HashWriter object to collect the final hash continously

minor improvements in code quality

validate_field_type function

streaming values from client without saving them, missing UI

prototype of streamed UI using confirm_properties

accounting for bytes in data, more data types in integration tests

rebase on master, using f-strings

minor fixes and improvements from code review

StructHasher class for the whole hashing process

mypy and style changes

asking users whether to show structs and arrays

protobuf descriptions to fix make defs_check

unifying comments, mypy fix

unit tests for StructHasher class

UI fixtures, skipping device tests for T1

addressing majority of code review comments about code quality and structure

changing file structure - layouts, helpers, sign_typed_data

decode_data renaming and docstring, renaming unit test file

using tuples instead of lists in elifs

layout improvements

excluding core/src/apps/common/confirm.py file from the PR

True/False returning layout with Show more button

code review layout improvements

forgotten br_type argument to should_show_more
2021-11-02 14:27:01 +01:00
grdddj
082b7ecd91 feat(core): plural function supports "key/keys" string
Previously function did not work for words ending with "y" and vowel before that
2021-11-02 14:27:01 +01:00
grdddj
b1a3618c17 refactor(core/ethereum): rename address.py to helpers.py 2021-11-02 14:27:01 +01:00
matejcik
1d72085b5c feat(core): implement conversion from timestamp to datetime 2021-10-29 11:00:30 +02:00
Pavol Rusnak
7e64ccbaf9 feat(core): add BIP-350 test cases to test_trezor.crypto.bech32 2021-10-18 13:36:05 +02:00
Pavol Rusnak
a45e103875 fix(core): remove 3 BIP-173 test cases from test_trezor.crypto.bech32
because they encode segwit program > 0 and these should no longer
be encoded with Bech32 but rather with Bech32m
2021-10-18 13:36:05 +02:00
Pavol Rusnak
9aa07c7f96 feat(core): update bech32.py to support Bech32m 2021-10-18 13:36:05 +02:00
amadejpapez
85ba7c12ba style(all): use f-strings for formatting
[no changelog]
2021-10-13 11:53:17 +02:00
gabrielkerekes
1f33ab420d feat(cardano): update transaction signing for multisig 2021-10-11 15:16:24 +02:00
gabrielkerekes
21281d7cf4 feat(cardano): add support for script addresses derivation 2021-10-11 15:16:24 +02:00
gabrielkerekes
dd9652cd07 feat(cardano): add get-native-script-hash call 2021-10-11 15:16:24 +02:00
matejcik
b666895303 feat(core/rust): catch, handle and propagate uPy exceptions 2021-09-21 12:43:31 +02:00
matejcik
e80077e0a4 feat(core/ethereum): enable type-checking for Ethereum app 2021-09-10 15:09:03 +02:00
matejcik
0c2863fc8d feat(core/ethereum): use TokenInfo object instead of tuples 2021-09-10 15:09:03 +02:00
matejcik
96ed53cc1c refactor(core,legacy): remove Wanchain special handling
now that Wanchain has proper chainID and we don't need to detect it by
magic.

[no changelog]
2021-09-10 15:09:03 +02:00
matejcik
639406b01f feat(all): make chain_id mandatory 2021-09-10 15:09:03 +02:00
Martin Milata
f37ca13f1a refactor(core): disable SD, SBU, fatfs for T1 build 2021-08-20 12:22:13 +02:00
gabrielkerekes
28f0f60295 feat(cardano): update tests for streamed tx signing 2021-08-20 11:50:13 +02:00
gabrielkerekes
b0c8590f00 feat(cardano): streamed transaction signing 2021-08-20 11:50:13 +02:00
Martin Milata
574dcbc8a3 refactor(core): convert apps.common to layouts 2021-08-04 15:03:11 +02:00
Pavol Rusnak
f740515c85 fix(core,crypto): add more test cases from bip-173 2021-07-21 11:20:11 +02:00
matejcik
cf15dce326 refactor(core/ethereum): improve API of the rlp module 2021-07-19 13:59:28 +02:00
Andrew Kozlik
3e9f8a32ac fix(core): Fix insufficient BIP-32 path checks.
- Disable testnet coins from accessing Bitcoin paths.

- Restrict BIP-45 paths to Bitcoin and coins with strong replay protection.
2021-06-30 18:25:58 +02:00
gabrielkerekes
3cd2182b69 feat(core): introduce OrderedMap into CBOR serialisation
Items of an OrderedMap are included in CBOR as they come without sorting them in any way.
2021-06-24 08:22:39 +02:00
matejcik
3c4eb04346 feat(core/monero): cache Monero testing chain between runs 2021-06-23 11:51:18 +02:00
matejcik
52c34c7364 fix(core): allow caching empty values (fixes #1659) 2021-06-11 12:32:13 +02:00
gabrielkerekes
597402eab8 refactor(core/cardano): decouple address parameters validation 2021-06-08 15:02:24 +02:00