1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
Author: Petter Reinholdtsen <pere@hungry.com>
Description: fix yubikey-totp on python3.9
Forwarded: https://github.com/Yubico/python-yubico/pull/61
--- a/util/yubikey-totp
+++ b/util/yubikey-totp
@@ -103,7 +103,7 @@ def make_totp(args):
print("Serial : %i" % YK.serial())
print("")
# Do challenge-response
- secret = struct.pack("> Q", args.time / args.step).ljust(64, chr(0x0))
+ secret = struct.pack("> Q", int(args.time / args.step)).ljust(64, bytes.fromhex('00'))
if args.debug:
print("Sending challenge : %s\n" % (binascii.hexlify(secret)))
response = YK.challenge_response(secret, slot=args.slot)
|