Skip to content

Commit

Permalink
Support Linux bundle OpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Sep 4, 2019
1 parent 2a7d7ac commit d3fce8c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/Crypt/CryptConnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 7 additions & 6 deletions src/util/OpensslFindPatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d3fce8c

Please sign in to comment.