OpenSSL 4 CLI compatibility (#1005) (#1010)

* OpenSSL 4 text output leaves leading 00: away.

* Split up key parsing function.

* Add tests.

(cherry picked from commit 1a96fe0bbc)
(cherry picked from commit fa36f75812)
This commit is contained in:
Felix Fontein
2026-04-25 16:37:08 +02:00
committed by GitHub
parent b3a65657ca
commit 8304ed4c88
2 changed files with 3 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
bugfixes:
- "acme_* modules - adjust OpenSSL RSA private key output parsing to OpenSSL 4.0.0 (https://github.com/ansible-collections/community.crypto/pull/1005)."

View File

@@ -164,7 +164,7 @@ class OpenSSLCLIBackend(CryptoBackend):
if account_key_type == "rsa":
pub_hex = re.search(
r"modulus:\n\s+00:([a-f0-9\:\s]+?)\npublicExponent",
r"modulus:\n\s+(?:00:)?([a-f0-9\:\s]+?)\npublicExponent",
out_text,
re.MULTILINE | re.DOTALL,
).group(1)