aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_rsa.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-20 10:25:48 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-04-20 16:53:04 -0500
commit8e764396471beb13d0cdfbc9a299b9445f96abb2 (patch)
tree2e4ee7f670cd5de0da24929453d67900728223e1 /tests/hazmat/primitives/test_rsa.py
parent8ab7a360330daa195ea1c0cf70d606dc7dce88c8 (diff)
downloadcryptography-8e764396471beb13d0cdfbc9a299b9445f96abb2.tar.gz
cryptography-8e764396471beb13d0cdfbc9a299b9445f96abb2.tar.bz2
cryptography-8e764396471beb13d0cdfbc9a299b9445f96abb2.zip
more key length checks, docs update
Diffstat (limited to 'tests/hazmat/primitives/test_rsa.py')
-rw-r--r--tests/hazmat/primitives/test_rsa.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index 69fd2933..a5266d57 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -1249,8 +1249,10 @@ class TestRSADecryption(object):
public_exponent=private["public_exponent"],
modulus=private["modulus"]
)
+ ciphertext = binascii.unhexlify(example["encryption"])
+ assert len(ciphertext) == math.ceil(skey.key_size / 8.0)
message = skey.decrypt(
- binascii.unhexlify(example["encryption"]),
+ ciphertext,
padding.PKCS1v15(),
backend
)