-
Notifications
You must be signed in to change notification settings - Fork 24k
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
openssl_*: private key handling with passphrases? #53535
Comments
Files identified in the description:
If these files are inaccurate, please update the |
If a user specifies a passphrase, but the key is encrypted with a different one (which includes a After all, someone is trying to access a resource that is not in the expected state and the module has no way to rectify this. Yes, we could try to automatically guess what else might be intended (in other contexts one might try |
We discussed this point and the questions raised in #36738 today in IRC (mostly with @Spredzy and @Shaps). We eventually agreed on the following:
|
resolved_by_pr #54294 (Everything else needed has already been merged.) |
That's merged now. close_me |
SUMMARY
This is not really a bug, but a discussion ticket, to continue the discussion started in #53489.
In that PR, the behavior for the PyOpenSSL backends was changed so that they behave similarly to the cryptography backends (for modules having both): namely, private keys loaded with no passphrase will fail if they are encrypted (before: module would hang because PyOpenSSL would wait for user to enter passphrase), and unencrypted private keys loaded with a passphrase will also fail. The former change is clearly a bugfix, but how the latter should behave is debatable.
This change is necessary to achieve proper idempotence checks for
openssl_privatekey
. Here everything's fine.For the other modules, though, they will now fail if you try to load a private key and specify a passphrase, even though the key is unencrypted. Do we want this? Or should the modules ignore this? (This new behavior was already the case for the
cryptography
backend foropenssl_csr
.cryptography
fails by default if you specify a passphrase and it is not needed.)@Spredzy @MarkusTeufelberger (or anybody else interested): what do you think?
ISSUE TYPE
COMPONENT NAME
openssl_privatekey
openssl_csr
openssl_certificate
openssl_publickey
openssl_pkcs12
ANSIBLE VERSION
The text was updated successfully, but these errors were encountered: