summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2013-12-23 16:23:32 -0800
committerW. Trevor King <wking@tremily.us>2013-12-23 16:23:32 -0800
commit860523d288793d0ebc4867ea0d5234712562bc32 (patch)
treef7b4622af5bd39aee2958baffaa479cbe7f08d7e
parentaf058ee6f5da391a05275470ab4a4a96aa22b350 (diff)
downloadpycrypto-860523d288793d0ebc4867ea0d5234712562bc32.tar.gz
Sign the hash in the the PKCS1_PSS doctest, not the key
As it stood before this commit, the hash was never used in the signing process. It looks like the bug was introduced by e053629 (Restructure both PKCS#1 signature schemes as objects, 2011-10-16), which changed: - >>> signature = PKCS1_PSS.sign(h, key) + >>> signer = PKCS1_PSS.new(key) + >>> signature = PKCS1_PSS.sign(key)
-rw-r--r--lib/Crypto/Signature/PKCS1_PSS.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Crypto/Signature/PKCS1_PSS.py b/lib/Crypto/Signature/PKCS1_PSS.py
index 3840959..fb97b21 100644
--- a/lib/Crypto/Signature/PKCS1_PSS.py
+++ b/lib/Crypto/Signature/PKCS1_PSS.py
@@ -39,7 +39,7 @@ this:
>>> h = SHA1.new()
>>> h.update(message)
>>> signer = PKCS1_PSS.new(key)
- >>> signature = signer.sign(key)
+ >>> signature = signer.sign(h)
At the receiver side, verification can be done like using the public part of
the RSA key: