[Twisted-Python] Modifying Conch example

Jack Whitham jack-tp at cs.york.ac.uk
Fri Aug 1 08:18:18 EDT 2008

On Thu, Jul 31, 2008 at 11:19:53AM -0400, Paul Swartz wrote:
> On Wed, Jul 23, 2008 at 6:00 AM, Jack Whitham <jack-tp at cs.york.ac.uk> wrote:
> > On Wed, Jul 23, 2008 at 01:39:19AM -0700, Pump Kin wrote:
> >> Step 1) Is really bugging me here; I can't seem to strip the need for
> >> foreknowledge of the public key from the script. I can't easily
> >> programmatically access that information in my use case. I do however have
> >> ready access to the private key and fingerprint for verification. My
> >> modified tutorial scripts just vomit.
> >
> > I had the same problem. Some new key management features have been
> > added to Conch recently, so you now only need the private key:
> >
> > class ClientUserAuth(userauth.SSHUserAuthClient):
> >    def getPrivateKey(self):
> >        return defer.succeed(self.__getKey().keyObject)
> >
> > (Although I still get a deprecation warning about signData if
> > I do this..)
> You're getting the deprecation warning because you're not calling back
> the Deferred with a Key object; you're calling it back with a PyCrypto
> key object (that's what .keyObject is)

Thanks, but this does not fix it. The deprecation warning is:

/usr/lib/python2.5/site-packages/twisted/conch/ssh/userauth.py:376: DeprecationWarning: signData is deprecated since Twisted Conch 0.9.  Use Key(obj).sign(data).
  return keys.signData(privateKey, signData)

I still get this warning even if I change my code to remove ".keyObject"
but authentication no longer works if I do that. It looks like this is
actually a bug in my copy of userauth.py (although it is not a serious
problem - just a deprecation warning). I could get around the
problem by reimplementing the signData method in SSHUserAuthClient.
I am using version 8.1.0 as distributed by Debian, i.e.

Jack Whitham
jack at cs.york.ac.uk

More information about the Twisted-Python mailing list