From fcc3a3afbc058c170d46fdbb9e6dd3954f5d149b Mon Sep 17 00:00:00 2001 From: caschick221 Date: Thu, 2 May 2024 14:53:02 -0400 Subject: [PATCH] somethin --- main.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index dcbc8fc..85ed310 100644 --- a/main.py +++ b/main.py @@ -44,9 +44,22 @@ import sys import ctypes from fido2.ctap2 import Ctap2 -REGISTER = False gotAaguid = None +class CliInteraction(UserInteraction): + def prompt_up(self): + print("\nTouch your authenticator device now...\n") + + def request_pin(self, permissions, rd_id): + return getpass("Enter PIN: ") + + def request_uv(self, permissions, rd_id): + print("User Verification required.") + return True + +def badCred(): + print("Bad credential!") + time.sleep(3) while True: while True: dev = next(CtapHidDevice.list_devices(), None) @@ -63,16 +76,6 @@ while True: time.sleep(0.1) # Handle user interaction - class CliInteraction(UserInteraction): - def prompt_up(self): - print("\nTouch your authenticator device now...\n") - - def request_pin(self, permissions, rd_id): - return getpass("Enter PIN: ") - - def request_uv(self, permissions, rd_id): - print("User Verification required.") - return True try: server = Fido2Server({"id": "example.com", "name": "Example RP"}, attestation="direct") @@ -125,6 +128,7 @@ while True: return data else: print("No data found for AAGUID:", aaguid) + badCred() return None # Close communication with the database