From 01c9dac7c0ac33fb3dd73ab32322f7fc1699c059 Mon Sep 17 00:00:00 2001
From: Paul Kehrer <paul.l.kehrer@gmail.com>
Date: Mon, 9 Jul 2018 20:13:01 +0530
Subject: document that an ECPublicNumbers object has some unexpected
 properties (#4319)

* document that an ECPublicNumbers object has some unexpected properties

It is not guaranteed to be a valid point on the curve as that is not
checked until you convert it to a PublicKey object.

* different language

* move the text, make it a warning, alter the language

* new language
---
 docs/hazmat/primitives/asymmetric/ec.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'docs')

diff --git a/docs/hazmat/primitives/asymmetric/ec.rst b/docs/hazmat/primitives/asymmetric/ec.rst
index bbab2246..ab781e92 100644
--- a/docs/hazmat/primitives/asymmetric/ec.rst
+++ b/docs/hazmat/primitives/asymmetric/ec.rst
@@ -152,6 +152,13 @@ Elliptic Curve Signature Algorithms
 
 .. class:: EllipticCurvePublicNumbers(x, y, curve)
 
+    .. warning::
+        The point represented by this object is not validated in any way until
+        :meth:`EllipticCurvePublicNumbers.public_key` is called and may not
+        represent a valid point on the curve. You should not attempt to perform
+        any computations using the values from this class until you have either
+        validated it yourself or called ``public_key()`` successfully.
+
     .. versionadded:: 0.5
 
     The collection of integers that make up an EC public key.
@@ -182,6 +189,7 @@ Elliptic Curve Signature Algorithms
         :param backend: An instance of
             :class:`~cryptography.hazmat.backends.interfaces.EllipticCurveBackend`.
 
+        :raises ValueError: Raised if the point is invalid for the curve.
         :returns: A new instance of :class:`EllipticCurvePublicKey`.
 
     .. method:: encode_point()
-- 
cgit v1.2.3