1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-06 10:16:07 +00:00

chore: Add emulator warnings.

[no changelog]
This commit is contained in:
Andrew Kozlik 2025-03-03 19:09:55 +01:00 committed by matejcik
parent e08b15ecaf
commit b2701596cc
4 changed files with 27 additions and 0 deletions

View File

@ -168,6 +168,12 @@ def cli(
By default, emulator output goes to stdout. If silenced with -q, it is redirected
to $TREZOR_PROFILE_DIR/trezor.log. You can also specify a custom path with -o.
This emulator is for development purposes only. Any other usage of the emulator is
discouraged. Doing so runs the risk of losing funds. It uses a pseudo random number
generator, and thus no guarantee on its entropy is made. Security and hardening
efforts are only made available on physical Trezor hardware.
"""
if executable:
executable = Path(executable)

View File

@ -104,6 +104,10 @@ async def bootscreen() -> None:
utils.halt(e.__class__.__name__)
# Display emulator warning.
if utils.EMULATOR:
print("\x1b[1;31m*** TREZOR EMULATOR IS FOR DEVELOPMENT PURPOSES ONLY ***\x1b[0m")
# Ignore all automated PIN messages in the boot-phase (turned off in `bootscreen()`), unless Optiga throttling delays are active.
if not utils.USE_OPTIGA or (optiga.get_sec() or 0) < 150:
ignore_nonpin_loader_messages()

View File

@ -70,6 +70,12 @@ poetry run ./script/cibuild
A built device firmware will be located in `legacy/firmware/trezor.bin`. A built emulator will be
located in `legacy/firmware/trezor.elf`.
### ⚠️ Disclaimer ⚠️
The emulator is for *development purposes only*. It uses a pseudo random number generator, and thus no guarantee on its entropy is made. No security or hardening efforts are made here. It is, and will continue to be, intended for development purposes only. Security and hardening efforts are only made available on [physical Trezor hardware](https://shop.trezor.io/).
Any other usage of the emulator is discouraged. Doing so runs the risk of losing funds.
### Common errors
* **"Exception: bootloader has to be smaller than 32736 bytes"**: if you didn't modify the bootloader

View File

@ -34,10 +34,14 @@
#include "timer.h"
#include "usb.h"
#include "util.h"
#if !EMULATOR
#include <libopencm3/stm32/desig.h>
#include "otp.h"
#else
#include <stdio.h>
#endif
#ifdef USE_SECP256K1_ZKP
#include "zkp_context.h"
#endif
@ -183,6 +187,13 @@ int main(void) {
#endif
#endif
#if EMULATOR
printf(
"\x1b[1;31m"
"*** TREZOR EMULATOR IS FOR DEVELOPMENT PURPOSES ONLY ***"
"\x1b[0m\n");
#endif
oledDrawBitmap(40, 0, &bmp_logo64_half);
oledDrawBitmapFlip(40 + 24, 0, &bmp_logo64_half);
oledRefresh();