[java-opensaml] 01/03: Update generate.py. Modern openssl genrsa barfs on -config

Brent Putman putmanb at georgetown.edu
Fri Sep 16 03:52:58 UTC 2022


This is an automated email from the git hooks/post-receive script.

putmanb pushed a commit to branch maint-4
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=ec3b691485c5bf5d9ac3ba5f70e973dc0fd2939a

commit ec3b691485c5bf5d9ac3ba5f70e973dc0fd2939a
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Fri Sep 9 21:06:37 2022 -0400

    Update generate.py. Modern openssl genrsa barfs on -config
---
 .../test/resources/org/opensaml/security/x509/impl/generate.py   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/opensaml-security-impl/src/test/resources/org/opensaml/security/x509/impl/generate.py b/opensaml-security-impl/src/test/resources/org/opensaml/security/x509/impl/generate.py
index 4db6c74ab..211ef6fe1 100755
--- a/opensaml-security-impl/src/test/resources/org/opensaml/security/x509/impl/generate.py
+++ b/opensaml-security-impl/src/test/resources/org/opensaml/security/x509/impl/generate.py
@@ -143,11 +143,14 @@ def gen_csr(key, csrout, subject, exts=None, digest=signing_digest):
     execute_openssl("req -new -key {} -out {} -subj {}  -{} {}", key, csrout, subject, digest, "-reqexts " + exts if exts else "")
 
 def gen_key(path, length=key_length):
-    execute_openssl("genrsa -out {} {}", path, length)
+    execute_openssl("genrsa -out {} {}", path, length, include_config=False)
 
-def execute_openssl(cmd, *fmt_params):
+def execute_openssl(cmd, *fmt_params, include_config=True):
     #print("execute_openssl:", cmd, fmt_params)
-    to_execute = " ".join(["openssl", cmd, "-config", openssl_config]).format(*fmt_params)
+    to_execute_list = ["openssl", cmd]
+    if include_config:
+        to_execute_list.extend(["-config", openssl_config])
+    to_execute = " ".join(to_execute_list).format(*fmt_params)
     print("to_execute", to_execute)
     # Just splitting the string like this is quick/dirty/kludgy, doesn't work if the arg values have spaces, etc.
     subprocess.call(to_execute.split())

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list