aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-04-11 20:57:13 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2019-04-11 08:57:13 -0400
commit92241410b5b0591d849443b3023992334a4be0a2 (patch)
tree0648442194c4a9e4c70ba89591a8bae1188bd9b2 /tests
parentb839786c26e3d01691d476bf2895f73784256801 (diff)
downloadcryptography-92241410b5b0591d849443b3023992334a4be0a2.tar.gz
cryptography-92241410b5b0591d849443b3023992334a4be0a2.tar.bz2
cryptography-92241410b5b0591d849443b3023992334a4be0a2.zip
fix a memory leak in AIA parsing (#4836)
* fix a memory leak in AIA parsing * oops can't remove that
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():