diff options
author | Benoit Foucher <benoit@zeroc.com> | 2014-11-18 17:46:54 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2014-11-18 17:46:54 +0100 |
commit | 2e7acc9d17a664ef939e95511d67fd9b0f35e4b3 (patch) | |
tree | 2dd9db75f80cc84baf433f5e1d3292cbd64d4f86 /certs/makecerts.py | |
parent | Don't require setting of iceHome for localOnly gradle build (diff) | |
download | ice-2e7acc9d17a664ef939e95511d67fd9b0f35e4b3.tar.bz2 ice-2e7acc9d17a664ef939e95511d67fd9b0f35e4b3.tar.xz ice-2e7acc9d17a664ef939e95511d67fd9b0f35e4b3.zip |
Removed unused DSA certs, minor fix to makecerts.py
Diffstat (limited to 'certs/makecerts.py')
-rwxr-xr-x | certs/makecerts.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/certs/makecerts.py b/certs/makecerts.py index 76f57656382..9f7d211f666 100755 --- a/certs/makecerts.py +++ b/certs/makecerts.py @@ -56,6 +56,13 @@ if not os.path.exists("ImportKey.class") or os.path.basename(cwd) != "certs": print("You must run this script from the certs directory") sys.exit(1) +# +# Make sure keytool is available +# +if subprocess.call("keytool", shell=True, stdout=DEVNULL, stderr=DEVNULL) != 0: + print("error: couldn't run keytool, make sure the Java bin directory is in your PATH,\nkeytool is required to generate Java certificates") + sys.exit(1) + bksSupport = True if subprocess.call("javap org.bouncycastle.jce.provider.BouncyCastleProvider", shell=True, stdout=DEVNULL, stderr=DEVNULL) != 0: print("warning: couldn't find Bouncy Castle provider, Android certificates won't be created") @@ -217,11 +224,13 @@ def run(cmd): p = subprocess.Popen(cmd, shell = True, stdin = subprocess.PIPE, - stdout = subprocess.STDOUT if debug else DEVNULL, - stderr = subprocess.STDERR if debug else DEVNULL, + stdout = subprocess.STDOUT if debug else subprocess.PIPE, + stderr = subprocess.STDERR if debug else subprocess.PIPE, bufsize = 0) if p.wait() != 0: - print("command failed:" + cmd) + print("command failed:" + cmd + "\n") + for line in p.stdout.readlines(): + print(line.decode("utf-8").strip()) sys.exit(1) def runOpenSSL(command): @@ -356,6 +365,7 @@ caCert = os.path.join(caHome, "cacert.pem") runOpenSSL("req -config " + config + " -x509 -days 1825 -newkey rsa:1024 -out " + caCert + " -outform PEM -nodes") runOpenSSL("x509 -in " + caCert + " -outform DER -out " + os.path.join(certs, "cacert.der")) # Convert to DER shutil.copyfile(caCert, os.path.join(certs, "cacert.pem")) +shutil.copyfile(os.path.join(caHome, "cakey.pem"), os.path.join(certs, "cakey.pem")) if os.path.exists("certs.jks"): os.remove("certs.jks") run("keytool -import -alias cacert -file cacert.der -keystore certs.jks -storepass password -noprompt") |