diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-05-21 14:32:35 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-05-21 14:32:35 -0500 |
commit | 4713a2d96c0fafdfda7c17bc2af054086a76c0d3 (patch) | |
tree | 01c2aa69b5c8e2edd1c5233967f632702228d5ed /cryptography | |
parent | ae14644d2dbc98fe787c1d30a40934a682d71f23 (diff) | |
download | cryptography-4713a2d96c0fafdfda7c17bc2af054086a76c0d3.tar.gz cryptography-4713a2d96c0fafdfda7c17bc2af054086a76c0d3.tar.bz2 cryptography-4713a2d96c0fafdfda7c17bc2af054086a76c0d3.zip |
load the openssl version text based on the loaded library
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 7 | ||||
-rw-r--r-- | cryptography/hazmat/bindings/openssl/opensslv.py | 2 |
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; """ |