1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-19 05:58:09 +00:00
Commit Graph

216 Commits

Author SHA1 Message Date
Andrew Kozlik
472e853f0a core/tests: Fix unit tests to work with BasicApprover in sign_tx. 2020-08-04 17:32:44 +02:00
matejcik
c3afb93837 core/tests: improve test harness (fixes #1157) 2020-08-04 10:27:44 +02:00
Pavol Rusnak
063aba910d core: rename emulator to trezor-emu-core 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
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
matejcik
b741560997 core/bitcoin: drop unused validate_path_for_bitcoin_public_key 2020-07-24 16:37:58 +02:00
matejcik
58f460627f core/tests: add unit tests for new functionality 2020-07-24 16:37:58 +02:00
matejcik
a461853cf6 core/tests: fix bitcoin unit tests 2020-07-24 16:37:58 +02:00
matejcik
7befdd07e4 core/tests: update unit tests 2020-07-24 14:09:31 +02:00
matejcik
3514a31bc9 core: make USB codec resilient to OOM conditions 2020-07-24 14:09:31 +02:00
matejcik
0a758b8181 core/tests: add synchronous protobuf tests 2020-07-24 14:09:31 +02:00
Martin Milata
fd117a0c9f core: raise error on auto-lock value out of range 2020-07-22 21:38:42 +02:00
Pavol Rusnak
57ae902aed
core/monero: don't download test binary even if hash is different 2020-07-03 15:18:38 +02:00
Pavol Rusnak
5d666376f0
core/monero: update tests binary 2020-07-03 15:18:38 +02:00
Andrew Kozlik
791ff3fe06 core/tests: Add unit tests for SLIP-0019 proofs of ownership. 2020-07-03 11:17:19 +02:00
Andrew Kozlik
d48a372ca7 core/sign_tx: Implement support for signed external inputs. 2020-07-03 11:17:19 +02:00
Andrew Kozlik
3b6c1e5e6b core/crypto: Add functions for verifying DER encoded signatures. 2020-07-03 11:17:19 +02:00
Andrew Kozlik
99f01cd316 core/sign_tx: Check script_pubkeys of inputs. 2020-07-03 11:17:19 +02:00
Tomas Susanka
a6acefbdf5 core: wipe before reset and recovery; introduce 'intialized' field 2020-06-16 11:31:29 +02:00
Tomas Susanka
56fe5adcfc Merge branch 'release/2020-06' 2020-06-10 06:51:18 +00:00
matejcik
d5e45c02bb core: move base functions from "homescreen" app to "base" 2020-06-04 16:18:46 +02:00
Andrew Kozlik
cb32ae2e4b core/tests: add request_meta queries to unit tests (needed for transaction streaming) 2020-05-24 14:36:38 +00:00
Andrew Kozlik
42eddf8e04 core/sign_tx: validate prevout amount in all cases 2020-05-24 14:36:38 +00:00
Tomas Susanka
445f56d387 core/bitcoin: finalize bitcoin refactor
- core/bitcoin: move common files to the app's root
- core/bitcoin: use require_confirm instead of confirm
- core: move bitcoin unrelated functions from 'bitcoin' to a new 'misc' app
- core/bitcoin: use relative imports inside the app
- core: rename wallet app to bitcoin
- core/wallet: replace SigningErrors and the other exception classes with wire.Errors
2020-05-18 14:31:51 +02:00
matejcik
aa52fc3903 core/extmod: drop unused rfc6979 module 2020-05-18 14:31:00 +02:00
matejcik
3e06f4779a core/tests: add new keychain tests 2020-05-15 14:08:29 +02:00
matejcik
de9e73dcbc core/tests: update unit tests for new keychain API 2020-05-15 14:08:29 +02:00
matejcik
fd9e945308 core/cardano: use caching decorators and new Keychain API for Cardano as well 2020-05-15 14:08:29 +02:00
matejcik
8c4cb58098 core: introduce caching decorators 2020-05-15 14:08:29 +02:00
Dusan Klinec
6b8fc9c894
xmr: major protocol upgrade, CLSAG support added
- CLSAG signature scheme added
  - type hints added

xmr: optimize protocol, send only required data
  - real_out_additional_tx_keys contains only one element as nothing more is needed during signature
  - only src_entr.outputs[index] is HMACed and always present. Other outputs are present only if needed which reduces comm and CPU overhead.
  - getting rid of subaddresses dictionary (memory requirements), now subaddr indices are present per source entry so keys are computed when needed

xmr: prepare for permutation sending removal, specify index
  - specify source entry ordering index prior sorting by key images as original HMAC keys are generated based on these.
  - permutation checked just by valid HMACs, size of the set, key image sort order
  - sending permutation is now deprecated, will be removed in the following protocol versions
  - more strict state transition checks, guard strict check with respect to steps ordering
2020-05-13 11:13:19 +02:00
Andrew Kozlik
7370077d0c core/sign_tx: Get rid of internal TxOutputBinType messages. 2020-05-06 13:18:32 +02:00
Andrew Kozlik
9f9618944a core/sign_tx: Explicitly pass script to write_tx_input() instead of setting it in txi. 2020-05-06 13:18:32 +02:00
Andrew Kozlik
8b89a30955 core/sign_tx: Remove get_prevouts_hash(), get_sequence_hash(), get_outputs_hash() methods from signer classes, because they are only used internally. 2020-05-06 13:18:32 +02:00
Andrew Kozlik
22933587be core/sign_tx: Merge bip143 classes into signer classes. 2020-05-06 13:18:32 +02:00
Andrew Kozlik
c1effcc374 core/sign_tx: Updates based on code review. 2020-05-06 13:18:32 +02:00
Andrew Kozlik
c2a0f83558 core/sign_tx: Move script derivation to scripts module. 2020-05-06 13:18:32 +02:00
Andrew Kozlik
d0b80bddc8 core/tests: Fix unit tests after sign_tx refactor. 2020-05-06 13:18:32 +02:00
matejcik
5885978c83 Merge branch 'release/2020-04' 2020-04-15 15:00:23 +02:00
Pavol Rusnak
a7806d08d7
core/crypto: remove unused bip32.deserialize function 2020-04-06 18:04:24 +02:00
Pavol Rusnak
1695228d80
core/crypto: remove unused serialize_private function 2020-04-06 15:49:36 +00:00
matejcik
bd9e15bb8c core/tests: add unit tests for prevhash writers 2020-03-20 14:19:31 +00:00
matejcik
a9faa4d4ab core/tests: fix inline variant of assertRaises
otherwise code like the following would fail:

>>> self.assertRaises(AssertionError, ensure, False)

because the AssertionError raised internally by `ensure` would be
conflated with the AssertionError raised by the tested function
2020-03-20 14:19:31 +00:00
matejcik
27f6306e1d core: introduce safer write_bytes functions 2020-03-20 14:19:30 +00:00
matejcik
e2035b4972 all: drop Horizen and BIP-115 support [NO BACKPORT] 2020-03-20 14:19:07 +00:00
matejcik
27803ee8c1 all: drop overwintered field from transaction 2020-03-20 14:18:27 +00:00
Andrew Kozlik
e5008eb332 core/webauthn: Remove indistinguishable credentials from the allow list. 2020-03-20 15:07:06 +01:00
Andrew Kozlik
0af0e06d5b core/webauthn: Truncate names in credential data to at most 100 bytes. 2020-03-20 15:07:06 +01:00
matejcik
3789a3372b core/sdcard: modify exception handling in fatfs
expose ff.c constants, raise them as arguments to FatFSError

introduce NotMounted and NoFilesystem as subclasses of FatFSError with
the appropriate error code set
2020-03-20 14:03:28 +01:00
Andrew Kozlik
e378820f7f core/webauthn: Implement support for Ed25519 signatures in FIDO2. 2020-03-12 15:45:26 +01:00
Dusan Klinec
2658e253fa xmr/bp: memory optimizations and improvements
- different approach to vector manipulation - more on the fly operations. Prepared for fully offloaded operations, BP on Trezor with constant memory.
- memory requirements reduced from (4MN + const) to (2MN + const)
- more raw methods to avoid unnecessary encoding/decoding
- chunking improved, chunk size set as a constant, changed from 64 to 32, missing pieces implemented to cover also BP 16
- proof_v8 support discontinued, old hardfork, not needed anymore
- get_exponent register clash fixed (for large vectors)
- reduced heap fragmentation by removing some temporary allocations
- hashing with len and offset to reduce heap fragmentation by creating a sliced arrays
- use to() wherever possible to avoid allocations and return of mutable private object
- global functions start with _ prefix, reduce import footprint
- use __slots__ in classes to minimize footprint
2020-03-02 12:17:03 +01:00
Tomas Susanka
86b010a18b
Merge pull request #878 from trezor/matejcik/fatfs-corruption
FatFS API rework
2020-02-27 15:58:38 +01:00
Tomas Susanka
495a59c282 core: use wire errors instead of ValueErrors where applicable 2020-02-27 10:46:01 +00:00
matejcik
18ac4fc9ca core: update Python facing APIs 2020-02-27 10:56:23 +01:00
matejcik
9ab84d2455 core/tests: thoroughly test modified APIs 2020-02-27 10:56:23 +01:00
matejcik
e9c275c24f core/sdcard: fix invalid state when filesystem mounting fails 2020-02-24 13:28:44 +01:00
Tomas Susanka
6c47bf8230 core: store multiple sessions/caches at the same time 2020-02-21 14:40:42 +01:00
matejcik
918603ad5c core: add unit test for sdcard wrapper 2020-02-20 12:51:48 +01:00
matejcik
7983fd34d6 core: fix unit tests 2020-02-20 12:51:48 +01:00
Pavol Rusnak
07cd73ce57
core: show webusb popup only in bootloader and only if firmware is not installed 2020-02-12 20:47:05 +00:00
Tomas Susanka
2c0504ad1c
Merge pull request #803 from trezor/passphrase
Passphrase Redesign
2020-02-11 16:01:59 +01:00
matejcik
741c0c8888 core: improve stability of Monero test runner 2020-02-11 11:16:28 +01:00
Tomas Susanka
15ed5cd19e
core: do not clear cache on ClearSession 2020-02-07 11:41:03 +00:00
matejcik
3fa99c0c6a
core/tests: add storage.cache tests 2020-02-07 11:41:02 +00:00
matejcik
d4171aaedc
core/tests: extract common await_result() method 2020-02-07 11:41:02 +00:00
Tomas Susanka
bf1514d1ac core/test/strings: add test for words ending with 'hsxz' 2020-01-27 09:11:11 +00:00
Tomas Susanka
0053511c66 utils: introduce format_plural and move format functions to strings.py 2020-01-24 16:25:14 +01:00
matejcik
0496e49507 core/tests: fix monero runner script 2020-01-23 18:43:20 +01:00
matejcik
6cf48bf485 ci: use explicit trezor.log location 2020-01-23 18:43:20 +01:00
matejcik
22c8b2569b core: simplify monero test use of emulator 2020-01-23 18:43:20 +01:00
matejcik
ec192e9406 core: use better emulator test wrappers (fixes #468) 2020-01-23 18:43:20 +01:00
Tomas Susanka
7c41b40dff
tests: introduce UI tests for core with diffs (#784)
tests: introduce UI tests for core with diffs
2020-01-10 20:39:31 +01:00
matejcik
d4eed4b8ff core/tests: update tests for modified slip39 API 2020-01-09 16:00:33 +01:00
Tomas Susanka
51ef963738 tests: introduce UI tests for core 2020-01-03 14:28:27 +00:00
Tomas Susanka
a28f29708f ci: add junit for a nice tests overview 2020-01-03 12:44:12 +00:00
Tomas Susanka
ffea791658
Merge pull request #774 from trezor/tsusanka/shamir-word-checks
Recovery: refactor word checks and add a test
2019-12-30 13:26:07 +01:00
Tomas Susanka
d8e956fc6d core/recovery: change exceptions types; modifications in tests 2019-12-30 11:35:56 +00:00
Tomas Susanka
7f730cb6f9 core/recovery: refactor to exceptions 2019-12-27 19:02:30 +00:00
Tomas Susanka
f4e11a9176 core/recovery: rework arguments 2019-12-27 18:46:22 +00:00
Tomas Susanka
20bcc68926 core/tests: remove utest.py 2019-12-27 13:28:15 +01:00
Tomas Susanka
faa9078c2b core/recovery: refactor word checks and add a test 2019-12-23 13:40:45 +01:00
Tomas Susanka
a316347bf1 core/tests: test debug is on 2019-12-23 12:01:00 +00:00
Tomas Susanka
5677c254b1 core/tests: remove PYOPT settings 2019-12-23 11:51:29 +00:00
Andrew Kozlik
5bdd523b91 vendor: Update fido2-tests submodule to fix issues with random ordering. 2019-11-26 15:18:14 +01:00
Pavol Rusnak
0a0cd797e3
ci/tests: use new Monero tests binary 2019-11-13 16:29:06 +01:00
Pavol Rusnak
cde944b565
Merge branch 'reorder-usb' 2019-11-13 16:23:07 +01:00
Tomas Susanka
20a30ae521 tests/monero: print hash of the monero binary 2019-11-13 14:44:40 +00:00
Pavol Rusnak
2652936c16
core/tests: adapt device_emu_fido2/u2f to reordered usb endpoints 2019-11-13 13:21:39 +01:00
Dusan Klinec
d81f43f7a4 tests: use new monero testing binary v0.15.0.0 2019-11-12 22:53:47 +01:00
matejcik
1397bbfeb5 core/tests: fix test suite after storage move 2019-10-31 16:34:16 +01:00
Tomas Susanka
c1f7239c2d ci: add click and persistence tests 2019-10-25 12:04:14 +00:00
Adrian Nagy
384275ac73
core/tezos: support the new protocol update (005-BABYLON) 2019-10-23 17:53:10 +02:00
Tomas Susanka
b530e7c105 ci: add fido2 tests to ci 2019-10-18 16:54:00 +02:00
Tomas Susanka
1068acae40 core/tests: assert secret in process_slip39 test 2019-10-04 13:47:52 +00:00
Tomas Susanka
75dfcacc21 core/tests: add unit test for process_slip39 function
updates #542
2019-10-03 16:54:35 +02:00
matejcik
861e999425 core: draft unit test for process_slip39 2019-10-03 16:01:01 +02:00
Pavol Rusnak
69142e56e7
core/tests: don't use curl, use wget 2019-09-30 12:46:00 +00:00
Pavol Rusnak
68513a0b39
Merge pull request #538 from trezor/andrewkozlik/fido2-signcount
Disable FIDO2 signature counter for some relying parties
2019-09-19 17:00:51 +02:00
Tomas Susanka
cefb1cf4fd core: refactor slip39 2019-09-19 16:38:29 +02:00