Update RPC for FIDO functionality.

This commit is contained in:
Dain Nilsson 2022-03-22 14:19:35 +01:00
parent f070765b2e
commit 23faac99ed
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
3 changed files with 9 additions and 2 deletions

View File

@ -7,7 +7,7 @@ authors = ["Dain Nilsson <dain@yubico.com>"]
[tool.poetry.dependencies]
python = "^3.8"
yubikey-manager = { git = "https://github.com/Yubico/yubikey-manager.git", rev = "22a72b2" }
fido2 = { git = "https://github.com/Yubico/python-fido2.git", rev = "53175db" }
fido2 = { git = "https://github.com/Yubico/python-fido2.git", rev = "14923ca" }
mss = "^6.1.0"
zxing-cpp = "^1.2.0"
Pillow = "^8|^9"

View File

@ -85,6 +85,7 @@ def _handle_incoming(event, recv, error, cmd_queue):
except RpcException as e:
error(e.status, e.message, e.body)
except Exception as e:
logger.exception("Unhandled exception")
error("exception", f"{e!r}")
event.set()
cmd_queue.put(None)
@ -126,6 +127,7 @@ def process(
except RpcException as e:
error(e.status, e.message, e.body)
except Exception as e:
logger.exception("Unhandled exception")
error("exception", f"{e!r}")
cmd_queue.task_done()

View File

@ -85,6 +85,7 @@ class Ctap2Node(RpcNode):
)
if self._info.options.get("bioEnroll"):
uv_retries = self.client_pin.get_uv_retries()
# For compatibility with python-fido2 < 1.0
if isinstance(uv_retries, tuple):
uv_retries = uv_retries[0]
data.update(uv_retries=uv_retries)
@ -302,7 +303,11 @@ class FingerprintsNode(RpcNode):
self.refresh()
def refresh(self):
self._templates = self.bio.enumerate_enrollments()
self._templates = {
# Treat empty strings as None
k: v if v else None
for k, v in self.bio.enumerate_enrollments().items()
}
def list_children(self):
return {