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
0 length passwords not accepted when importing PKCS8 encrypted key #4716
Comments
|
It's been like this since the beginning of time, or at least as far as I can look through history (d02b48c is the import of SSLeay 0.8.1b, see crypto/pem/pem_lib.c). I'm not sure I'd call that a bug visavi the specs, unless the specs forbid applications and libraries from rejecting 0 length passphrases. Of course, we can change this, and it's a fairly simple change. What says the rest of @openssl? |
|
pkcs8 has the |
|
Ah, thanks for the reminder |
|
@engineercrypto, is that a satisfactory answer? |
|
Looking at this again, I see that @engineercrypto is right that it's not satisfactory, as what they are looking for is to have an encryption key derived from a 0-length password rather than not encrypting at all. There's a nuance between the two. I see no harm at all making the desired change. |
|
Actually, looking again at the code, the 1 length limitation is kinda silly in the cases where we ask |
One of my colleagues reports that 0 length passwords are not accepted when importing a PKCS8 encrypted key. To see why, go to pem_pkey.c:116 (in branch 1.0.2 stable). Notice that the comparison for password length is <= 0 rather than < 0, which disallows 0 length passwords.
Note that the PKCS 8 and PKCS 5 specifications do not disallow 0 length passwords, so this is a bug.
The text was updated successfully, but these errors were encountered: