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

pull/10399/head^2
Eric 2023-04-27 15:35:26 +08:00 committed by Jiangjie.Bai
parent 17e3ddda05
commit a0994e2e12
1 changed files with 2 additions and 0 deletions

View File

@ -173,6 +173,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")