This commit is contained in:
caschick221 2024-05-02 14:53:02 -04:00
parent 6c37079876
commit fcc3a3afbc

26
main.py
View File

@ -44,9 +44,22 @@ import sys
import ctypes import ctypes
from fido2.ctap2 import Ctap2 from fido2.ctap2 import Ctap2
REGISTER = False
gotAaguid = None 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:
while True: while True:
dev = next(CtapHidDevice.list_devices(), None) dev = next(CtapHidDevice.list_devices(), None)
@ -63,16 +76,6 @@ while True:
time.sleep(0.1) time.sleep(0.1)
# Handle user interaction # 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: try:
server = Fido2Server({"id": "example.com", "name": "Example RP"}, attestation="direct") server = Fido2Server({"id": "example.com", "name": "Example RP"}, attestation="direct")
@ -125,6 +128,7 @@ while True:
return data return data
else: else:
print("No data found for AAGUID:", aaguid) print("No data found for AAGUID:", aaguid)
badCred()
return None return None
# Close communication with the database # Close communication with the database