summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/ec.py9
-rw-r--r--src/cryptography/utils.py1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py
index 6b1de7c5b..125235f8b 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -5,6 +5,7 @@
from __future__ import absolute_import, division, print_function
import abc
+import warnings
import six
@@ -366,6 +367,14 @@ class EllipticCurvePublicNumbers(object):
if not isinstance(curve, EllipticCurve):
raise TypeError("curve must be an EllipticCurve instance")
+ warnings.warn(
+ "Support for unsafe construction of public numbers from "
+ "encoded data will be removed in a future version. "
+ "Please use EllipticCurvePublicKey.from_encoded_point",
+ utils.DeprecatedIn25,
+ stacklevel=2,
+ )
+
if data.startswith(b'\x04'):
# key_size is in bits. Convert to bytes and round up
byte_length = (curve.key_size + 7) // 8
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 65a4ee71b..cbbae3a79 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -23,6 +23,7 @@ class CryptographyDeprecationWarning(UserWarning):
PersistentlyDeprecated = CryptographyDeprecationWarning
DeprecatedIn21 = CryptographyDeprecationWarning
DeprecatedIn23 = CryptographyDeprecationWarning
+DeprecatedIn25 = CryptographyDeprecationWarning
def _check_bytes(name, value):