summaryrefslogtreecommitdiff
path: root/paramiko/rsakey.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-04-14 10:56:05 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2014-04-14 10:56:05 -0400
commit191fd465f166588922ccbf08b65d4479d8520d6a (patch)
tree673a3ad36d919009d2621b6e1d3b102cf7988aa9 /paramiko/rsakey.py
parent6c6969c1882e62d6249264d2df46ff452eb53e7e (diff)
parentfa86d655dc8f08eb9171930c41b508e2bee08b08 (diff)
downloadparamiko-191fd465f166588922ccbf08b65d4479d8520d6a.tar.gz
Merge branch 'master' into use-urandom
Conflicts: paramiko/dsskey.py paramiko/ecdsakey.py paramiko/hostkeys.py paramiko/kex_gex.py paramiko/kex_group1.py paramiko/pkey.py paramiko/primes.py paramiko/rsakey.py tests/test_pkey.py
Diffstat (limited to 'paramiko/rsakey.py')
-rw-r--r--paramiko/rsakey.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py
index a6f97bff..d1f3ecfe 100644
--- a/paramiko/rsakey.py
+++ b/paramiko/rsakey.py
@@ -21,9 +21,9 @@ RSA keys.
"""
import os
+from hashlib import sha1
from Crypto.PublicKey import RSA
-from Crypto.Hash import SHA
from paramiko import util
from paramiko.common import max_byte, zero_byte, one_byte
@@ -93,7 +93,7 @@ class RSAKey (PKey):
return self.d is not None
def sign_ssh_data(self, data):
- digest = SHA.new(data).digest()
+ digest = sha1(data).digest()
rsa = RSA.construct((long(self.n), long(self.e), long(self.d)))
sig = util.deflate_long(rsa.sign(self._pkcs1imify(digest), bytes())[0], 0)
m = Message()
@@ -108,7 +108,7 @@ class RSAKey (PKey):
# verify the signature by SHA'ing the data and encrypting it using the
# public key. some wackiness ensues where we "pkcs1imify" the 20-byte
# hash into a string as long as the RSA key.
- hash_obj = util.inflate_long(self._pkcs1imify(SHA.new(data).digest()), True)
+ hash_obj = util.inflate_long(self._pkcs1imify(sha1(data).digest()), True)
rsa = RSA.construct((long(self.n), long(self.e)))
return rsa.verify(hash_obj, (sig,))