diff options
author | W. Trevor King <wking@tremily.us> | 2013-12-23 16:23:32 -0800 |
---|---|---|
committer | W. Trevor King <wking@tremily.us> | 2013-12-23 16:23:32 -0800 |
commit | 860523d288793d0ebc4867ea0d5234712562bc32 (patch) | |
tree | f7b4622af5bd39aee2958baffaa479cbe7f08d7e | |
parent | af058ee6f5da391a05275470ab4a4a96aa22b350 (diff) | |
download | pycrypto-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.py | 2 |
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: |