Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Python3 #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use a byte string to fix a Python3 error
File "python-yubico/util/yubikey-totp", line 106, in make_totp
    secret = struct.pack("> Q", args.time // args.step).ljust(64, chr(0x0))
TypeError: ljust() argument 2 must be a byte string of length 1, not str
LudovicRousseau committed Mar 31, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit b16dc8ca99e1f5a1c43cdae2eac24bf9adb50058
2 changes: 1 addition & 1 deletion util/yubikey-totp
Original file line number Diff line number Diff line change
@@ -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", args.time // args.step).ljust(64, b'\0')
if args.debug:
print("Sending challenge : %s\n" % (binascii.hexlify(secret)))
response = YK.challenge_response(secret, slot=args.slot)