From 391a1042c20fbe1a7b1d993b3c782efc7f9fdb72 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 22 May 2019 23:34:42 +0200 Subject: [PATCH] openssl_pkcs12: fix crash due to wrong path used for loading key in check mode (#56808) * Used wrong path for private key. * Add changelog. --- changelogs/fragments/56808-openssl_pkcs12-passphrase-crash.yml | 2 ++ lib/ansible/modules/crypto/openssl_pkcs12.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/56808-openssl_pkcs12-passphrase-crash.yml 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 00000000000..d7a004c7f65 --- /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 983247bcfbc..6537349546f 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