Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
smartlock/yubikey.py

20 lines
727 B
Python
Raw Normal View History

from yubico_client import Yubico
import lock, shelve
2019-05-15 16:12:37 +02:00
ids = {"interncccccc": 1, "interncccccd": 2, "internccccch": 3, "internccccci": 4, "internccccce": 5, "interncccccg": 6, "interncccccf": 7, "interncccccb": 8, "internccccck": 9, "interncccccj": 10}
while True:
try:
inp = input(">")
id = ids[inp[:12]]
with shelve.open("Settings.conf") as settings:
client = Yubico(id, settings["keys"][id], api_urls=('http://localhost/wsapi/2.0/verify',))
#client = Yubico(1, "QMho+Y4mtsY+KbCYu1gRKtDtwAM=", api_urls=('http://localhost/wsapi/2.0/verify',))
client.verify(inp)
2019-05-22 15:40:28 +02:00
except KeyboardInterrupt:
break
except:
pass
else:
2019-05-15 16:48:27 +02:00
lock.switch(id)