diff --git a/tests/test_handler.py b/tests/test_handler.py index f136863..fce5187 100644 --- 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 index a35eee1..55abd55 100644 --- 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)