commit 8d0567329fc7e1dee18afb7617a5ba6a4a5ca454
parent d496b4ff87c91445cad52f7e858c089a15d32b16
Author: Shengdun Hua <webmaster0115@gmail.com>
Date: Sat, 7 Sep 2019 07:33:58 +0800
Merge pull request #83 from MineRobber9000/patch-1
Need a passphrase to decrypt, not password
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tests/test_handler.py b/tests/test_handler.py
@@ -152,12 +152,12 @@ class TestPrivateKey(unittest.TestCase):
pk = self.get_pk_obj(fname, password='')
with self.assertRaises(InvalidValueError) as ctx:
pk.get_pkey_obj()
- self.assertIn('Need a password', str(ctx.exception))
+ self.assertIn('Need a passphrase', str(ctx.exception))
pk = self.get_pk_obj(fname, password='wrongpass')
with self.assertRaises(InvalidValueError) as ctx:
pk.get_pkey_obj()
- self.assertIn('wrong password', str(ctx.exception))
+ self.assertIn('wrong passphrase', str(ctx.exception))
pk = self.get_pk_obj(fname, password=password)
self.assertIsInstance(pk.get_pkey_obj(), klass)
diff --git a/webssh/handler.py b/webssh/handler.py
@@ -153,12 +153,12 @@ class PrivateKey(object):
try:
return pkeycls.from_private_key(self.iostr, password=password)
except paramiko.PasswordRequiredException:
- raise InvalidValueError('Need a password to decrypt the key.')
+ raise InvalidValueError('Need a passphrase to decrypt the key.')
except paramiko.SSHException as exc:
logging.error(str(exc))
msg = 'Invalid key'
if self.password:
- msg += ' or wrong password "{}" for decrypting it.'.format(
+ msg += ' or wrong passphrase "{}" for decrypting it.'.format(
self.password)
raise InvalidValueError(msg)