1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

src/apps/management/reset_device: don't show internal entropy when skip_backup is set

This commit is contained in:
Pavol Rusnak 2018-10-11 15:27:42 +02:00
parent addbdd8937
commit 13fa7d22b9
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -26,8 +26,8 @@ async def reset_device(ctx, msg):
# validate parameters and device state
if msg.strength not in (128, 192, 256):
raise wire.ProcessError("Invalid strength (has to be 128, 192 or 256 bits)")
if msg.display_random and msg.no_backup:
raise wire.ProcessError("Can't show internal entropy when no_backup is used")
if msg.display_random and (msg.skip_backup or msg.no_backup):
raise wire.ProcessError("Can't show internal entropy when backup is skipped")
if storage.is_initialized():
raise wire.UnexpectedMessage("Already initialized")