aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/backends/test_openssl_memleak.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py
index ed22b5db..f9ae1c46 100644
--- a/tests/hazmat/backends/test_openssl_memleak.py
+++ b/tests/hazmat/backends/test_openssl_memleak.py
@@ -210,7 +210,7 @@ class TestOpenSSLMemoryLeaks(object):
@pytest.mark.parametrize("path", [
"x509/PKITS_data/certs/ValidcRLIssuerTest28EE.crt",
])
- def test_x509_certificate_extensions(self, path):
+ def test_der_x509_certificate_extensions(self, path):
assert_no_memory_leaks(textwrap.dedent("""
def func(path):
from cryptography import x509
@@ -226,6 +226,25 @@ class TestOpenSSLMemoryLeaks(object):
cert.extensions
"""), [path])
+ @pytest.mark.parametrize("path", [
+ "x509/cryptography.io.pem",
+ ])
+ def test_pem_x509_certificate_extensions(self, path):
+ assert_no_memory_leaks(textwrap.dedent("""
+ def func(path):
+ from cryptography import x509
+ from cryptography.hazmat.backends.openssl import backend
+
+ import cryptography_vectors
+
+ with cryptography_vectors.open_vector_file(path, "rb") as f:
+ cert = x509.load_pem_x509_certificate(
+ f.read(), backend
+ )
+
+ cert.extensions
+ """), [path])
+
def test_x509_csr_extensions(self):
assert_no_memory_leaks(textwrap.dedent("""
def func():