-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locking and unlocking a factory-reset device blocks encrypted storage #80
Comments
Hi! Nice test case. src/OTP/report_protocol.h:154:
For zeroed AES key case, a |
I think the problem is that #include <assert.h>
#include <unistd.h>
#include <libnitrokey/NK_C_API.h>
int main()
{
NK_set_debug(true);
assert(NK_login_auto() == 1);
assert(NK_factory_reset("12345678") == 0);
sleep(2);
assert(NK_build_aes_key("12345678") == 0);
assert(NK_enable_password_safe("123456") == 0);
return 0;
} With a two second delay, I get an error (and no log entries about the Nitrokey being busy while generating the AES key). With three seconds, it works as expected. |
cc @d-e-s-o |
My proposition of a workaround is to incorporate the delay into the libnitrokey itself for an older firmwares, and until this one will not be fixed. Later on it could be removed. |
During testing, I noticed that after performing these commands in this order, I can no longer unlock the encrypted storage:
Example code:
I attached the debugging output.
out.txt
The text was updated successfully, but these errors were encountered: