aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py5
-rw-r--r--cryptography/hazmat/primitives/asymmetric/ec.py2
-rw-r--r--tests/hazmat/primitives/test_ec.py8
3 files changed, 6 insertions, 9 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 65fcbcb1..46ecde15 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -492,9 +492,6 @@ class Backend(object):
curve = self._sn_to_elliptic_curve(sn)
- point = self._lib.EC_POINT_new(group)
- assert point != self._ffi.NULL
- point = self._ffi.gc(point, self._lib.EC_POINT_free)
return _EllipticCurvePrivateKey(self, ec_cdata, curve)
else:
raise UnsupportedAlgorithm("Unsupported key type.")
@@ -1066,7 +1063,7 @@ class Backend(object):
def _sn_to_elliptic_curve(self, sn):
try:
- return ec.CURVE_TYPES[sn]()
+ return ec._CURVE_TYPES[sn]()
except KeyError:
raise UnsupportedAlgorithm(
"{0} is not a supported elliptic curve".format(sn),
diff --git a/cryptography/hazmat/primitives/asymmetric/ec.py b/cryptography/hazmat/primitives/asymmetric/ec.py
index 813e2c9e..98eca276 100644
--- a/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -184,7 +184,7 @@ class SECP192R1(object):
return 192
-CURVE_TYPES = {
+_CURVE_TYPES = {
"prime192v1": SECP192R1,
"prime256v1": SECP256R1,
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
index 84a25868..65461f70 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -142,7 +142,7 @@ class TestECDSAVectors(object):
))
)
def test_signing_with_example_keys(self, backend, vector, hash_type):
- curve_type = ec.CURVE_TYPES[vector['curve']]
+ curve_type = ec._CURVE_TYPES[vector['curve']]
_skip_ecdsa_vector(backend, curve_type, hash_type)
@@ -168,7 +168,7 @@ class TestECDSAVectors(object):
verifier.verify()
@pytest.mark.parametrize(
- "curve", ec.CURVE_TYPES.values()
+ "curve", ec._CURVE_TYPES.values()
)
def test_generate_vector_curves(self, backend, curve):
_skip_curve_unsupported(backend, curve())
@@ -224,7 +224,7 @@ class TestECDSAVectors(object):
)
def test_signatures(self, backend, vector):
hash_type = _HASH_TYPES[vector['digest_algorithm']]
- curve_type = ec.CURVE_TYPES[vector['curve']]
+ curve_type = ec._CURVE_TYPES[vector['curve']]
_skip_ecdsa_vector(backend, curve_type, hash_type)
@@ -256,7 +256,7 @@ class TestECDSAVectors(object):
)
def test_signature_failures(self, backend, vector):
hash_type = _HASH_TYPES[vector['digest_algorithm']]
- curve_type = ec.CURVE_TYPES[vector['curve']]
+ curve_type = ec._CURVE_TYPES[vector['curve']]
_skip_ecdsa_vector(backend, curve_type, hash_type)