aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_asym_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/primitives/test_asym_utils.py')
-rw-r--r--tests/hazmat/primitives/test_asym_utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/hazmat/primitives/test_asym_utils.py b/tests/hazmat/primitives/test_asym_utils.py
index d817c651..b49ca3f2 100644
--- a/tests/hazmat/primitives/test_asym_utils.py
+++ b/tests/hazmat/primitives/test_asym_utils.py
@@ -31,10 +31,6 @@ def test_dss_signature():
assert sig3 == b"0\x06\x02\x01\x00\x02\x01\x00"
assert decode_dss_signature(sig3) == (0, 0)
- sig4 = encode_dss_signature(-1, 0)
- assert sig4 == b"0\x06\x02\x01\xFF\x02\x01\x00"
- assert decode_dss_signature(sig4) == (-1, 0)
-
def test_encode_dss_non_integer():
with pytest.raises(ValueError):
@@ -53,6 +49,11 @@ def test_encode_dss_non_integer():
encode_dss_signature("hello", "world")
+def test_encode_dss_negative():
+ with pytest.raises(ValueError):
+ encode_dss_signature(-1, 0)
+
+
def test_decode_dss_trailing_bytes():
with pytest.raises(ValueError):
decode_dss_signature(b"0\x06\x02\x01\x01\x02\x01\x01\x00\x00\x00")