1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 05:03:07 +00:00
Commit Graph

69 Commits

Author SHA1 Message Date
Saleem Rashid
ba5b44d0c5 emulator: Initial commit 2017-12-18 20:09:59 +01:00
Jochen Hoenicke
ded41c484c storage: Padding to multiple of 4 bytes 2017-12-15 14:22:17 +01:00
Saleem Rashid
cfc5fda603 storage: Compact old_storage_size logic 2017-12-15 14:22:17 +01:00
Saleem Rashid
a304b76d34 storage: Clean up old_storage_size
Note that OLD_STORAGE_SIZE(imported) != 460, because
OLD_STORAGE_SIZE does not include end padding
2017-12-15 14:22:17 +01:00
Jochen Hoenicke
5812f9865d
Fix size of version 9 storage 2017-12-14 19:31:29 +01:00
Pavol Rusnak
106642bd44
fix last commit 2017-12-13 17:56:46 +01:00
Jochen Hoenicke
73edc7cb74 Added U2F root key to storage.
Fixes #251.
2017-12-13 17:54:27 +01:00
Jochen Hoenicke
88563ebaa5 Fix compile problem, fix clearing single byte 2017-12-12 19:36:34 +01:00
Pavol Rusnak
f22c849767 storage: rework storage_commit into storage_update 2017-12-12 16:28:42 +01:00
Pavol Rusnak
70843c9059 storage: introduce storageRam and storageRom 2017-12-12 16:28:42 +01:00
Pavol Rusnak
57bbcc754a storage: make storage accessible only via functions
add calls also for debug build and use them in fsm
2017-12-12 16:28:42 +01:00
Pavol Rusnak
18d8cb3c56
add project website (trezor.io) to license header 2017-11-05 17:47:23 +01:00
Jochen Hoenicke
98e617d874
startup: use custom reset_handler
+ group confidential data in one place
+ zero all SRAM where needed
2017-08-16 13:52:01 +02:00
Pavol Rusnak
a01ba51a2a
storage: copy only required bytes from old storage, bump storage version
+ backup_device: ask for pin, always use correct number of words
2017-08-16 13:11:31 +02:00
Pavol Rusnak
f0d2e7a371
storage: bump version 2017-07-31 22:43:28 +02:00
Pavol Rusnak
c778d7b9c3
storage: wipe storage after 15 wrong pins 2017-07-31 02:26:28 +02:00
Pavol Rusnak
3d7d0f0734
use C99 for loop where possible 2017-07-23 22:20:51 +02:00
Pavol Rusnak
cf04279774
implement Storage.flags and related stuff 2017-07-17 18:36:09 +02:00
Pavol Rusnak
ccb0cd82b6
firmware: add changelog, bump version to 1.5.1 2017-07-12 14:19:05 +02:00
Pavol Rusnak
97fa33de46
reset: show needs backup signed when storage is not backed up 2017-06-29 14:14:20 +02:00
Pavol Rusnak
73708aa47e
refactor recovery.is_same_mnemonic function to storage_containsMnemonic 2017-06-26 15:44:01 +02:00
Pavol Rusnak
c6fd70b471
gettext: mark localizable strings as proof-of-concept 2017-06-18 22:47:32 +02:00
Saleem Rashid
25b9bfd97b timer: Use Cortex-M3 SysTick timers
Removed `usbDelay(uint32_t cycles)`, added `usbSleep(uint32_t millis)`

The same method signature could cause silent code breakage at runtime,
as opposed to noisy code breakage at compile time which is the better
kind.
2016-11-17 02:07:46 +01:00
Jochen Hoenicke
9287dd7e04
Poll USB during BIP39 derivation.
This patch adds calls to usbPoll in the progress callback.  This
should address #98.

We call usbDelay instead of Poll, to call usbd_poll several times.
Otherwise it would only handle one event instead of handling all
events that were pending so far.  The ugly magic number 5 is a guess.

Note that we also need to set usbTiny, so that we don't recursively
process messages.  Since we don't know whether usbTiny is set, we
need to store the old value (especially true for u2f).

