aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-05-21 13:12:54 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-05-21 13:12:54 -0700
commit22f7dfbb3d916ff916b0c1db4692754d79afa066 (patch)
treeab1d3b00fb0861a48dc151ac79bc2513e3853e14
parent348926ef7efdde5ab673fe28dcaa8f399d4f91ee (diff)
parent4713a2d96c0fafdfda7c17bc2af054086a76c0d3 (diff)
downloadcryptography-22f7dfbb3d916ff916b0c1db4692754d79afa066.tar.gz
cryptography-22f7dfbb3d916ff916b0c1db4692754d79afa066.tar.bz2
cryptography-22f7dfbb3d916ff916b0c1db4692754d79afa066.zip
Merge pull request #1072 from reaperhulk/fix-1071
Make the OpenSSL version text reflect the loaded library
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py7
-rw-r--r--cryptography/hazmat/bindings/openssl/opensslv.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index bd5808ed..cd2a614e 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -112,11 +112,14 @@ class Backend(object):
def openssl_version_text(self):
"""
- Friendly string name of linked OpenSSL.
+ Friendly string name of the loaded OpenSSL library. This is not
+ necessarily the same version as it was compiled against.
Example: OpenSSL 1.0.1e 11 Feb 2013
"""
- return self._ffi.string(self._lib.OPENSSL_VERSION_TEXT).decode("ascii")
+ return self._ffi.string(
+ self._lib.SSLeay_version(self._lib.SSLEAY_VERSION)
+ ).decode("ascii")
def create_hmac_ctx(self, key, algorithm):
return _HMACContext(self, key, algorithm)
diff --git a/cryptography/hazmat/bindings/openssl/opensslv.py b/cryptography/hazmat/bindings/openssl/opensslv.py
index e4aa6212..ef6e057b 100644
--- a/cryptography/hazmat/bindings/openssl/opensslv.py
+++ b/cryptography/hazmat/bindings/openssl/opensslv.py
@@ -18,6 +18,8 @@ INCLUDES = """
"""
TYPES = """
+/* Note that these will be resolved when cryptography is compiled and are NOT
+ guaranteed to be the version that it actually loads. */
static const int OPENSSL_VERSION_NUMBER;
static const char *const OPENSSL_VERSION_TEXT;
"""