diff options
author | Robey Pointer <robey@lag.net> | 2004-03-16 07:33:09 +0000 |
---|---|---|
committer | Robey Pointer <robey@lag.net> | 2004-03-16 07:33:09 +0000 |
commit | f8a3a6213650fd8b8473d1301918ca343678ce22 (patch) | |
tree | 004c37cf82d25b2f9110b426cbc5e9082c3b6cda | |
parent | 0ae801447ede34b113663f09b5903c00b3644fb1 (diff) |
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-34]
fix some arcana in unpacking private keys
"!= type([])" is a pretty obscure way to say it. let's try "is not list"
which is a lot more readable.
(mostly this is a test to make sure tla is working okay on my laptop.)
-rw-r--r-- | paramiko/dsskey.py | 2 | ||||
-rw-r--r-- | paramiko/rsakey.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py index c067de06..ebff2b40 100644 --- a/paramiko/dsskey.py +++ b/paramiko/dsskey.py @@ -117,7 +117,7 @@ class DSSKey (PKey): keylist = BER(data).decode() except BERException: raise SSHException('Unable to parse key file') - if (type(keylist) != type([])) or (len(keylist) < 6) or (keylist[0] != 0): + if (type(keylist) is not list) or (len(keylist) < 6) or (keylist[0] != 0): raise SSHException('not a valid DSA private key file (bad ber encoding)') self.p = keylist[1] self.q = keylist[2] diff --git a/paramiko/rsakey.py b/paramiko/rsakey.py index 092a5610..dad8bc73 100644 --- a/paramiko/rsakey.py +++ b/paramiko/rsakey.py @@ -104,7 +104,7 @@ class RSAKey (PKey): keylist = BER(data).decode() except BERException: raise SSHException('Unable to parse key file') - if (type(keylist) != type([])) or (len(keylist) < 4) or (keylist[0] != 0): + if (type(keylist) is not list) or (len(keylist) < 4) or (keylist[0] != 0): raise SSHException('Not a valid RSA private key file (bad ber encoding)') self.n = keylist[1] self.e = keylist[2] |