-
Notifications
You must be signed in to change notification settings - Fork 15
Cannot import private keys that start with zero bytes #71
Comments
One variable I want to isolate is the version of NSS, as we went from 3.39 to 3.43 in the meantime between CI runs. |
I can reproduce this on Linux too, so I suspect it might be a bug in how I wrote the test. I can take a look now... |
I just compiled with NSS 3.39 and I don't see the test failing, which makes me now think that it might be a recent NSS bug. Does that sound right to you? If it'd be helpful, I can look through NSS changelog to see what might have happened. |
Oops, after running it for ~1000 iterations, I do see the test fail, even with NSS 3.39. So maybe it's a bug on our side after all... |
It looks like the failure always happens when the first byte of the private key is |
@rhelmer After some more debugging: It looks like The implementation of |
Thanks for tracking that down!
@franziskuskiefer Franziskus, do you have any thoughts? |
@rhelmer @franziskuskiefer Is there a chance that there is a bug in NSS's In particular, I created a test that
The import operation succeeds, but when I later try to use this private key,
In addition, when I later try to use this private key to decrypt valid ciphertexts, I get decryption failures. I get the same behavior even when I strip off the leading zeros before writing the private key into the PKCS#8 blob. |
This should be fixed by using the latest version of NSS. |
First seen on Travis, I can reproduce locally by running
ptest -v
in a loop:I've reproduced it on master (a898b55) after ~100 tries.
The text was updated successfully, but these errors were encountered: