diff --git a/src/Config.py b/src/Config.py index c461fe3a..f3704a18 100644 --- a/src/Config.py +++ b/src/Config.py @@ -8,7 +8,7 @@ class Config(object): def __init__(self, argv): self.version = "0.3.4" - self.rev = 665 + self.rev = 667 self.argv = argv self.action = None self.createParser() diff --git a/src/lib/opensslVerify/opensslVerify.py b/src/lib/opensslVerify/opensslVerify.py index 15ec2f1e..5294816f 100644 --- a/src/lib/opensslVerify/opensslVerify.py +++ b/src/lib/opensslVerify/opensslVerify.py @@ -195,14 +195,13 @@ ssl = None def openLibrary(): global ssl try: - dll_paths = [ - "src/lib/opensslVerify/libeay32.dll", - "/usr/local/ssl/lib/libcrypto.so", - "/bin/cygcrypto-1.0.0.dll" - ] - for dll_path in dll_paths : - if os.path.isfile(dll_path): - ssl = _OpenSSL(dll_path) + if sys.platform.startswith("win"): + dll_path = "src/lib/opensslVerify/libeay32.dll" + elif sys.platform == "cygwin": + dll_path = "/bin/cygcrypto-1.0.0.dll" + else: + dll_path = "/usr/local/ssl/lib/libcrypto.so" + ssl = _OpenSSL(dll_path) assert ssl except Exception, err: ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32') diff --git a/src/lib/pyelliptic/openssl.py b/src/lib/pyelliptic/openssl.py index d765a104..86c7eab5 100644 --- a/src/lib/pyelliptic/openssl.py +++ b/src/lib/pyelliptic/openssl.py @@ -431,15 +431,13 @@ class _OpenSSL: def openLibrary(): global OpenSSL try: - dll_paths = [ - "src/lib/opensslVerify/libeay32.dll", - "/usr/local/ssl/lib/libcrypto.so", - "/bin/cygcrypto-1.0.0.dll" - ] - for dll_path in dll_paths : - print dll_path - if os.path.isfile(dll_path): - ssl = _OpenSSL(dll_path) + if sys.platform.startswith("win"): + dll_path = "src/lib/opensslVerify/libeay32.dll" + elif sys.platform == "cygwin": + dll_path = "/bin/cygcrypto-1.0.0.dll" + else: + dll_path = "/usr/local/ssl/lib/libcrypto.so" + ssl = _OpenSSL(dll_path) assert ssl except Exception, err: ssl = _OpenSSL(ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto') or 'libeay32') diff --git a/src/util/SslPatch.py b/src/util/SslPatch.py index 915397c2..1daa7354 100644 --- a/src/util/SslPatch.py +++ b/src/util/SslPatch.py @@ -11,14 +11,13 @@ def openLibrary(): import ctypes import ctypes.util try: - dll_paths = [ - "src/lib/opensslVerify/libeay32.dll", - "/usr/local/ssl/lib/libcrypto.so", - "/bin/cygcrypto-1.0.0.dll" - ] - for dll_path in dll_paths: - if os.path.isfile(dll_path): - ssl = ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL) + if sys.platform.startswith("win"): + dll_path = "src/lib/opensslVerify/libeay32.dll" + elif sys.platform == "cygwin": + dll_path = "/bin/cygcrypto-1.0.0.dll" + else: + dll_path = "/usr/local/ssl/lib/libcrypto.so" + ssl = ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL) assert ssl except: dll_path = ctypes.util.find_library('ssl') or ctypes.util.find_library('crypto') or ctypes.util.find_library('libcrypto')