Nitrokey / libnitrokey

Communicate with Nitrokey devices in a clean and easy manner
https://nitrokey.com/
GNU Lesser General Public License v3.0
65 stars 34 forks source link

NK_list_devices() hangs with plugged in Nitrokey FIDO2 device #193

Closed daringer closed 3 years ago

daringer commented 3 years ago

Bug report: The NK_list_devices() C-API call, while a Nitrokey FIDO2 device is plugged in, will never return and load one cpu.

How to reproduce:

using namespace std;

int main() { struct NK_device_info* x = NK_list_devices(); cout << x->model << endl; cout << x->path << endl; cout << x->serial_number << endl; }


* compile it using: `g++ nk.cc -o nk -lnitrokey -I/usr/include`
* run it: `./nk`

**Observed behavior:** The executable will hang inside the `NK_list_devices()` call

**Expected behavior:** The executable should return immediately, while ignoring any other devices 

**Environment:**
* Arch Linux (Kernel 5.9.12-arch1-1, AMD64)
* libnitrokey version 3.6 (package release 1)
* Nitrokey FIDO2 & Nitrokey Pro 2
robin-nitrokey commented 3 years ago

I have the same issue with libnitrokey 3.6 on Debian with kernel 5.10.0-0.bpo.4-amd64.