summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryvesf <yvesf-git@xapek.org>2011-03-24 10:48:08 +0100
committeryvesf <yvesf-git@xapek.org>2011-03-24 10:48:08 +0100
commita91e8d650438278995e5adae30272cdcbb1f099f (patch)
tree6bd6b8fbed48748eb124c6da55ce80cd6a51c391
parent050f39cfa2dac8366391a5443037f400a6ea8624 (diff)
downloadoffssh-a91e8d650438278995e5adae30272cdcbb1f099f.tar.gz
offssh-a91e8d650438278995e5adae30272cdcbb1f099f.zip
set old debian-ssh version stringHEADmaster
-rw-r--r--offssh.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/offssh.py b/offssh.py
index 725affc..575524c 100644
--- a/offssh.py
+++ b/offssh.py
@@ -6,7 +6,7 @@
from twisted.cred import portal, checkers, credentials
from twisted.conch import error, avatar
from twisted.conch.checkers import SSHPublicKeyDatabase
-from twisted.conch.ssh import factory, userauth, connection, keys, session
+from twisted.conch.ssh import factory, userauth, connection, keys, session, transport
from twisted.internet import reactor, protocol, defer
from zope.interface import implements
import sys
@@ -113,7 +113,15 @@ class ExampleSession:
from twisted.python import components
components.registerAdapter(ExampleSession, ExampleAvatar, session.ISession)
+class ModifiedSSHTransport(transport.SSHServerTransport):
+ protocolVersion = '2.0'
+ version = 'OpenSSH_4.3p2'
+ comment = 'Debian-9etch2'
+ ourVersionString = ('SSH-' + protocolVersion + '-' + version + ' ' + comment).strip()
+
+
class ExampleFactory(factory.SSHFactory):
+ protocol = ModifiedSSHTransport
publicKeys = {
'ssh-rsa': keys.Key.fromString(data=publicKey)
}
@@ -124,7 +132,6 @@ class ExampleFactory(factory.SSHFactory):
'ssh-userauth': userauth.SSHUserAuthServer,
'ssh-connection': connection.SSHConnection
}
-
class PasswordDatabase:
implements(checkers.ICredentialsChecker)