matejcik
4035aad51b
core: implement auto-lock after a configurable timeout ( fixes #75 )
2020-06-04 16:18:46 +02:00
matejcik
67b723e4ca
core: add a global idle timer
2020-06-04 16:18:46 +02:00
Andrew Kozlik
5469acfabf
core/webauthn: Cache user verification for 3 minutes.
2020-06-04 16:18:46 +02:00
Andrew Kozlik
b867ac1d01
core/webauthn: Implement FIDO2 unlocking from softlock.
2020-06-04 16:18:46 +02:00
Andrew Kozlik
0f81886c9f
core/webauthn: Allow confirm_dialog() to return a new state as an alternative to the user response.
2020-06-04 16:18:46 +02:00
Andrew Kozlik
c8ae5c157e
core/webauthn: Implement U2F unlocking from softlock.
2020-06-04 16:18:46 +02:00
matejcik
06aed7135a
core: do not prompt for PIN just to lock the device again
2020-06-04 16:18:46 +02:00
matejcik
2cedc687e6
core: disable trezor-crypto BIP32 cache
2020-06-04 16:18:46 +02:00
matejcik
246998910a
core: refactor usage of input_signals
...
this prevents a certain class of UI test failure. It also localizes the
use of debuglink signals into the layout classes instead of call sites,
which is a design we were already using for confirm_signals
2020-06-04 16:18:46 +02:00
matejcik
afeeafd5cd
core: hide some fields when softlocked
2020-06-04 16:18:46 +02:00
matejcik
b9bd9ea3d0
core: only softlock when PIN is set
2020-06-04 16:18:46 +02:00
matejcik
a9ddc2a8e2
core/boot: modify initial lockscreen label
2020-06-04 16:18:46 +02:00
matejcik
09af8aed4e
core: consider lockscreen to be a separate homescreen
...
this involves some changes to the workflow defaults:
* workflow.start_default() takes no arguments
* workflow.set_default() (originally replace_default) configures the
default that will be started by next call to start_default().
The intended usecase is to set_default() first and then start it
separately.
* apps.base.set_homescreen() factors out the logic originally in
main.py, that decides which homescreen should be launched. This uses
set_default() call. start_default() is then used explicitly in main.py
2020-06-04 16:18:46 +02:00
matejcik
d73480bc9d
core: introduce PIN soft-locking
2020-06-04 16:18:46 +02:00
matejcik
04c8b2803d
core: refactor homescreen app, include lockscreen in it
2020-06-04 16:18:46 +02:00
matejcik
9197623d83
core: factor out the decision whether to lock the device
2020-06-04 16:18:46 +02:00
matejcik
0600d87c8c
common: rename ClearSession to LockDevice, introduce EndSession
2020-06-04 16:18:46 +02:00
matejcik
32fcc4ad9c
core: make verify_user_pin accept a Context argument
2020-06-04 16:18:46 +02:00
matejcik
8ca7ffc3b8
core: use wire.PinCancelled/PinInvalid instead of custom versions
...
also refactor show_pin_invalid and its usages so that it raises directly
note that we are now using PinCancelled instead of ActionCancelled where
appropriate
2020-06-04 16:18:46 +02:00
matejcik
eabfcab9b9
core: add default messages to some error codes
2020-06-04 16:18:46 +02:00
matejcik
341c5b7d10
core/wire: make handler lookup pluggable
2020-06-04 16:18:46 +02:00
matejcik
837c4df61f
core: expose storage_is_unlocked() as config.is_unlocked()
2020-06-04 16:18:46 +02:00
matejcik
87433995b0
core: add BITCOIN_ONLY to mock file
2020-06-04 16:18:46 +02:00
matejcik
d5e45c02bb
core: move base functions from "homescreen" app to "base"
2020-06-04 16:18:46 +02:00
Tomas Susanka
8859d103f4
core, legacy: bump versions
2020-06-03 15:39:25 +00:00
Tomas Susanka
e2629eb921
core, legacy: update Changelogs to reflect the release
2020-06-03 15:35:30 +00:00
matejcik
bd5b3a3f21
common: drop Theta and VeChain ERC tokens, refresh market caps
...
fixes #1022
fixes #1023
2020-05-29 12:12:30 +02:00
matejcik
5209804fc3
core: relax path checks on GetPublicKey
...
(cherry picked from commit 554d8949f5
)
2020-05-27 06:58:30 +00:00
matejcik
554d8949f5
core: relax path checks on GetPublicKey
2020-05-27 08:56:50 +02:00
matejcik
d59ffe553f
make gen
2020-05-25 16:14:05 +02:00
Ondřej Vejpustek
24ceb0ab6b
crypto/bignum: change limb size to 29, add tests
2020-05-24 14:36:38 +00: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
Andrew Kozlik
7db3e930d4
core/sign_tx: Add further message sanitization checks.
2020-05-24 14:36:37 +00:00
matejcik
72ef86d79a
all: enable extra_data for komodo
2020-05-24 14:36:37 +00:00
matejcik
7a3637d5b0
core/sign_tx: add checks for version_group_id and branch_id fields
2020-05-24 14:36:37 +00:00
Ondrej Mikle
b01b24f090
core: change startup firmware file from .s to .S which enables preprocessing and fixes TT boot
2020-05-24 12:28:38 +02:00
Tomas Susanka
675ff459db
core, legacy: update changelogs
2020-05-22 11:55:55 +00:00
Tomas Susanka
9dfc08ca61
core/bitcoin: drop decred_script_version
2020-05-21 19:14:39 +02:00
matejcik
eeb46eabca
common: refresh token list
2020-05-21 13:29:13 +02:00
matejcik
2f665c8f84
core: add exception to GetPublicKey for PSBT master fingerprint ( fixes #999 )
2020-05-21 13:26:53 +02:00
Ondrej Mikle
10f0f107e0
core: Adds T1 core port FW flashing options for for openocd and jlink
2020-05-21 10:05:12 +02:00
Ondrej Mikle
0d65d684f0
core: T1 port can run on T1 bootloader with MEMORY_PROTECT=0
2020-05-21 08:49:59 +02:00
Tomas Susanka
a2f790167d
core/bitcoin: fix step 1 and 2 comments in signing
2020-05-19 12:58:45 +00:00
Tomas Susanka
1ac0f60550
core: update isort config to place relative imports last
2020-05-18 14:31:51 +02:00
Tomas Susanka
aa115b6320
core: move decred writers to decred.py
2020-05-18 14:31:51 +02:00
Tomas Susanka
3084ee1eed
core/bitcoin: move write_bitcoin_varint to common writers
2020-05-18 14:31:51 +02: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
050936d0d7
core: enable finalizers on extmod classes
2020-05-18 14:31:00 +02:00
matejcik
123b07e3ad
core: drop support for pre-registering keychain namespaces
2020-05-15 16:30:41 +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
f3f6e2101a
core/cardano: explanation about seed derivation
2020-05-15 14:08:29 +02:00
matejcik
a31b2cd1bc
core/wallet: implement keychain for apps.wallet
2020-05-15 14:08:29 +02:00
matejcik
0dff3853a7
core/ethereum: introduce custom keychain decorators
2020-05-15 14:08:29 +02:00
matejcik
b594248ac2
core: use new keychain decorators where appropriate
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
7541d529a3
core: refactor keychain API, introduce SLIP44 decorator
2020-05-15 14:08:29 +02:00
matejcik
8c4cb58098
core: introduce caching decorators
2020-05-15 14:08:29 +02:00
matejcik
63dfcb17a7
core: make mypy happy about importing fatfs
2020-05-15 14:08:29 +02:00
matejcik
7f2e7b0003
core: add Ethereum constants to mocks
2020-05-15 14:08:29 +02:00
Pavol Rusnak
6704ed86a1
Merge pull request #995 from trezor/omikle/t1-core-port
...
core port to Trezor One
2020-05-14 16:48:18 +02:00
Ondrej Mikle
7eddafe487
core: better formatting for common parts of T1 and TT header
2020-05-14 16:10:42 +02:00
Ondrej Mikle
c4c341b3f9
core: setup stack when running core on T1
2020-05-14 12:46:25 +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
Tomas Susanka
25d2d130a0
tests: use maxfail
option for fido2 tests
2020-05-12 09:48:23 +00:00
Ondrej Mikle
fb5a220b46
core: use legacy sign script for T1 core port binary to be flashable
2020-05-11 18:05:46 +02:00
Ondrej Mikle
e429085e96
core: copy firmware header for T1 port into final binary
2020-05-11 17:33:47 +02:00
Ondrej Mikle
d8115a7992
core: firmware header for T1 port
2020-05-11 15:43:43 +02:00
Tomas Susanka
53c43ac305
core/tests: initialize emu with slip14 before running fido2 test suite
2020-05-06 14:36:04 +00:00
Andrew Kozlik
3de565c33c
core/sign_tx: In write_tx_header() rename has_segwit parameter to witness_marker and clarify usage.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
846116a666
core/sign_tx: Improve comments.
2020-05-06 13:18:32 +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
04bdf1dc6c
core/sign_tx: Remove unused index parameters.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
c9814e50ba
core/sign_tx: Set decred_script_version to 0 by default for decred coins.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
dccf415e0b
core/sign_tx: Add write_tx_output() to signer class and override it in Decred.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
bdd1d25979
core/sign_tx: Require change-outputs to be for a non-zero amount.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
d5faeb3f51
core/sign_tx: Clarify sign_nonsegwit_input().
2020-05-06 13:18:32 +02:00
matejcik
9005093435
core/sign_tx: improve documentation on MatchCheckers
2020-05-06 13:18:32 +02:00
matejcik
0209768ff2
core/sign_tx: improve type hints
2020-05-06 13:18:32 +02:00
matejcik
ff41e5c304
core/sign_tx: improve signer selection readability
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
6ad3baeab2
core/sign_tx: Refactor BIP-143 signing.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
d58cd3987b
core/sign_tx: Minor updates based on code review.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
be39f271b0
core/sign_tx: Rework transaction footer writing.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
b60f267da9
core/sign_tx: Rework transaction header writing.
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
Andrew Kozlik
be7e98aa47
core/sign_tx: Move Bitcoin class to bitcoin.py.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
a07e125793
core/sign_tx: Consolidate wallet path and multisig fingerprint checking.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
27e6720f3d
core/sign_tx: cleanup
2020-05-06 13:18:32 +02:00
Andrew Kozlik
987b70f1f5
core/sign_tx: Move header prepending up by one level.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
2ceb091d68
core/sign_tx: Use a preallocated buffer for transaction serialization.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
555259d6a9
core/sign_tx: Remove last_output_bytes in Decred, which is no longer needed.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
f1801764a1
core/sign_tx: Fix segwit/non-segwit input interleaving bug.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
514f2ac649
core/sign_tx: Refactor to use template method.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
95fad83024
core/sign_tx: Derive Zip143 and DecredPrefixHasher from Bip143.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
e9900df18d
core/sign_tx: Move Overwintered class to zcash.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
60dbec95ac
core/sign_tx: Reuse get_prevtx_output_value() in Decred.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
2b74513e49
core: Fix mypy.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
50c08274b9
core/sign_tx: Move overwintered functionality to separate class.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
c190eed7fc
core/sign_tx: Move non-Bitcoin functionality to Bitcoinlike class.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
613c81ea66
core/sign_tx: Refactor wallet_path functions and input_check_multisig_fingerprint.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
0d9984671e
core/sign_tx: Fix typing.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
79c60615de
core: Fix typing.
2020-05-06 13:18:32 +02:00
Andrew Kozlik
ba8b34b2d7
core: Refactor signing.
2020-05-06 13:18:32 +02:00
Pavol Rusnak
066866488b
core: add temporary "src1" folder
2020-05-04 16:00:29 +00:00
matejcik
a623799a11
core: remove f-strings from headertool (python 3.5 compatibility)
2020-05-04 11:29:03 +02:00
Pavol Rusnak
25cc836660
core/extmod: fix build of modtrezorui when TREZOR_MODEL is set to '1'
2020-04-30 15:07:26 +00:00
Tomas Susanka
20d66adddd
core: disable passphrase_always_on_device when turning off passphrase
2020-04-28 14:54:18 +02:00
Tomas Susanka
47f104bceb
core, legacy: bump versions
2020-04-24 17:12:20 +00:00
Pavol Rusnak
4b5a84eab7
core+legacy: update changelogs
2020-04-16 14:20:18 +02:00
Ondřej Vejpustek
c461692f3a
core: implement random delay interrupts
2020-04-16 11:51:28 +02:00
Ondřej Vejpustek
d5bfe6b32f
crypto: add chacha_drbg
2020-04-16 11:51:28 +02:00
matejcik
72cde5a57d
core: disallow parsing options after command ( fixes #951 )
2020-04-16 11:24:15 +02:00
matejcik
5885978c83
Merge branch 'release/2020-04'
2020-04-15 15:00:23 +02:00
Andrew Kozlik
9e4a8ca785
core/webauthn: Improve error codes for uninitialized device. Return ERR_OPERATION_DENIED only upon user decline or timeout, otherwise it cancels the operation on all connected authenticators.
2020-04-14 12:24:17 +02:00
matejcik
2ccebd3175
core: raise SystemExit when exitting emulator (now that sys.exit is removed)
2020-04-14 10:17:37 +02:00
matejcik
4bddeefea0
core: unify mpconfigports for emulator and board
...
Changes in firmware/mpconfigport.h are minimal:
* $VFS_FAT is dropped because it is irrelevant without $VFS
* $REVERSE_SPECIAL_METHODS is added, to push down on code size
* $THREAD is disabled unconditionally
unix/mpconfigport.h is reordered and modified to match
firmware/mpconfigport.h as much as possible, while selectively enabling
some needed features.
Notably, $USE_READLINE is enabled unconditionally
2020-04-14 10:17:37 +02:00
matejcik
d0f709b8cc
core: fix and use MAKEMODULEDEFS instead of explicit registration
2020-04-14 10:17:37 +02:00
matejcik
a6976355c3
core: remove readline from built firmware
2020-04-14 10:17:37 +02:00
Dusan Klinec
25b6e9058f
xmr: proto - add fields for protocol optimization
2020-04-13 22:19:56 +02:00
Andrew Kozlik
bc4e8eaa16
core/webauth: Update readme with Ed25519 algorithm and certificates.
2020-04-09 21:05:28 +02:00
Pavol Rusnak
197218338a
Merge pull request #936 from trezor/rework-serialize-deserialize
...
crypto: rework serialize/deserialize API
2020-04-09 09:53:23 +02:00
matejcik
eec0615444
core: drop sys.pyi from mocks ( fixes #934 )
...
A change introduced in mypy 0.770 disallows overriding some system
modules, including `sys`.
We only need the override for `sys.print_exception`, and the simplest
solution is to make mypy ignore that particular call.
2020-04-08 11:19:26 +02:00
Andrew Kozlik
c57bc62a05
core/tools: Add attestation certificate generator for FIDO2.
2020-04-06 18:29:05 +02:00
Andrew Kozlik
fca92d7344
core/webauthn: Update attestation certificate to comply with WebAuthn requirements.
2020-04-06 18:29:05 +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
Pavol Rusnak
f07ff17fad
core/crypto: add missing field to Blake2b constructor
2020-04-06 12:28:36 +00:00
Andrew Kozlik
25a39ea729
core/webauthn: Fix handling of interleaving frames to comply with the U2F HID specification.
2020-04-06 09:53:42 +02:00
jagdeep sidhu
e58c5f63d5
common/defs: update SYS ( #928 )
2020-04-02 00:22:47 +02:00
Tomas Susanka
0b7a8449f8
core: style
2020-03-30 16:04:05 +00:00
Tomas Susanka
bf20537f41
core: add option to omit cancel button in HoldToConfirm; add it to reset
2020-03-30 16:00:12 +00:00
Pavol Rusnak
336a417233
core/bootloader: distinguish between a vendor change and downgrade with wipe
2020-03-25 15:15:12 +01:00
Andrew Kozlik
8ae0535e69
core/webauthn: Fix attestation statement format to use a list in the x5c field.
2020-03-24 16:18:37 +01:00
Tomas Susanka
aa71c20f2c
core: require hold to confirm
2020-03-24 09:20:10 +00:00
Ondrej Mikle
634ed5aabc
core: commands for flashing via JLink ( #911 )
2020-03-23 10:40:06 +01:00
Tomas Susanka
025436db47
core/changelog: add FIDO2's Ed25519
2020-03-23 08:00:31 +00:00
Tomas Susanka
f786d75a6f
core: drop obsolete check for ANYONECANSPEND segwit outputs
2020-03-20 14:19:31 +00:00
Tomas Susanka
d0d41c884e
legacy: move script type checks to separate functions and unify with core
2020-03-20 14:19:31 +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
da89a17ce5
all: add checks for prev_hash size
2020-03-20 14:19:31 +00:00
matejcik
c15519f707
core/sign_tx: modify get_tx_header to avoid writing unchecked bytes
2020-03-20 14:19:31 +00:00
matejcik
9cab61fbd3
core/sign_tx: remove write_bytes_unchecked where appropriate
2020-03-20 14:19:31 +00:00