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
This commit is contained in:
desaster 2013-02-04 11:44:42 +00:00
parent 3912ffb603
commit 8e9fe0605c
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# Copyright (c) 2009 Upi Tamminen <desaster@gmail.com> # Copyright (c) 2009 Upi Tamminen <desaster@gmail.com>
# See the COPYRIGHT file for more information # See the COPYRIGHT file for more information
import twisted
from twisted.cred import portal, checkers, credentials, error from twisted.cred import portal, checkers, credentials, error
from twisted.conch import avatar, recvline, interfaces as conchinterfaces from twisted.conch import avatar, recvline, interfaces as conchinterfaces
from twisted.conch.ssh import factory, userauth, connection, keys, session, common, transport from twisted.conch.ssh import factory, userauth, connection, keys, session, common, transport
@ -519,7 +520,9 @@ class HoneyPotTransport(transport.SSHServerTransport):
def dataReceived(self, data): def dataReceived(self, data):
transport.SSHServerTransport.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.sendKexInit()
self.hadVersion = True self.hadVersion = True