mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-23 13:37:31 +00:00
fix: 修复旧 ssh 私钥,解析失败的问题
This commit is contained in:
parent
62e5389f80
commit
a0151b8d44
@ -175,6 +175,8 @@ def _parse_ssh_private_key(text, password=None):
|
|||||||
dsa.DSAPrivateKey,
|
dsa.DSAPrivateKey,
|
||||||
ed25519.Ed25519PrivateKey,
|
ed25519.Ed25519PrivateKey,
|
||||||
"""
|
"""
|
||||||
|
if not bool(password):
|
||||||
|
password = None
|
||||||
if isinstance(text, str):
|
if isinstance(text, str):
|
||||||
try:
|
try:
|
||||||
text = text.encode("utf-8")
|
text = text.encode("utf-8")
|
||||||
|
Loading…
Reference in New Issue
Block a user