core: fix visibility of apps.common.device.U2F_COUNTER

pull/516/head
Pavol Rusnak 5 years ago
parent 9898b9f208
commit 6ad3294f31
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

@ -27,9 +27,9 @@ def init_unlocked() -> None:
def _migrate_from_version_01() -> None:
# Make the U2F counter public and writable even when storage is locked.
# U2F counter wasn't public, so we are intentionally not using storage.device module.
counter = common._get(common._APP_DEVICE, device._U2F_COUNTER)
counter = common._get(common._APP_DEVICE, device.U2F_COUNTER)
if counter is not None:
device.set_u2f_counter(int.from_bytes(counter, "big"))
# Delete the old, non-public U2F_COUNTER.
common._delete(common._APP_DEVICE, device._U2F_COUNTER)
common._delete(common._APP_DEVICE, device.U2F_COUNTER)
set_current_version()

@ -22,7 +22,7 @@ _USE_PASSPHRASE = const(0x05) # bool (0x01 or empty)
_HOMESCREEN = const(0x06) # bytes
_NEEDS_BACKUP = const(0x07) # bool (0x01 or empty)
_FLAGS = const(0x08) # int
_U2F_COUNTER = const(0x09) # int
U2F_COUNTER = const(0x09) # int
_PASSPHRASE_SOURCE = const(0x0A) # int
_UNFINISHED_BACKUP = const(0x0B) # bool (0x01 or empty)
_AUTOLOCK_DELAY_MS = const(0x0C) # int
@ -199,11 +199,11 @@ def set_autolock_delay_ms(delay_ms: int) -> None:
def next_u2f_counter() -> Optional[int]:
return common._next_counter(_NAMESPACE, _U2F_COUNTER, True) # writable when locked
return common._next_counter(_NAMESPACE, U2F_COUNTER, True) # writable when locked
def set_u2f_counter(count: int) -> None:
common._set_counter(_NAMESPACE, _U2F_COUNTER, count, True) # writable when locked
common._set_counter(_NAMESPACE, U2F_COUNTER, count, True) # writable when locked
def set_slip39_identifier(identifier: int) -> None:

Loading…
Cancel
Save