diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-09-09 17:12:29 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2013-09-09 17:15:09 -0500 |
commit | eb49db17f85c1a359e319df1a9adadcc8ee7236f (patch) | |
tree | 6acab519a0b5e79f4809d8af71ab324384563c11 | |
parent | 733404a826678538f0b67d666d4c303b1ccc2204 (diff) | |
download | cryptography-eb49db17f85c1a359e319df1a9adadcc8ee7236f.tar.gz cryptography-eb49db17f85c1a359e319df1a9adadcc8ee7236f.tar.bz2 cryptography-eb49db17f85c1a359e319df1a9adadcc8ee7236f.zip |
ascii decode on openssl_version_text + doc string improvements
-rw-r--r-- | cryptography/bindings/openssl/api.py | 7 | ||||
-rw-r--r-- | tests/bindings/test_openssl.py | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/cryptography/bindings/openssl/api.py b/cryptography/bindings/openssl/api.py index 87ed38fa..2c8fae3d 100644 --- a/cryptography/bindings/openssl/api.py +++ b/cryptography/bindings/openssl/api.py @@ -55,9 +55,12 @@ class API(object): int EVP_CIPHER_block_size(const EVP_CIPHER *); """) - """ Friendly string name of linked OpenSSL. """ def openssl_version_text(self): - return self._ffi.string(api._lib.OPENSSL_VERSION_TEXT) + """ Friendly string name of linked OpenSSL. + + Example: OpenSSL 1.0.1e Feb 11, 2013 + """ + return self._ffi.string(api._lib.OPENSSL_VERSION_TEXT).decode("ascii") def create_block_cipher_context(self, cipher, mode): ctx = self._ffi.new("EVP_CIPHER_CTX *") diff --git a/tests/bindings/test_openssl.py b/tests/bindings/test_openssl.py index 8704d933..db71e328 100644 --- a/tests/bindings/test_openssl.py +++ b/tests/bindings/test_openssl.py @@ -19,4 +19,11 @@ class TestOpenSSL(object): assert api def test_openssl_version_text(self): + """ This test checks the value of OPENSSL_VERSION_TEXT. + + Unfortunately, this define does not appear to have a + formal content definition, so for now we'll test to see + if it starts with OpenSSL as that appears to be true + for every OpenSSL. + """ assert api.openssl_version_text().find("OpenSSL") == 0 |