From bb00b2c65e3be580de569ab36a51638364cb38bc Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Wed, 11 Sep 2024 15:24:44 +0200 Subject: [PATCH] CTAP: Handle expired PIN token --- helper/helper/fido.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/helper/helper/fido.py b/helper/helper/fido.py index 181cac42..fff7bac5 100644 --- a/helper/helper/fido.py +++ b/helper/helper/fido.py @@ -91,6 +91,14 @@ class Ctap2Node(RpcNode): self.client_pin = ClientPin(self.ctap) self._token = None + def __call__(self, *args, **kwargs): + try: + return super().__call__(*args, **kwargs) + except CtapError as e: + if e.code == CtapError.ERR.PIN_AUTH_INVALID: + raise AuthRequiredException() + raise + def get_data(self): self._info = self.ctap.get_info() logger.debug(f"Info: {self._info}")