From 1ffe85f08310d904a6e1a8413b14134adbed73ae Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sun, 27 Jan 2019 11:18:50 -0500 Subject: [PATCH] update attestation verification --- tools/solotool.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/solotool.py b/tools/solotool.py index 25ba996..5148b50 100755 --- a/tools/solotool.py +++ b/tools/solotool.py @@ -41,6 +41,7 @@ from fido2.ctap import CtapError from fido2.ctap1 import CTAP1, ApduError from fido2.ctap2 import CTAP2 from fido2.utils import Timeout +from fido2.attestation import Attestation import usb.core import usb.util @@ -240,7 +241,15 @@ class SoloClient: attest, data = self.client.make_credential( rp, user, challenge, exclude_list=[] ) - attest.verify(data.hash) + try: + attest.verify(data.hash) + except AttributeError: + verifier = Attestation.for_type(attest.fmt) + verifier().verify( + attest.att_statement, + attest.auth_data, + data.hash + ) print('Register valid') x5c = attest.att_statement['x5c'][0] cert = x509.load_der_x509_certificate(x5c, default_backend())