From 7ad1467dbf50db0ad5a982e29473ea0c895dc84a Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Mon, 23 Sep 2019 19:17:03 +0200 Subject: [PATCH] core/webauthn: Process debuglink signals in Fido2ConfirmGetAssertion. --- core/src/apps/webauthn/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/apps/webauthn/__init__.py b/core/src/apps/webauthn/__init__.py index a3afbc168..a6002f006 100644 --- a/core/src/apps/webauthn/__init__.py +++ b/core/src/apps/webauthn/__init__.py @@ -541,6 +541,14 @@ async def confirm(*args: Any, **kwargs: Any) -> bool: return await dialog is CONFIRMED +async def confirm_pageable(*args: Any, **kwargs: Any) -> bool: + dialog = ConfirmPageable(*args, **kwargs) + if __debug__: + return await loop.race(dialog, confirm_signal()) is CONFIRMED + else: + return await dialog is CONFIRMED + + class State: def __init__(self, cid: int, iface: io.HID) -> None: self.cid = cid @@ -763,7 +771,7 @@ class Fido2ConfirmGetAssertion(Fido2State, ConfirmInfo, Pageable): async def confirm_dialog(self) -> bool: content = ConfirmContent(self) - if await ConfirmPageable(self, content) is not CONFIRMED: + if not await confirm_pageable(self, content): return False if self._user_verification: return await verify_user(KeepaliveCallback(self.cid, self.iface))