1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 01:18:28 +00:00
Commit Graph

158 Commits

Author SHA1 Message Date
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
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
Pavol Rusnak
336a417233 core/bootloader: distinguish between a vendor change and downgrade with wipe 2020-03-25 15:15:12 +01:00
Ondrej Mikle
634ed5aabc
core: commands for flashing via JLink (#911) 2020-03-23 10:40: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
bfd834d1de storage: Add storage_ensure_not_wipe_code(). 2020-03-19 15:04:33 +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
matejcik
9ab84d2455 core/tests: thoroughly test modified APIs 2020-02-27 10:56:23 +01:00
matejcik
b24411b900 core/sdcard: unmount instance when powering off sdcard 2020-02-27 10:56:23 +01:00
matejcik
c81be584fb core/fatfs: ensure functions can only be called on a mounted filesystem
ff.c has a lazy-mounting feature, where any filesystem call will mount
the volume if it can. This messes with predictability of the mounted
state, so all (except mount/unmount/mkfs) Python functions will first
check if the fs is mounted.
2020-02-27 10:56:23 +01:00
matejcik
fa746e2990 core/fatfs: rework low-level FatFS API
Instead of having possibly multiple FatFS objects, each with its own
`fs` struct, there is one global static fs_instance. This is to match
the mode of operation of ff.c, which assumes a global list of mounts,
and all functions operate on the global based on path.

Methods of FatFS were converted to functions on the fatfs module.

fatfs.unmount() does not call ff.c's unmount, but simply invalidates
fs_instance. This is basically what ff.c would do, except without
messing with ff.c's global list of mounts.
2020-02-26 14:18:41 +01:00
Pavol Rusnak
c896f02eb3
core/boardloader: use SRAM as SD card read buffer
because DMA can't access the CCMRAM
2020-02-25 17:59:16 +01:00
Andrew Kozlik
2133f7cf29 core: Prevent data loss when writing to USB VCP. 2020-02-25 12:08:07 +01:00
Pavol Rusnak
39ce100608
Merge pull request #864 from trezor/prusnak/bootloader-text-break
core/bootloader: split long vendor string
2020-02-21 18:39:20 +01:00
matejcik
4ed6487a19 core/sdcard: add out-of-bounds checks to emulator 2020-02-20 12:51:48 +01:00
matejcik
d0b1b171f1 core/sdcard: ensure emulator initializes the SD card when first needed 2020-02-20 12:51:48 +01:00
matejcik
5bd8d9b5bb core/sdcard: make allocating new SD card for emulator fast 2020-02-20 12:51:48 +01:00
matejcik
b2084a19be core/trezorio: move sdcard functions to a submodule 2020-02-20 12:51:48 +01:00
matejcik
30529d218d core/sdcard: change SDCard methods to plain functions 2020-02-20 12:51:48 +01:00
matejcik
06b89c57c5 core/sdcard: return proper disk status flags to fatfs 2020-02-20 12:51:48 +01:00
Pavol Rusnak
dc66bbe3d5
core/bootloader: split long vendor string 2020-02-19 21:40:28 +00:00
Pavol Rusnak
74802a107e
core/modtrezorui: add display_text_split 2020-02-19 21:40:28 +00:00
Pavol Rusnak
c4babd3c0b
Merge pull request #846 from trezor/bootloader-read-retry
core/bootloader: make read more benevolent and read error more helpful
2020-02-19 19:45:34 +01:00
Pavol Rusnak
581e46ff87
Merge pull request #845 from trezor/prusnak/webusb-popup
Don't show WebUSB popup in firmware, in bootloader only if no firmware present
2020-02-19 18:18:01 +01:00
Pavol Rusnak
2958a97c87
Merge pull request #830 from trezor/tsusanka/fw-upgrade
FW Update: Request a small chunk first to make the UI smoother
2020-02-15 13:08:33 +01:00
Pavol Rusnak
63dfd6c6ab
core/bootloader: make read more benevolent and read error more helpful 2020-02-12 22:05:29 +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
matejcik
c14429c445 all: shut down emulator on error_shutdown 2020-02-12 13:31:31 +01:00
Tomas Susanka
2c0504ad1c
Merge pull request #803 from trezor/passphrase
Passphrase Redesign
2020-02-11 16:01:59 +01:00
Pavol Rusnak
32f8f1cb61
core/embed: update fatfs to 0.14; use upstream version 2020-02-07 15:21:16 +00:00
Pavol Rusnak
73ed2f3450
legacy: small nitpicks related to the new passphrase handling 2020-02-07 11:41:03 +00:00
Tomas Susanka
1343583d21
core: bump version to 2.3.0 2020-02-07 11:41:00 +00:00
Tomas Susanka
a02d7e3daf core/bootloader: request vendor header first 2020-02-06 12:22:32 +00:00
matejcik
d28e33ef02 core/headertool: support generating vendor headers with explicit size 2020-02-05 12:23:34 +01:00
Pavol Rusnak
6dbed1424f
core+legacy: update nanopb api to version 0.4 2020-02-04 17:18:27 +00:00
Pavol Rusnak
3eb7775659
core/bootloader: regenerate protobuf messages 2020-02-04 17:18:17 +00:00
Pavol Rusnak
4647e7d686
core+legacy: use nanopb generator from pipenv 2020-02-04 17:15:25 +00:00
matejcik
75264a07a8
Emulator launcher scripts (#796)
Emulator launcher scripts
2020-01-24 16:18:18 +01:00
Pavol Rusnak
3de1b3aa54
core/embed: switch to unprivileged in main.c 2020-01-24 12:29:46 +00:00
Pavol Rusnak
7a2e0c3412
core/embed: don't call functions via supervisor if in privileged mode 2020-01-23 18:18:59 +00:00
matejcik
27c4c2dd50 core: do not let frozen emulator import live files 2020-01-23 15:50:28 +01:00
matejcik
9341f0d584
core: improve building of vendor headers 2020-01-20 17:32:59 +01:00
Pavol Rusnak
500156b9ba
core/embed: don't use local copy of inflate 2020-01-18 17:09:52 +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