コード例 #1
0
ファイル: __init__.py プロジェクト: romanz/trezor-firmware
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)
    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)
    set_current_version()
コード例 #2
0
ファイル: device.py プロジェクト: umbru/trezor-firmware
def set_backed_up() -> None:
    common._delete(_NAMESPACE, _NEEDS_BACKUP)
コード例 #3
0
def delete() -> None:
    for index in range(0, slip39.MAX_SHARE_COUNT):
        common._delete(common._APP_RECOVERY_SHARES, index)
コード例 #4
0
ファイル: slip39.py プロジェクト: romanz/trezor-firmware
def delete_progress() -> None:
    common._delete(_NAMESPACE, _SLIP39_IN_PROGRESS)
    common._delete(_NAMESPACE, _SLIP39_REMAINING)
    common._delete(_NAMESPACE, _SLIP39_THRESHOLD)
    common._delete(_NAMESPACE, _SLIP39_WORDS_COUNT)
    slip39_mnemonics.delete()
コード例 #5
0
def end_progress() -> None:
    common._delete(_NAMESPACE, _IN_PROGRESS)
    common._delete(_NAMESPACE, _DRY_RUN)
    common._delete(_NAMESPACE, _WORD_COUNT)
    common._delete(_NAMESPACE, _SLIP39_IDENTIFIER)
    common._delete(_NAMESPACE, _SLIP39_THRESHOLD)
    common._delete(_NAMESPACE, _REMAINING)
    common._delete(_NAMESPACE, _SLIP39_ITERATION_EXPONENT)
    recovery_shares.delete()
コード例 #6
0
def erase_resident_credentials() -> None:
    for i in range(
            _RESIDENT_CREDENTIAL_START_KEY,
            _RESIDENT_CREDENTIAL_START_KEY + _MAX_RESIDENT_CREDENTIALS,
    ):
        common._delete(common._APP_FIDO2, i)
コード例 #7
0
def delete() -> None:
    for index in range(0, slip39.MAX_SHARE_COUNT):
        common._delete(common._APP_SLIP39_MNEMONICS, index)