mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-19 18:34:28 +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):
|
def ssh_key_string_to_obj(text):
|
||||||
key_f = StringIO(text)
|
|
||||||
key = None
|
key = None
|
||||||
try:
|
try:
|
||||||
key = paramiko.RSAKey.from_private_key(key_f)
|
key = paramiko.RSAKey.from_private_key( StringIO(text) )
|
||||||
except paramiko.SSHException:
|
except paramiko.SSHException:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
key = paramiko.DSSKey.from_private_key(key_f)
|
key = paramiko.DSSKey.from_private_key( StringIO(text) )
|
||||||
except paramiko.SSHException:
|
except paramiko.SSHException:
|
||||||
pass
|
pass
|
||||||
return key
|
return key
|
||||||
|
Reference in New Issue
Block a user