mirror of
https://salsa.debian.org/gnuk-team/gnuk/gnuk.git
synced 2024-09-20 10:50:09 +00:00
4d15700580
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
22 lines
513 B
Python
Executable File
22 lines
513 B
Python
Executable File
#! /usr/bin/python3
|
|
|
|
from gnuk_token import get_gnuk_device, gnuk_token
|
|
from binascii import hexlify
|
|
import sys
|
|
|
|
if __name__ == '__main__':
|
|
count = 0
|
|
gnuk = get_gnuk_device()
|
|
gnuk.cmd_select_openpgp()
|
|
looping = (len(sys.argv) > 1)
|
|
while True:
|
|
try:
|
|
challenge = gnuk.cmd_get_challenge().tobytes()
|
|
except Exception as e:
|
|
print(count)
|
|
raise e
|
|
print(hexlify(challenge))
|
|
count = count + 1
|
|
if not looping:
|
|
break
|