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()
def set_backed_up() -> None: common._delete(_NAMESPACE, _NEEDS_BACKUP)
def delete() -> None: for index in range(0, slip39.MAX_SHARE_COUNT): common._delete(common._APP_RECOVERY_SHARES, index)
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()
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()
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)
def delete() -> None: for index in range(0, slip39.MAX_SHARE_COUNT): common._delete(common._APP_SLIP39_MNEMONICS, index)