This commit is contained in:
Eggman20339 2024-05-05 19:47:50 -04:00
parent 3b8fe12655
commit d1eb79541d

View File

@ -32,7 +32,7 @@ This works with both FIDO 2.0 devices as well as with U2F devices.
On Windows, the native WebAuthn API will be used. On Windows, the native WebAuthn API will be used.
""" """
import time import time
import RPI.GPIO as GPIO import RPi.GPIO as GPIO
import pickle import pickle
import psycopg2 import psycopg2
import fido2.webauthn import fido2.webauthn
@ -66,6 +66,7 @@ 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)
dev = next(CtapHidDevice.list_devices(), None) dev = next(CtapHidDevice.list_devices(), None)
if dev: if dev:
@ -193,6 +194,8 @@ while True:
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)
time.sleep(5) time.sleep(5)
except Exception as e: except Exception as e:
GPIO.output(14, GPIO.LOW)
print("Authentication Failed!") print("Authentication Failed!")