CURVE_TYPES back to private, removed unneeded point creation
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py
index 65fcbcb..46ecde1 100644
--- a/cryptography/hazmat/backends/openssl/backend.py
+++ b/cryptography/hazmat/backends/openssl/backend.py
@@ -492,9 +492,6 @@
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 @@
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 813e2c9..98eca27 100644
--- a/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -184,7 +184,7 @@
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 84a2586..65461f7 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -142,7 +142,7 @@
))
)
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 @@
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 @@
)
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 @@
)
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)