You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that wiping a RSA key only wipe the private part but not the type field. As a result, any subsequent use of the wiped key doesn't fail with Error no RSA Private Key set in this slot as expected. For example, wiping a RSA key and then sending a OKSIGN results in Error invalid key, key check failed.
When wiping an ECC key the type field is correctly set to 0, and every subsequent use of the key results in Error no ECC Private Key set in this slot.
Code involved
The code to patch, if the described behavior is indeed a bug, is located in okcore.cpp, in the rsa_priv_flash function:
Hi!
I noticed that wiping a RSA key only wipe the private part but not the
type
field. As a result, any subsequent use of the wiped key doesn't fail withError no RSA Private Key set in this slot
as expected. For example, wiping a RSA key and then sending aOKSIGN
results inError invalid key, key check failed
.When wiping an ECC key the
type
field is correctly set to 0, and every subsequent use of the key results inError no ECC Private Key set in this slot
.Code involved
The code to patch, if the described behavior is indeed a bug, is located in okcore.cpp, in the
rsa_priv_flash
function:libraries/onlykey/okcore.cpp
Lines 5097 to 5108 in c8804e3
I think there should be
okeeprom_eeset_rsakey(0, (int)buffer[5]);
inserted somewhere in this bloc.The text was updated successfully, but these errors were encountered: