diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-04-23 21:51:47 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-05-03 19:43:55 +0100 |
commit | 0d070cfa49210cb9f01a0d101db313c2fac0f212 (patch) | |
tree | e2de92b83a386c0438fb7141c2715f9a24ca8f47 /tests/hazmat/backends | |
parent | 1c851f63c55835961ce12d7d40131b45928761f1 (diff) | |
download | cryptography-0d070cfa49210cb9f01a0d101db313c2fac0f212.tar.gz cryptography-0d070cfa49210cb9f01a0d101db313c2fac0f212.tar.bz2 cryptography-0d070cfa49210cb9f01a0d101db313c2fac0f212.zip |
OpenSSL key loading implementation
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index bba7d758..37347bc8 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -13,6 +13,8 @@ from __future__ import absolute_import, division, print_function +import pretend + import pytest from cryptography import utils @@ -358,3 +360,14 @@ class TestOpenSSLCMAC(object): with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): backend.create_cmac_ctx(FakeAlgorithm()) + + +class TestOpenSSLSerialisationWithOpenSSL(object): + def test_password_too_long(self): + ffi_cb, cb = backend._pem_password_cb(b"aa") + assert cb(None, 1, False, None) == 0 + + def test_unsupported_evp_pkey_type(self): + key = pretend.stub(type="unsupported") + with raises_unsupported_algorithm(None): + backend._evp_pkey_to_private_key(key) |