aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_asym_utils.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-11-20 21:13:23 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2016-11-20 08:13:23 -0500
commit033bd7167d6546d34576dd0d798318999ec82a07 (patch)
tree0d4cd37af635d75692924a3edd2a260c574aa1ed /tests/hazmat/primitives/test_asym_utils.py
parentd3fd692441cc6ea8fd20dc0c3a834459ff27cf05 (diff)
downloadcryptography-033bd7167d6546d34576dd0d798318999ec82a07.tar.gz
cryptography-033bd7167d6546d34576dd0d798318999ec82a07.tar.bz2
cryptography-033bd7167d6546d34576dd0d798318999ec82a07.zip
support prehashing in RSA sign (#3238)
* support prehashing in RSA sign * check to make sure digest size matches prehashed data provided * move doctest for prehashed
Diffstat (limited to 'tests/hazmat/primitives/test_asym_utils.py')
-rw-r--r--tests/hazmat/primitives/test_asym_utils.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/hazmat/primitives/test_asym_utils.py b/tests/hazmat/primitives/test_asym_utils.py
index b9971137..bd1fa35e 100644
--- a/tests/hazmat/primitives/test_asym_utils.py
+++ b/tests/hazmat/primitives/test_asym_utils.py
@@ -7,8 +7,8 @@ from __future__ import absolute_import, division, print_function
import pytest
from cryptography.hazmat.primitives.asymmetric.utils import (
- decode_dss_signature, decode_rfc6979_signature,
- encode_dss_signature, encode_rfc6979_signature
+ Prehashed, decode_dss_signature, decode_rfc6979_signature,
+ encode_dss_signature, encode_rfc6979_signature,
)
@@ -76,3 +76,8 @@ def test_decode_dss_invalid_asn1():
# This is the BER "end-of-contents octets," which older versions of
# pyasn1 are wrongly willing to return from top-level DER decoding.
decode_dss_signature(b"\x00\x00")
+
+
+def test_pass_invalid_prehashed_arg():
+ with pytest.raises(TypeError):
+ Prehashed(object())