From 9992850acea7f6842b1cd7fb820ec481f1a6f938 Mon Sep 17 00:00:00 2001 From: Clement Verna Date: Mar 10 2020 13:25:53 +0000 Subject: Option for the mode_yubikey_otp must be bytes and not string. This yubico library expect these parameters to be bytes instead of string. Also replacing the string formating by f-strings. fixes #158 Signed-off-by: Clement Verna --- diff --git a/src/fedora-burn-yubikey.py b/src/fedora-burn-yubikey.py index a489abc..1426a25 100644 --- a/src/fedora-burn-yubikey.py +++ b/src/fedora-burn-yubikey.py @@ -77,8 +77,8 @@ opts = new_key['key'].split() try: ykconfig = ykey.init_config() - ykconfig.mode_yubikey_otp('h:%s' % opts[1], 'h:%s' % opts[2]) - ykconfig.fixed_string(str('m:%s' % opts[0])) + ykconfig.mode_yubikey_otp(f'h:{opts[1]}'.encode(), f'h:{opts[2]}'.encode()) + ykconfig.fixed_string(str(f'm:{opts[0]}')) ykconfig.ticket_flag('APPEND_CR', True) ykconfig.config_flag('STATIC_TICKET', False) if ykey.version_num() >= (2, 1):