This fix also relies on another fix in libopencm3.
2016-11-09 16:17:50 +01:00
Pavol Rusnak
4ce4cc5605
halt the device when encountered an invalid mnemonic (skip if device loaded or recovered without enforced wordlist) 2016-11-09 16:06:50 +01:00
Pavol Rusnak
71890e4edf
implement u2f_counter in LoadDevice, Recoverydevice and ResetDevice messages 2016-10-31 16:20:15 +01:00
Jochen Hoenicke
6d65551b82
More alignment fixes 2016-08-30 12:39:37 +02:00
Jochen Hoenicke
ae4dff6e5f Only compute pubkey on demand.
Changed all hdnode callers to call hdnode_fill_public_key if
they need the public key.
2016-06-27 10:13:18 +02:00
Jochen Hoenicke
120cfc148f
new message SetU2FCounter 2016-06-12 23:44:36 +02:00
Pavol Rusnak
b1e3c52b08
remove DialogIcon enum, use bitmap structure directly 2016-06-08 19:20:07 +02:00
Jochen Hoenicke
c4e8bd0d0e More robust storage recycle sector
Clear storage marker first before clearing the second sector to prevent
leaving a state where only PIN failures have been cleared but storage is
still present.
2016-05-27 14:03:20 +02:00
Jochen Hoenicke
e093371129 Added storage area for u2f counter.
To prevent flashing for every u2f operation just clear one bit in
the u2f area to indicate an increased counter.
2016-05-26 20:59:16 +02:00
Jochen Hoenicke
8e7896456a Merge branch 'origin/master' into u2f 2016-05-26 20:58:52 +02:00
Jochen Hoenicke
87bfd5a829 Bugfix: restore storage.
Storage restore was broken due to my previous patch.
2016-05-25 01:14:32 +02:00
Jochen Hoenicke
bc92fb95a5
Clear pinarea on storage_init if upgrade fails
This also cleans up the code a bit and resets storage_uuid if upgrade fails.
2016-05-20 20:13:43 +02:00
Pavol Rusnak
46119bd007
clear pin failures on wipe and when in debug mode 2016-05-20 17:00:10 +02:00
Jochen Hoenicke
96f30a0ba7 Don't ask for passphrase with u2f. 2016-05-20 01:49:20 +02:00
Pavol Rusnak
c123db71b9
Merge branch 'master' into u2f 2016-05-16 18:19:31 +02:00
Pavol Rusnak
def4a9a02c
fix pbkdf2 usage in storage.c 2016-05-12 21:05:17 +02:00
Jochen Hoenicke
cf38291ca4 Updated branch u2f 2016-04-29 16:19:54 +02:00
Jochen Hoenicke
630e26dd20 use less stack memory in storage_commit 2016-04-27 19:23:02 +02:00
Jochen Hoenicke
da98a3a6fd Don't reflash storage after each PIN entry
Instead of reflashing the whole storage, we use a designated area
in the second storage block, where we mark each PIN failure by a
single zero bit. This is because one can set bits in flash to zero but
not to one.  If the PIN was entered successfully the whole word is
set to zero and the next word stores the new PIN failure counter.
2016-04-27 18:39:04 +02:00
Jochen Hoenicke
51f02ff763
ed25519 support 2016-04-22 18:22:45 +02:00
Jochen Hoenicke
03c501d9e3 Do not use hardcoded string for secp256k1. 2016-04-20 15:39:15 +02:00
Jochen Hoenicke
56238e63fc Added curve type to HD node.
Create a different root node for every curve type to separate the key
space.
2016-04-19 18:23:12 +02:00
Pavol Rusnak
1d3c7ee3f2
cleanup Waking up screen usage 2016-01-19 15:36:43 +01:00
Pavol Rusnak
ed76d030ef
check for sessionPassphraseCached 2015-12-14 22:53:14 +01:00
Mark Bryars
9328cad7f1 Add U2F support 2015-11-03 16:47:12 +01:00
Roman Zeyde
c08ff09f0f storage: add compile-time assert for sizeof(Storage) validation 2015-09-06 21:14:23 +03:00
Darin Stanchfield
e99aafd949 fixed salt passing to pbkdf2_hmac_sha512 2015-05-05 12:01:34 -07:00