On Fri, Dec 2, 2016 at 9:18 AM, Craig Rodrigues <rodr...@crodrigues.org>
wrote:

>
> Traceback (most recent call last):
>
>
>   File "<pudb command line>", line 1, in <module>
>   File "/Users/crodrigues/twisted8/src/twisted/conch/ssh/keys.py", line
> 787, in __repr__
>     self._keyObject.key_size)]
>
> AttributeError: '_EllipticCurvePublicKey' object has no attribute
> 'key_size'
>
>
This seems to be the problem.

On this line:
https://github.com/twisted/twisted/blob/trunk/src/twisted/conch/ssh/keys.py#L782
the __repr__() function wants to call the key_size() method.

This seems to exist for DSA and RSA keys:
https://github.com/pyca/cryptography/blob/master/src/cryptography/hazmat/backends/openssl/dsa.py#L232
https://github.com/pyca/cryptography/blob/master/src/cryptography/hazmat/backends/openssl/rsa.py#L482

However for EC keys, I do not see a 'key_size' attribute:
https://github.com/pyca/cryptography/blob/master/src/cryptography/hazmat/backends/openssl/ec.py#L256

When trying to compare the known host key, the code tries to do a
__repr__() and it fails,
so this doesn't seem to work with EC keys.

--
Craig
_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to