From 0d070cfa49210cb9f01a0d101db313c2fac0f212 Mon Sep 17 00:00:00 2001 From: Alex Stapleton Date: Wed, 23 Apr 2014 21:51:47 +0100 Subject: OpenSSL key loading implementation --- tests/hazmat/backends/test_openssl.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/hazmat/backends/test_openssl.py') 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) -- cgit v1.2.3