From 5ca4ed23471ff9b7ef0dd1732bd1a3b3cf4a2ae7 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Mon, 23 Sep 2019 19:18:17 +0200 Subject: [PATCH] core/webauth: Add _AUTOCONFIRM option for testing. --- core/src/apps/webauthn/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/apps/webauthn/__init__.py b/core/src/apps/webauthn/__init__.py index a6002f006b..baad808796 100644 --- a/core/src/apps/webauthn/__init__.py +++ b/core/src/apps/webauthn/__init__.py @@ -208,6 +208,8 @@ _ALLOW_RESIDENT_CREDENTIALS = True # The attestation type to use in MakeCredential responses. If false, then self attestation will be used. _USE_BASIC_ATTESTATION = False +_AUTOCONFIRM = False + def frame_init() -> dict: # uint32_t cid; // Channel identifier @@ -534,6 +536,8 @@ async def verify_user(keepalive_callback: KeepaliveCallback) -> bool: async def confirm(*args: Any, **kwargs: Any) -> bool: + if _AUTOCONFIRM: + return True dialog = Confirm(*args, **kwargs) if __debug__: return await loop.race(dialog, confirm_signal()) is CONFIRMED @@ -542,6 +546,8 @@ async def confirm(*args: Any, **kwargs: Any) -> bool: async def confirm_pageable(*args: Any, **kwargs: Any) -> bool: + if _AUTOCONFIRM: + return True dialog = ConfirmPageable(*args, **kwargs) if __debug__: return await loop.race(dialog, confirm_signal()) is CONFIRMED