diff options
author | Tim Heckman <tim+code@timheckman.net> | 2012-10-17 21:09:43 -0400 |
---|---|---|
committer | Tim Heckman <tim+code@timheckman.net> | 2012-10-17 21:09:43 -0400 |
commit | 7446f0a8d0eadac1581d86891fac8b5c554cc13b (patch) | |
tree | 0c3311d211dd44e73a177cd424fa27f50cdec73c /rsa | |
parent | 14ba108859bb118f425b0e35054f3add6f006be2 (diff) | |
download | rsa-git-7446f0a8d0eadac1581d86891fac8b5c554cc13b.tar.gz |
rsa.pkcs1.verify() should return True when successful
- when verification passes verify() will return True, instead of
None. If verification fails the function will still raise a
rsa.pkcs1.VerificationError for legacy purposes.
- update the docs to note that the verify() function returns True
when successful
- write unit tests to verify this new behavior
This commit passes all build tests:
Ran 44 tests in 1.217s
OK
Diffstat (limited to 'rsa')
-rw-r--r-- | rsa/pkcs1.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rsa/pkcs1.py b/rsa/pkcs1.py index 1274fe3..15e4cf6 100644 --- a/rsa/pkcs1.py +++ b/rsa/pkcs1.py @@ -321,6 +321,8 @@ def verify(message, signature, pub_key): if message_hash != signature_hash: raise VerificationError('Verification failed') + return True + def _hash(message, method_name): '''Returns the message digest. |