Repository navigation
Closed
Description
I get the following error when publickey auth with 384-bit ECDSA key to paramiko server. However, 256-bit ECDSA key works fine.
2017-02-22 02:34:24,877 [12915] INFO: Auth rejected (none).
2017-02-22 02:34:24,884 [12915] INFO: Auth rejected: unsupported or mangled public key
It seems Transport._key_info has only ecdsa-sha2-nistp256.
diff --git a/paramiko/transport.py b/paramiko/transport.py
index c4f0ca7c6..bfd22b637 100644
--- a/paramiko/transport.py
+++ b/paramiko/transport.py
@@ -207,8 +207,9 @@ class Transport (threading.Thread, ClosingContextManager):
_key_info = {
'ssh-rsa': RSAKey,
'ssh-dss': DSSKey,
- 'ecdsa-sha2-nistp256': ECDSAKey,
}
+ _key_info.update(map(lambda id_: (id_, ECDSAKey),
+ ECDSAKey.supported_key_format_identifiers()))
_kex_info = {
'diffie-hellman-group1-sha1': KexGroup1,After the patch, it works well.
And, it's difficult to investigate because an exception isn't logged when the error occurs. I consider the exception should be logged.
diff --git a/paramiko/auth_handler.py b/paramiko/auth_handler.py
index cab27a884..6486935ae 100644
--- a/paramiko/auth_handler.py
+++ b/paramiko/auth_handler.py
@@ -416,8 +416,9 @@ class AuthHandler (object):
except SSHException as e:
self.transport._log(INFO, 'Auth rejected: public key: %s' % str(e))
key = None
- except:
- self.transport._log(INFO, 'Auth rejected: unsupported or mangled public key')
+ except Exception as e:
+ self.transport._log(INFO, 'Auth rejected: unsupported or mangled public key (%s: %s)',
+ e.__class__.__name__, e)
key = None
if key is None:
self._disconnect_no_more_auth()After this, I investigated the issue by the following log.
2017-02-22 02:43:00,367 [12253] INFO: Auth rejected: unsupported or mangled public key (KeyError: u'ecdsa
-sha2-nistp384')
Metadata
Metadata
Assignees
Labels
No labels
Activity
ploxiln commentedon Feb 21, 2017
dup of #794 though with potentially better proposed fix
jun66j5 commentedon Feb 21, 2017
Oh, sorry. I've searched the same issue but missed it.
ploxiln commentedon Feb 22, 2017
I mean, I think the fixes proposed here are good stuff, no need to apologize :)
I've borrowed them in #899