Skip to content

Commit

Permalink
Use new helper
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Jan 16, 2025
1 parent 56d9cc5 commit eb52d1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions webauthn/registration/formats/tpm.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import List

import cbor2
from cryptography import x509
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.backends import default_backend
Expand Down Expand Up @@ -31,11 +30,10 @@
InvalidRegistrationResponse,
)
from webauthn.helpers.structs import AttestationStatement
from webauthn.helpers.tpm import parse_cert_info, parse_pub_area
from webauthn.helpers.tpm import map_tpm_manufacturer_id, parse_cert_info, parse_pub_area
from webauthn.helpers.tpm.structs import (
TPM_ALG_COSE_ALG_MAP,
TPM_ECC_CURVE_COSE_CRV_MAP,
TPM_MANUFACTURERS,
TPMPubAreaParametersECC,
TPMPubAreaParametersRSA,
)
Expand Down Expand Up @@ -255,7 +253,8 @@ def verify_tpm(
)

try:
TPM_MANUFACTURERS[tcg_at_tpm_manufacturer]
# Naively try to map the manufacturer hex ID to a known manufacturer
map_tpm_manufacturer_id(tcg_at_tpm_manufacturer)
except KeyError:
raise InvalidRegistrationResponse(
f'Unrecognized TPM Manufacturer "{tcg_at_tpm_manufacturer}" (TPM)'
Expand Down

0 comments on commit eb52d1d

Please sign in to comment.