Hi Tom,
(Read to the end, before clicking links - I have the error (my error) narrowed down)
I am running this python code to initialize the yubikey:
https://github.com/privacyidea/privacyi ... yubikey.pyroughlty it does this in MODE_OATH and challenge_response==True:
Code:
Cfg = YK.init_config()
key = binascii.hexlify(os.urandom(20))
Cfg.mode_challenge_response('h:' + key, type="HMAC")
Cfg.ticket_flag('APPEND_CR', False)
Cfg.extended_flag('SERIAL_API_VISIBLE', True)
YK.write_config(Cfg, slot=slot)
which pretty much looks the same to me like this
https://github.com/Yubico/python-yubico ... t_test_key:
Code:
Cfg = YK.init_config()
key='h:303132333435363738393a3b3c3d3e3f40414243'
fg.mode_challenge_response(key, type='HMAC', variable=True)
Cfg.extended_flag('SERIAL_API_VISIBLE', True)
YK.write_config(Cfg, slot=slot)
But still it does not work out for me. The command line tool creates another response, than my python program does...
Code:
% ykchalresp -2 -H -x 175ff6a6b675906d748b2a2b74dce6dc2f065685f4a69caa7f65e2167015745f4162f1b508d1eef7f5b319cf4bf3f435daca4e387152005e253e4694e9091781
2008b987214e073127006e4166ef189242dbf035
OK, using my initialized key with some very basic python code:
Code:
cornelius@puckel ~/src/privacyideaadm (git)-[master] % python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yubico
>>> import sys
>>> YK=yubico.find_yubikey()
>>> chal_hex="175ff6a6b675906d748b2a2b74dce6dc2f065685f4a69caa7f65e2167015745f4162f1b508d1eef7f5b319cf4bf3f435daca4e387152005e253e4694e9091781"
>>> import binascii
>>> chal = binascii.unhexlify(chal_hex)
>>> YK.challenge_response(chal, slot=2)
" \x08\xb9\x87!N\x071'\x00nAf\xef\x18\x92B\xdb\xf05"
>>> binascii.hexlify(YK.challenge_response(chal, slot=2))
'2008b987214e073127006e4166ef189242dbf035'
>>>
Well! This looks fine and produces the same response! So now I know the following:
1. My initialization is working fine.
2. My Yubikey is working fine
3. My response verification code has a problem with challenges larger than 32 bytes....
Thanks for you patience and help.
I will look into this.
Kind regards
Cornelius