fix: 修复旧 ssh 私钥,解析失败的问题

pull/10367/head
Eric 2023-04-27 15:35:26 +08:00 committed by Jiangjie.Bai
parent 62e5389f80
commit a0151b8d44
1 changed files with 2 additions and 0 deletions

View File

@ -175,6 +175,8 @@ def _parse_ssh_private_key(text, password=None):
dsa.DSAPrivateKey,
ed25519.Ed25519PrivateKey,
"""
if not bool(password):
password = None
if isinstance(text, str):
try:
text = text.encode("utf-8")