summaryrefslogtreecommitdiff
path: root/paramiko/rsakey.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-03-18 20:58:48 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-03-18 20:58:48 -0400
commit339be6941e8e2b83cff1d3542acd13ec1f11c457 (patch)
treeb7cc329e89b6c5b38b45e1010f824152325b5c32 /paramiko/rsakey.py
parenta282ec1ee7c9d02108a73248fa51cc06fbb6e1ce (diff)
downloadparamiko-339be6941e8e2b83cff1d3542acd13ec1f11c457.tar.gz
Fixed tests.
The expected output keys for these tests needed to be rewritten because previously they were generated with a BER encoder, which is basically slopper. Now they're exported as DER, which means they're always as compact as possible. A comparison of the two strings with openssl asn1parse will show that they represent the same data, they the new value is just shorter
Diffstat (limited to 'paramiko/rsakey.py')
-rw-r--r--paramiko/rsakey.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py
index 01a1442a..1836b681 100644
--- a/paramiko/rsakey.py
+++ b/paramiko/rsakey.py
@@ -111,7 +111,11 @@ class RSAKey(PKey):
def verify_ssh_sig(self, data, msg):
if msg.get_text() != 'ssh-rsa':
return False
- verifier = self.key.verifier(
+ key = self.key
+ if isinstance(key, rsa.RSAPrivateKey):
+ key = key.public_key()
+
+ verifier = key.verifier(
signature=msg.get_binary(),
padding=padding.PKCS1v15(),
algorithm=hashes.SHA1(),