Allow passing string value

This commit is contained in:
Dain Nilsson 2024-02-29 15:24:02 +01:00
parent a5357dd35c
commit a7f3c51aca
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
1 changed files with 3 additions and 1 deletions

View File

@ -238,7 +238,9 @@ class CredProtectExtension(Ctap2Extension):
def process_create_input(self, inputs):
policy = inputs.get("credentialProtectionPolicy")
if policy:
index = list(CredProtectExtension.POLICY).index(policy)
index = list(CredProtectExtension.POLICY).index(
CredProtectExtension.POLICY(policy)
)
enforce = inputs.get("enforceCredentialProtectionPolicy", False)
if enforce and not self.is_supported() and index > 0:
raise ValueError("Authenticator does not support Credential Protection")