somethin
This commit is contained in:
parent
6c37079876
commit
fcc3a3afbc
26
main.py
26
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
|
||||
|
Loading…
Reference in New Issue
Block a user