libnitrokey
libnitrokey copied to clipboard
Avoid unnecessary commands when querying the retry counts
https://github.com/Nitrokey/libnitrokey/blob/d75348816e1254fc0d051e9c454516c32d8d71d7/NitrokeyManager.cc#L788-L802
Isn’t it possible to directly use the response of GetDeviceStatus
for Storage devices?
Good catch! Indeed, on the firmware side the status call refreshes the smart card counters, and seems to return the correct values. I guess this was supposed to be an early return for the Nitrokey Storage, but somehow was not implemented.
Firmware side implementation: https://github.com/Nitrokey/nitrokey-storage-firmware/blob/f376b081d5900f9e494f74230f79df7552ae8e1f/src/USER_INTERFACE/html_io.c#L575-L588