aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2017-06-30 15:50:23 -0700
committerPaul Kehrer <paul.l.kehrer@gmail.com>2017-06-30 17:50:23 -0500
commit51f049ab3c6eaddd2afc5b089d54ac7b8244fa1e (patch)
treee00c0aa93e9693d582363bcfe567ed7af405e5b4 /tests/hazmat
parentb16206e4f5c1f2c18eebe669713df7223b0f4cb0 (diff)
downloadcryptography-51f049ab3c6eaddd2afc5b089d54ac7b8244fa1e.tar.gz
cryptography-51f049ab3c6eaddd2afc5b089d54ac7b8244fa1e.tar.bz2
cryptography-51f049ab3c6eaddd2afc5b089d54ac7b8244fa1e.zip
Fixed a memory leak in EC private numbers (#3741)
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/backends/test_openssl_memleak.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/hazmat/backends/test_openssl_memleak.py b/tests/hazmat/backends/test_openssl_memleak.py
index e58090a9..6e92e341 100644
--- a/tests/hazmat/backends/test_openssl_memleak.py
+++ b/tests/hazmat/backends/test_openssl_memleak.py
@@ -190,21 +190,27 @@ class TestOpenSSLMemoryLeaks(object):
cert.extensions
"""), [path])
- def test_ec_public_numbers_public_key(self):
+ def test_ec_private_numbers_private_key(self):
assert_no_memory_leaks(textwrap.dedent("""
def func():
from cryptography.hazmat.backends.openssl import backend
from cryptography.hazmat.primitives.asymmetric import ec
- ec.EllipticCurvePublicNumbers(
- curve=ec.SECP384R1(),
- x=int(
- '10036914308591746758780165503819213553101287571902957054148542'
- '504671046744460374996612408381962208627004841444205030'
+ ec.EllipticCurvePrivateNumbers(
+ private_value=int(
+ '280814107134858470598753916394807521398239633534281633982576099083'
+ '35787109896602102090002196616273211495718603965098'
),
- y=int(
- '17337335659928075994560513699823544906448896792102247714689323'
- '575406618073069185107088229463828921069465902299522926'
+ public_numbers=ec.EllipticCurvePublicNumbers(
+ curve=ec.SECP384R1(),
+ x=int(
+ '10036914308591746758780165503819213553101287571902957054148542'
+ '504671046744460374996612408381962208627004841444205030'
+ ),
+ y=int(
+ '17337335659928075994560513699823544906448896792102247714689323'
+ '575406618073069185107088229463828921069465902299522926'
+ )
)
- ).public_key(backend)
+ ).private_key(backend)
"""))