aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_openssl_memleak.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-11-29 11:51:38 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2018-11-28 22:51:38 -0500
commite4e7b89fb627b372cde4158ceb7078d8769497cb (patch)
tree9dc87beda0cf2d1a948feea01c87361feb1a32af /tests/hazmat/backends/test_openssl_memleak.py
parent2f2f3d2e414a0167ae3a98b9b608904b2c76a35f (diff)
downloadcryptography-e4e7b89fb627b372cde4158ceb7078d8769497cb.tar.gz
cryptography-e4e7b89fb627b372cde4158ceb7078d8769497cb.tar.bz2
cryptography-e4e7b89fb627b372cde4158ceb7078d8769497cb.zip
PKCS12 Basic Parsing (#4553)
* PKCS12 parsing support * running all the tests is so gauche * rename func * various significant fixes * dangerous idiot here * move pkcs12 * docs updates * a bit more prose
Diffstat (limited to 'tests/hazmat/backends/test_openssl_memleak.py')
-rw-r--r--tests/hazmat/backends/test_openssl_memleak.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py
index 483387af..6f42ed79 100644
--- a/tests/hazmat/backends/test_openssl_memleak.py
+++ b/tests/hazmat/backends/test_openssl_memleak.py
@@ -307,3 +307,21 @@ class TestOpenSSLMemoryLeaks(object):
).add_extension(x509.OCSPNonce(b"0000"), False)
req = builder.build()
"""))
+
+ @pytest.mark.parametrize("path", [
+ "pkcs12/cert-aes256cbc-no-key.p12",
+ "pkcs12/cert-key-aes256cbc.p12",
+ ])
+ def test_load_pkcs12_key_and_certificates(self, path):
+ assert_no_memory_leaks(textwrap.dedent("""
+ def func(path):
+ from cryptography import x509
+ from cryptography.hazmat.backends.openssl import backend
+ from cryptography.hazmat.primitives.serialization import pkcs12
+ import cryptography_vectors
+
+ with cryptography_vectors.open_vector_file(path, "rb") as f:
+ pkcs12.load_key_and_certificates(
+ f.read(), b"cryptography", backend
+ )
+ """), [path])