fall back to old style implements support instead of @implementer

This commit is contained in:
Michel Oosterhof
2015-09-02 19:22:33 +00:00
parent 17340c50a7
commit 07eda9506d
3 changed files with 14 additions and 14 deletions

View File

@@ -7,7 +7,7 @@ from os import path
from sys import modules
from random import randint
from zope.interface import implementer
from zope.interface import implements
from twisted.cred.checkers import ICredentialsChecker
from twisted.cred.credentials import ISSHPrivateKey
@@ -240,8 +240,8 @@ class AuthRandom(object):
self.savevars()
return auth
@implementer(ICredentialsChecker)
class HoneypotPublicKeyChecker:
implements(ICredentialsChecker)
"""
Checker that accepts, logs and denies public key authentication attempts
"""
@@ -258,8 +258,8 @@ class HoneypotPublicKeyChecker:
fingerprint=_pubKey.fingerprint())
return failure.Failure(error.ConchError('Incorrect signature'))
@implementer(ICredentialsChecker)
class HoneypotNoneChecker:
implements(ICredentialsChecker)
"""
Checker that does no authentication check
"""
@@ -272,8 +272,8 @@ class HoneypotNoneChecker:
def requestAvatarId(self, credentials):
return defer.succeed(credentials.username)
@implementer(ICredentialsChecker)
class HoneypotPasswordChecker:
implements(ICredentialsChecker)
"""
Checker that accepts "keyboard-interactive" and "password"
"""

View File

@@ -26,7 +26,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
from zope.interface import implementer
from zope.interface import implements
from twisted.cred.credentials import IUsernamePassword, \
ICredentials
@@ -53,8 +53,8 @@ class IUsernamePasswordIP(IUsernamePassword):
@ivar ip: The source ip address associated with these credentials.
"""
@implementer(IUsername)
class Username:
implements(IUsername)
"""
"""
@@ -62,8 +62,8 @@ class Username:
self.username = username
# This credential interface also provides an IP address
@implementer(IUsernamePasswordIP)
class UsernamePasswordIP:
implements(IUsernamePasswordIP)
"""
"""

View File

@@ -6,7 +6,7 @@ import copy
import time
import uuid
from zope.interface import implementer
from zope.interface import implements
import twisted
from twisted.conch import avatar, interfaces as conchinterfaces
@@ -187,9 +187,9 @@ class HoneyPotSSHFactory(factory.SSHFactory):
t.factory = self
return t
@implementer(twisted.cred.portal.IRealm)
class HoneyPotRealm:
implements(twisted.cred.portal.IRealm)
def __init__(self, cfg):
self.cfg = cfg
self.env = honeypot.HoneyPotEnvironment(cfg)
@@ -358,9 +358,9 @@ class HoneyPotSSHSession(session.SSHSession):
def channelClosed(self):
log.msg("Called channelClosed in SSHSession")
# FIXME: recent twisted conch avatar.py uses IConchuser here
@implementer(conchinterfaces.ISession)
class HoneyPotAvatar(avatar.ConchUser):
# FIXME: recent twisted conch avatar.py uses IConchuser here
implements(conchinterfaces.ISession)
def __init__(self, username, env):
avatar.ConchUser.__init__(self)
@@ -465,8 +465,8 @@ def getDSAKeys(cfg):
privateKeyString = f.read()
return publicKeyString, privateKeyString
@implementer(conchinterfaces.ISFTPFile)
class CowrieSFTPFile:
implements(conchinterfaces.ISFTPFile)
def __init__(self, server, filename, flags, attrs):
self.server = server
@@ -546,8 +546,8 @@ class CowrieSFTPDirectory:
def close(self):
self.files = []
@implementer(conchinterfaces.ISFTPServer)
class CowrieSFTPServer:
implements(conchinterfaces.ISFTPServer)
def __init__(self, avatar):
self.avatar = avatar