aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2018-12-18 09:48:51 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2018-12-17 20:48:51 -0500
commit7deaf5a8397b3c1fae5e6e3ffb788146f24c4af4 (patch)
tree74c2dad2f2fac8b9633f0c7170fb26de7f826012 /tests/hazmat/primitives
parent3c137d909dc004fbcab4a1593c3a6430882fd853 (diff)
downloadcryptography-7deaf5a8397b3c1fae5e6e3ffb788146f24c4af4.tar.gz
cryptography-7deaf5a8397b3c1fae5e6e3ffb788146f24c4af4.tar.bz2
cryptography-7deaf5a8397b3c1fae5e6e3ffb788146f24c4af4.zip
handle empty byte string in from_encoded_point (#4649)
* handle empty byte string in from_encoded_point * move the error
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r--tests/hazmat/primitives/test_ec.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
index 7cf9a09a..f883d065 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -1071,6 +1071,12 @@ class TestEllipticCurvePEMPublicKeySerialization(object):
ec.SECP384R1(), bad_data
)
+ def test_from_encoded_point_empty_byte_string(self):
+ with pytest.raises(ValueError):
+ ec.EllipticCurvePublicKey.from_encoded_point(
+ ec.SECP384R1(), b""
+ )
+
def test_from_encoded_point_not_a_curve(self):
with pytest.raises(TypeError):
ec.EllipticCurvePublicKey.from_encoded_point(