Yubico / yubikey-personalization

YubiKey Personalization cross-platform library and tool
https://developers.yubico.com/yubikey-personalization/
BSD 2-Clause "Simplified" License
300 stars 82 forks source link

Check current cofiguration before calling libusb_set_configuration #58

Closed pm-kan closed 9 years ago

pm-kan commented 9 years ago

White testing PasswordSafe's issue 1240 inside VirtualBox 4.3.22 with Ubuntu 14.04 x86_64 guest, I've found that application (and later all VM) hang after attaching Yubikey (fw 2.4.2). Further debugging shows that lock occurred at libusb_set_configuration call (lock also could be reproduced with 2 or 3 runs of ykinfo -s). In my case I was able to fix it by checking if current configuration is equal to desired before (re)setting it to 1 (as recommended at http://libusb.sourceforge.net/api-1.0/caveats.html#configsel).

klali commented 9 years ago

Looks good to me, thank you for this contribution!