File: python3.9.patch

package info (click to toggle)
python-yubico 1.3.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 460 kB
  • sloc: python: 2,367; ansic: 128; xml: 20; makefile: 7
file content (15 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (2)
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)