mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 12:08:59 +00:00
core/storage: Rename APP_FIDO2 to APP_WEBAUTHN.
This commit is contained in:
parent
68513a0b39
commit
8024f6d069
@ -10,7 +10,7 @@ if False:
|
||||
APP_DEVICE = const(0x01)
|
||||
APP_RECOVERY = const(0x02)
|
||||
APP_RECOVERY_SHARES = const(0x03)
|
||||
APP_FIDO2 = const(0x04)
|
||||
APP_WEBAUTHN = const(0x04)
|
||||
# fmt: on
|
||||
|
||||
_FALSE_BYTE = b"\x00"
|
||||
|
@ -26,7 +26,7 @@ def get_resident_credential(
|
||||
return None
|
||||
|
||||
stored_cred_data = common.get(
|
||||
common.APP_FIDO2, index + _RESIDENT_CREDENTIAL_START_KEY
|
||||
common.APP_WEBAUTHN, index + _RESIDENT_CREDENTIAL_START_KEY
|
||||
)
|
||||
if stored_cred_data is None:
|
||||
return None
|
||||
@ -50,7 +50,7 @@ def store_resident_credential(cred: Fido2Credential) -> bool:
|
||||
slot = None
|
||||
for i in range(_MAX_RESIDENT_CREDENTIALS):
|
||||
stored_cred_data = common.get(
|
||||
common.APP_FIDO2, i + _RESIDENT_CREDENTIAL_START_KEY
|
||||
common.APP_WEBAUTHN, i + _RESIDENT_CREDENTIAL_START_KEY
|
||||
)
|
||||
if stored_cred_data is None:
|
||||
if slot is None:
|
||||
@ -78,7 +78,7 @@ def store_resident_credential(cred: Fido2Credential) -> bool:
|
||||
return False
|
||||
|
||||
common.set(
|
||||
common.APP_FIDO2,
|
||||
common.APP_WEBAUTHN,
|
||||
slot + _RESIDENT_CREDENTIAL_START_KEY,
|
||||
cred.rp_id_hash + cred.id,
|
||||
)
|
||||
@ -87,11 +87,11 @@ def store_resident_credential(cred: Fido2Credential) -> bool:
|
||||
|
||||
def erase_resident_credentials() -> None:
|
||||
for i in range(_MAX_RESIDENT_CREDENTIALS):
|
||||
common.delete(common.APP_FIDO2, i + _RESIDENT_CREDENTIAL_START_KEY)
|
||||
common.delete(common.APP_WEBAUTHN, i + _RESIDENT_CREDENTIAL_START_KEY)
|
||||
|
||||
|
||||
def erase_resident_credential(index: int) -> bool:
|
||||
if not (0 <= index < _MAX_RESIDENT_CREDENTIALS):
|
||||
return False
|
||||
common.delete(common.APP_FIDO2, index + _RESIDENT_CREDENTIAL_START_KEY)
|
||||
common.delete(common.APP_WEBAUTHN, index + _RESIDENT_CREDENTIAL_START_KEY)
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user