1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-06-05 15:48:45 +00:00

core/storage: Rename APP_FIDO2 to APP_WEBAUTHN.

This commit is contained in:
Andrew Kozlik 2019-09-19 17:17:22 +02:00
parent 68513a0b39
commit 8024f6d069
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ if False:
APP_DEVICE = const(0x01) APP_DEVICE = const(0x01)
APP_RECOVERY = const(0x02) APP_RECOVERY = const(0x02)
APP_RECOVERY_SHARES = const(0x03) APP_RECOVERY_SHARES = const(0x03)
APP_FIDO2 = const(0x04) APP_WEBAUTHN = const(0x04)
# fmt: on # fmt: on
_FALSE_BYTE = b"\x00" _FALSE_BYTE = b"\x00"

View File

@ -26,7 +26,7 @@ def get_resident_credential(
return None return None
stored_cred_data = common.get( 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: if stored_cred_data is None:
return None return None
@ -50,7 +50,7 @@ def store_resident_credential(cred: Fido2Credential) -> bool:
slot = None slot = None
for i in range(_MAX_RESIDENT_CREDENTIALS): for i in range(_MAX_RESIDENT_CREDENTIALS):
stored_cred_data = common.get( 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 stored_cred_data is None:
if slot is None: if slot is None:
@ -78,7 +78,7 @@ def store_resident_credential(cred: Fido2Credential) -> bool:
return False return False
common.set( common.set(
common.APP_FIDO2, common.APP_WEBAUTHN,
slot + _RESIDENT_CREDENTIAL_START_KEY, slot + _RESIDENT_CREDENTIAL_START_KEY,
cred.rp_id_hash + cred.id, cred.rp_id_hash + cred.id,
) )
@ -87,11 +87,11 @@ def store_resident_credential(cred: Fido2Credential) -> bool:
def erase_resident_credentials() -> None: def erase_resident_credentials() -> None:
for i in range(_MAX_RESIDENT_CREDENTIALS): 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: def erase_resident_credential(index: int) -> bool:
if not (0 <= index < _MAX_RESIDENT_CREDENTIALS): if not (0 <= index < _MAX_RESIDENT_CREDENTIALS):
return False return False
common.delete(common.APP_FIDO2, index + _RESIDENT_CREDENTIAL_START_KEY) common.delete(common.APP_WEBAUTHN, index + _RESIDENT_CREDENTIAL_START_KEY)
return True return True