From d3fce8ca361f3e7d1e022cdd3446cb62605aa336 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 4 Sep 2019 20:16:32 +0200 Subject: [PATCH] Support Linux bundle OpenSSL --- src/Crypt/CryptConnection.py | 4 +++- src/util/OpensslFindPatch.py | 13 +++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Crypt/CryptConnection.py b/src/Crypt/CryptConnection.py index c5ee2761f..866537b7f 100644 --- a/src/Crypt/CryptConnection.py +++ b/src/Crypt/CryptConnection.py @@ -11,11 +11,13 @@ class CryptConnectionManager: def __init__(self): - # OpenSSL params if sys.platform.startswith("win"): self.openssl_bin = "tools\\openssl\\openssl.exe" + elif config.dist_type.startswith("bundle_linux"): + self.openssl_bin = "../runtime/bin/openssl" else: self.openssl_bin = "openssl" + self.openssl_env = { "OPENSSL_CONF": "src/lib/openssl/openssl.cnf", "RANDFILE": config.data_dir + "/openssl-rand.tmp" diff --git a/src/util/OpensslFindPatch.py b/src/util/OpensslFindPatch.py index f5b88acc4..864882e96 100644 --- a/src/util/OpensslFindPatch.py +++ b/src/util/OpensslFindPatch.py @@ -11,18 +11,19 @@ def getOpensslPath(): if sys.platform.startswith("win"): lib_paths = [ - os.path.join(os.getcwd(), "tools/openssl/libeay32.dll"), + os.path.join(os.getcwd(), "tools/openssl/libeay32.dll"), # ZeroBundle Windows os.path.join(os.path.dirname(sys.executable), "DLLs/libcrypto-1_1-x64.dll"), os.path.join(os.path.dirname(sys.executable), "DLLs/libcrypto-1_1.dll") ] elif sys.platform == "cygwin": lib_paths = ["/bin/cygcrypto-1.0.0.dll"] - elif os.path.isfile("../lib/libcrypto.so"): # ZeroBundle OSX - lib_paths = ["../lib/libcrypto.so"] - elif os.path.isfile("/opt/lib/libcrypto.so.1.0.0"): # For optware and entware - lib_paths = ["/opt/lib/libcrypto.so.1.0.0"] else: - lib_paths = ["/usr/local/ssl/lib/libcrypto.so"] + lib_paths = [ + "../runtime/lib/libcrypto.so.1.1", # ZeroBundle Linux + "../lib/libcrypto.so", # ZeroBundle OSX + "/opt/lib/libcrypto.so.1.0.0", # For optware and entware + "/usr/local/ssl/lib/libcrypto.so" + ] for lib_path in lib_paths: if os.path.isfile(lib_path):