From 8e9fe0605c2c019ce261a89e087cfb5cd1cd654f Mon Sep 17 00:00:00 2001 From: desaster Date: Mon, 4 Feb 2013 11:44:42 +0000 Subject: [PATCH] Workaround so the premature key exchange workaround works on twisted >= 11 git-svn-id: https://kippo.googlecode.com/svn/trunk@233 951d7100-d841-11de-b865-b3884708a8e2 --- kippo/core/honeypot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kippo/core/honeypot.py b/kippo/core/honeypot.py index 1d9b026..35182fe 100644 --- a/kippo/core/honeypot.py +++ b/kippo/core/honeypot.py @@ -1,6 +1,7 @@ # Copyright (c) 2009 Upi Tamminen # See the COPYRIGHT file for more information +import twisted from twisted.cred import portal, checkers, credentials, error from twisted.conch import avatar, recvline, interfaces as conchinterfaces from twisted.conch.ssh import factory, userauth, connection, keys, session, common, transport @@ -519,7 +520,9 @@ class HoneyPotTransport(transport.SSHServerTransport): def dataReceived(self, data): transport.SSHServerTransport.dataReceived(self, data) - if not self.hadVersion and self.gotVersion: + # later versions seem to call sendKexInit again on their own + if twisted.version.major <= 11 and \ + not self.hadVersion and self.gotVersion: self.sendKexInit() self.hadVersion = True