mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-19 10:26:27 +00:00
fix id_dsa check error
This commit is contained in:
@@ -180,15 +180,14 @@ def timesince(dt, since='', default="just now"):
|
||||
|
||||
|
||||
def ssh_key_string_to_obj(text):
|
||||
key_f = StringIO(text)
|
||||
key = None
|
||||
try:
|
||||
key = paramiko.RSAKey.from_private_key(key_f)
|
||||
key = paramiko.RSAKey.from_private_key( StringIO(text) )
|
||||
except paramiko.SSHException:
|
||||
pass
|
||||
|
||||
try:
|
||||
key = paramiko.DSSKey.from_private_key(key_f)
|
||||
key = paramiko.DSSKey.from_private_key( StringIO(text) )
|
||||
except paramiko.SSHException:
|
||||
pass
|
||||
return key
|
||||
|
Reference in New Issue
Block a user