aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-01-10 20:21:35 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2014-01-10 20:21:35 -0800
commit51d0794459e5476174f6cad58c4b88338945bb54 (patch)
treef6423f1fa05156b0ef8081a78e9afac9d6dcd586 /tests/hazmat/backends/test_openssl.py
parentf523badfb0bf41ea7b42798673788c93dfd0273e (diff)
parent985d99d2934befe8bcf6257cbd9036dee1934ed9 (diff)
downloadcryptography-51d0794459e5476174f6cad58c4b88338945bb54.tar.gz
cryptography-51d0794459e5476174f6cad58c4b88338945bb54.tar.bz2
cryptography-51d0794459e5476174f6cad58c4b88338945bb54.zip
Merge pull request #457 from reaperhulk/fix-456
add tests to the openssl backend to verify that we've registered
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r--tests/hazmat/backends/test_openssl.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index ad399594..2a329920 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -95,3 +95,21 @@ class TestOpenSSL(object):
backend._lib.EVP_F_EVP_DECRYPTFINAL_EX,
0
)
+
+ def test_ssl_ciphers_registered(self):
+ meth = backend._lib.TLSv1_method()
+ ctx = backend._lib.SSL_CTX_new(meth)
+ assert ctx != backend._ffi.NULL
+ backend._lib.SSL_CTX_free(ctx)
+
+ def test_evp_ciphers_registered(self):
+ cipher = backend._lib.EVP_get_cipherbyname(b"aes-256-cbc")
+ assert cipher != backend._ffi.NULL
+
+ def test_error_strings_loaded(self):
+ # returns a value in a static buffer
+ err = backend._lib.ERR_error_string(101183626, backend._ffi.NULL)
+ assert backend._ffi.string(err) == (
+ b"error:0607F08A:digital envelope routines:EVP_EncryptFinal_ex:"
+ b"data not multiple of block length"
+ )