diff --git a/changelogs/fragments/56808-openssl_pkcs12-passphrase-crash.yml b/changelogs/fragments/56808-openssl_pkcs12-passphrase-crash.yml new file mode 100644 index 0000000000..d7a004c7f6 --- /dev/null +++ b/changelogs/fragments/56808-openssl_pkcs12-passphrase-crash.yml @@ -0,0 +1,2 @@ +bugfixes: +- "openssl_pkcs12 - fixes crash when private key has a passphrase and the module is run a second time." diff --git a/lib/ansible/modules/crypto/openssl_pkcs12.py b/lib/ansible/modules/crypto/openssl_pkcs12.py index 983247bcfb..6537349546 100644 --- a/lib/ansible/modules/crypto/openssl_pkcs12.py +++ b/lib/ansible/modules/crypto/openssl_pkcs12.py @@ -227,7 +227,7 @@ class Pkcs(crypto_utils.OpenSSLObject): def _check_pkey_passphrase(): if self.privatekey_passphrase: try: - crypto_utils.load_privatekey(self.path, + crypto_utils.load_privatekey(self.privatekey_path, self.privatekey_passphrase) except crypto.Error: return False