From 860523d288793d0ebc4867ea0d5234712562bc32 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Dec 2013 16:23:32 -0800 Subject: 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) --- lib/Crypto/Signature/PKCS1_PSS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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: -- cgit v1.2.1