From 5ec00ecccde439fd52d6ecc40ea1af0ed89da6f3 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Tue, 30 Jun 2020 16:06:27 +0200 Subject: [PATCH] Make assertion verification not require field credential The FIDO2 standard (https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#authenticatorGetAssertion) states that the field `credential` "may be omitted if the allowList has exactly one Credential." Allow `auth.credential` to be `None`. --- tests/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index 320d843..3c64993 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -33,7 +33,8 @@ def verify(reg, auth, cdh=None): cdh = auth.request.cdh auth.verify(cdh, credential_data.public_key) assert auth.auth_data.rp_id_hash == reg.auth_data.rp_id_hash - assert auth.credential["id"] == reg.auth_data.credential_data.credential_id + if auth.credential is not None: + assert auth.credential["id"] == reg.auth_data.credential_data.credential_id def generate_rp():