mirror of https://github.com/Yubico/python-fido2
Fix handling of error codes in authenticatorSelection (fix #184).
This commit is contained in:
parent
54cee2216a
commit
cbe72665e1
|
@ -56,8 +56,9 @@ class CliInteraction(UserInteraction):
|
|||
return True
|
||||
|
||||
|
||||
cli_interaction = CliInteraction()
|
||||
clients = [
|
||||
Fido2Client(d, "https://example.com", user_interaction=CliInteraction())
|
||||
Fido2Client(d, "https://example.com", user_interaction=cli_interaction)
|
||||
for d in devs
|
||||
]
|
||||
|
||||
|
|
|
@ -453,6 +453,7 @@ class _Ctap2ClientBackend(_ClientBackend):
|
|||
if "FIDO_2_1" in self.info.versions:
|
||||
self.ctap2.selection(event=event)
|
||||
else:
|
||||
# Selection not supported, make dummy credential instead
|
||||
try:
|
||||
self.ctap2.make_credential(
|
||||
b"\0" * 32,
|
||||
|
@ -463,7 +464,11 @@ class _Ctap2ClientBackend(_ClientBackend):
|
|||
event=event,
|
||||
)
|
||||
except CtapError as e:
|
||||
if e.code is CtapError.ERR.PIN_AUTH_INVALID:
|
||||
if e.code in (
|
||||
CtapError.ERR.PIN_NOT_SET,
|
||||
CtapError.ERR.PIN_INVALID,
|
||||
CtapError.ERR.PIN_AUTH_INVALID,
|
||||
):
|
||||
return
|
||||
raise
|
||||
|
||||
|
|
Loading…
Reference in New Issue