From 40baa274f979d29310ef54493d05cd2e52043417 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Tue, 10 Jul 2018 16:39:00 +0530 Subject: fix a memory leak when calling X25519PrivateKey.public_key() (#4326) --- tests/hazmat/backends/test_openssl_memleak.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py index cd453541..5cb7cbc7 100644 --- a/tests/hazmat/backends/test_openssl_memleak.py +++ b/tests/hazmat/backends/test_openssl_memleak.py @@ -225,3 +225,11 @@ class TestOpenSSLMemoryLeaks(object): from cryptography.hazmat.primitives.asymmetric import ec ec.derive_private_key(1, ec.SECP256R1(), backend) """)) + + def test_x25519_pubkey_from_private_key(self): + assert_no_memory_leaks(textwrap.dedent(""" + def func(): + from cryptography.hazmat.primitives.asymmetric import x25519 + private_key = x25519.X25519PrivateKey.generate() + private_key.public_key() + """)) -- cgit v1.2.3