Pass None for empty password

This commit is contained in:
Sheng
2018-09-12 13:07:05 +08:00
parent 21d3f9bd7f
commit b372fcbbb2
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ class IndexHandler(MixinHandler, tornado.web.RequestHandler):
@classmethod
def get_pkey_obj(cls, privatekey, password, filename):
bpass = to_bytes(password)
bpass = to_bytes(password) if password else None
pkey = cls.get_specific_pkey(paramiko.RSAKey, privatekey, bpass)\
or cls.get_specific_pkey(paramiko.DSSKey, privatekey, bpass)\