Permalink
Browse files

Seems to run under Pycrypto 2.5 (from PYPI )

  • Loading branch information...
1 parent 83bfc7e commit 445bcc0a814e07c31f67efc1baca9fc7dc79d528 @hdknr hdknr committed Jan 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 jws/algos.py
View
@@ -76,7 +76,7 @@ def sign(self, msg, key):
hashm.update(msg)
## assume we are dealing with a real key
# private_key = RSA.importKey(key)
- return PKCS.sign(hashm, key)
+ return PKCS.new(key).sign(hashm) # pycrypto 2.5
def verify(self, msg, crypto, key):
"""
@@ -94,7 +94,7 @@ def verify(self, msg, crypto, key):
private_key = key
if not isinstance(key, RSA._RSAobj):
private_key = RSA.importKey(key)
- if not PKCS.verify(hashm, private_key, crypto):
+ if not PKCS.new( private_key ).verify(hashm, crypto): #:pycrypto 2.5
raise SignatureError("Could not validate signature")
return True

0 comments on commit 445bcc0

Please sign in to comment.