mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-27 01:48:17 +00:00
apps.debug: hack around PIN lock, add reset_device fields
This commit is contained in:
parent
1ed4dfa516
commit
943d77ba32
@ -13,29 +13,22 @@ async def dispatch_DebugLinkDecision(session_id, msg):
|
|||||||
async def dispatch_DebugLinkGetState(session_id, msg):
|
async def dispatch_DebugLinkGetState(session_id, msg):
|
||||||
from trezor.messages.DebugLinkState import DebugLinkState
|
from trezor.messages.DebugLinkState import DebugLinkState
|
||||||
from apps.common import storage, request_pin
|
from apps.common import storage, request_pin
|
||||||
|
from apps.management import reset_device
|
||||||
|
|
||||||
if request_pin.matrix:
|
if request_pin.matrix:
|
||||||
matrix = ''.join([str(d) for d in request_pin.matrix.digits])
|
matrix = ''.join([str(d) for d in request_pin.matrix.digits])
|
||||||
else:
|
else:
|
||||||
matrix = None
|
matrix = None
|
||||||
|
|
||||||
# TODO: do this differently
|
|
||||||
locked = storage.is_locked()
|
|
||||||
try:
|
|
||||||
if locked:
|
|
||||||
storage.unlock(storage.get_pin())
|
|
||||||
m = DebugLinkState()
|
m = DebugLinkState()
|
||||||
m.pin = storage.get_pin()
|
m.pin = storage.config_get(storage.PIN).decode()
|
||||||
m.mnemonic = storage.get_mnemonic()
|
m.mnemonic = storage.config_get(storage.MNEMONIC).decode()
|
||||||
m.passphrase_protection = storage.is_protected_by_passphrase()
|
m.passphrase_protection = storage.is_protected_by_passphrase()
|
||||||
m.matrix = matrix
|
m.matrix = matrix
|
||||||
finally:
|
m.reset_entropy = reset_device.internal_entropy
|
||||||
if locked:
|
m.reset_word = reset_device.current_word
|
||||||
storage.lock()
|
|
||||||
|
|
||||||
# TODO: handle other fields:
|
# TODO: handle other fields:
|
||||||
# f.reset_entropy = reset_get_internal_entropy()
|
|
||||||
# f.reset_word = reset_get_word()
|
|
||||||
# f.recovery_fake_word = recovery_get_fake_word()
|
# f.recovery_fake_word = recovery_get_fake_word()
|
||||||
# f.recovery_word_pos = recovery_get_word_pos()
|
# f.recovery_word_pos = recovery_get_word_pos()
|
||||||
# f.node = storage.get_node()
|
# f.node = storage.get_node()
|
||||||
|
Loading…
Reference in New Issue
Block a user