diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py index c067de0..ebff2b4 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 092a561..dad8bc7 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]