#7121 ipa otptoken-add-yubikey fails with python3
Closed: fixed 6 years ago Opened 6 years ago by dkupka.

Version:
master

Steps to reproduce:

$ ipa otptoken-add-yubikey

Expected:

------------------                                                         
Added OTP token ""                                                                       
------------------                                                                                                                                                                                                                    
  Unique ID: f945ad0d-4a14-4efd-9645-e69cc745579b                      
  Type: HOTP                                                      
  Owner: admin                                                               
  Manager: admin                                                                                                                                                                                                                      
  Vendor: YubiCo                                                         
  Model: YubiKey 4                                                                
  Serial: 5973487                                                               
  Algorithm: sha1                                                                 
  Digits: 6
  Counter: 0
  YubiKey slot: 2

Got:

ipa: ERROR: non-public: TypeError: ord() expected string of length 1, but int found
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ipalib/backend.py", line 142, in execute
    result = self.Command[_name](*args, **options)
  File "/usr/lib/python3.6/site-packages/ipalib/frontend.py", line 450, in __call__                                
    return self.__do_call(*args, **options)
  File "/usr/lib/python3.6/site-packages/ipalib/frontend.py", line 478, in __do_call
    ret = self.run(*args, **options)
  File "/usr/lib/python3.6/site-packages/ipalib/frontend.py", line 801, in run
    return self.forward(*args, **options)
  File "/usr/lib/python3.6/site-packages/ipaclient/plugins/otptoken_yubikey.py", line 129, in forward
    yk = yubico.find_yubikey()
  File "/usr/lib/python3.6/site-packages/yubico/yubikey.py", line 61, in find_key
    return YubiKey4_USBHID(debug, skip, hid_device)
  File "/usr/lib/python3.6/site-packages/yubico/yubikey_4_usb_hid.py", line 98, in __init__
    data = yubico_util.tlv_parse(self._read_capabilities())
  File "/usr/lib/python3.6/site-packages/yubico/yubikey_4_usb_hid.py", line 107, in _read_capabilities
    r_len = ord(response[0])
TypeError: ord() expected string of length 1, but int found
ipa: ERROR: an internal error has occurred 

Metadata Update from @dkupka:
- Issue assigned to stlaz
- Issue tagged with: py3

6 years ago

Metadata Update from @stlaz:
- Issue tagged with: tracker

6 years ago

Metadata Update from @stlaz:
- Issue untagged with: tracker

6 years ago

Metadata Update from @stlaz:
- Custom field external_tracker adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1484862

6 years ago

Metadata Update from @stlaz:
- Issue tagged with: tracker

6 years ago

Metadata Update from @pvoborni:
- Issue set to the milestone: FreeIPA 4.6

6 years ago

master:

  • 0be9a17 py3: Fix searching for yubikeys

Metadata Update from @pvomacka:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata