changes
This commit is contained in:
parent
ecf9949d42
commit
9ee5a8a9f0
28
main.py
28
main.py
@ -46,8 +46,14 @@ from fido2.ctap2 import Ctap2
|
|||||||
|
|
||||||
gotAaguid = None
|
gotAaguid = None
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(14, GPIO.OUT)
|
|
||||||
GPIO.output(14, GPIO.LOW)
|
greenLed = 14
|
||||||
|
redLed = 4
|
||||||
|
|
||||||
|
GPIO.setup(greenLed, GPIO.OUT)
|
||||||
|
GPIO.output(greenLed, GPIO.LOW)
|
||||||
|
GPIO.setup(redLed, GPIO.OUT)
|
||||||
|
GPIO.output(redLed, GPIO.LOW)
|
||||||
class CliInteraction(UserInteraction):
|
class CliInteraction(UserInteraction):
|
||||||
def prompt_up(self):
|
def prompt_up(self):
|
||||||
print("\nTouch your authenticator device now...\n")
|
print("\nTouch your authenticator device now...\n")
|
||||||
@ -63,10 +69,10 @@ def badCred():
|
|||||||
print("Bad credential!")
|
print("Bad credential!")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
while True:
|
while True:
|
||||||
GPIO.output(14, GPIO.LOW)
|
# GPIO.output(14, GPIO.LOW)
|
||||||
print("Waiting for device...")
|
print("Waiting for device...")
|
||||||
while True:
|
while True:
|
||||||
GPIO.output(14, GPIO.LOW)
|
# GPIO.output(14, GPIO.LOW)
|
||||||
dev = next(CtapHidDevice.list_devices(), None)
|
dev = next(CtapHidDevice.list_devices(), None)
|
||||||
|
|
||||||
if dev:
|
if dev:
|
||||||
@ -186,16 +192,20 @@ while True:
|
|||||||
print("Credential authenticated!")
|
print("Credential authenticated!")
|
||||||
|
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
GPIO.output(14, GPIO.HIGH)
|
GPIO.output(greenLed, GPIO.HIGH)
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
GPIO.output(14, GPIO.LOW)
|
GPIO.output(greenLed, GPIO.LOW)
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
|
|
||||||
print("CLIENT DATA:", result.client_data)
|
print("CLIENT DATA:", result.client_data)
|
||||||
print()
|
print()
|
||||||
print("AUTH DATA:", result.authenticator_data)
|
print("AUTH DATA:", result.authenticator_data)
|
||||||
GPIO.output(14, GPIO.LOW)
|
# GPIO.output(14, GPIO.LOW)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
GPIO.output(14, GPIO.LOW)
|
print("Authentication Failed!")
|
||||||
print("Authentication Failed!")
|
for i in range(5):
|
||||||
|
GPIO.output(redLed, GPIO.HIGH)
|
||||||
|
time.sleep(0.05)
|
||||||
|
GPIO.output(redLed, GPIO.LOW)
|
||||||
|
time.sleep(0.05)
|
||||||
|
Loading…
Reference in New Issue
Block a user