bug fixing
This commit is contained in:
@@ -11,7 +11,7 @@ from rdpy.protocol.rdp import rdp
|
|||||||
|
|
||||||
class TestServerFactory(rdp.ServerFactory):
|
class TestServerFactory(rdp.ServerFactory):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
rdp.ServerFactory.__init__(self, "/tmp/private.pem", "/tmp/certificate.pem")
|
rdp.ServerFactory.__init__(self, "/home/sylvain/dev/certificate/rdpy.key", "/home/sylvain/dev/certificate/rdpy.crt")
|
||||||
def startedConnecting(self, connector):
|
def startedConnecting(self, connector):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -814,6 +814,12 @@ class PDUClientListener(object):
|
|||||||
"""
|
"""
|
||||||
raise CallPureVirtualFuntion("%s:%s defined by interface %s"%(self.__class__, "onUpdate", "PDUClientListener"))
|
raise CallPureVirtualFuntion("%s:%s defined by interface %s"%(self.__class__, "onUpdate", "PDUClientListener"))
|
||||||
|
|
||||||
|
class PDUServerListener(object):
|
||||||
|
"""
|
||||||
|
Interface for PDU server automata listener
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
class PDU(LayerAutomata):
|
class PDU(LayerAutomata):
|
||||||
"""
|
"""
|
||||||
Global channel for mcs that handle session
|
Global channel for mcs that handle session
|
||||||
@@ -828,8 +834,10 @@ class PDU(LayerAutomata):
|
|||||||
mode = LayerMode.CLIENT
|
mode = LayerMode.CLIENT
|
||||||
#set client listener
|
#set client listener
|
||||||
self._clientListener = listener
|
self._clientListener = listener
|
||||||
|
elif isinstance(listener, PDUServerListener):
|
||||||
|
mode = LayerMode.SERVER
|
||||||
else:
|
else:
|
||||||
raise InvalidType("PDU Layer expect PDUClientListener as listener")
|
raise InvalidType("PDU Layer expect PDU(Client|Server)Listener as listener")
|
||||||
|
|
||||||
LayerAutomata.__init__(self, mode, None)
|
LayerAutomata.__init__(self, mode, None)
|
||||||
#logon info send from client to server
|
#logon info send from client to server
|
||||||
|
|||||||
@@ -10,9 +10,8 @@ class RDPController(pdu.PDUClientListener):
|
|||||||
"""
|
"""
|
||||||
use to decode and dispatch to observer PDU messages and orders
|
use to decode and dispatch to observer PDU messages and orders
|
||||||
"""
|
"""
|
||||||
def __init__(self, mode):
|
def __init__(self):
|
||||||
"""
|
"""
|
||||||
@param mode: mode of generate layer by listener
|
|
||||||
@param observer: observer
|
@param observer: observer
|
||||||
"""
|
"""
|
||||||
#list of observer
|
#list of observer
|
||||||
@@ -141,7 +140,7 @@ class ClientFactory(protocol.Factory):
|
|||||||
Function call from twisted and build rdp protocol stack
|
Function call from twisted and build rdp protocol stack
|
||||||
@param addr: destination address
|
@param addr: destination address
|
||||||
'''
|
'''
|
||||||
controller = RDPController(LayerMode.CLIENT)
|
controller = RDPController()
|
||||||
self.buildObserver(controller)
|
self.buildObserver(controller)
|
||||||
mcsLayer = mcs.createClient(controller)
|
mcsLayer = mcs.createClient(controller)
|
||||||
|
|
||||||
@@ -174,8 +173,7 @@ class ServerFactory(protocol.Factory):
|
|||||||
Function call from twisted and build rdp protocol stack
|
Function call from twisted and build rdp protocol stack
|
||||||
@param addr: destination address
|
@param addr: destination address
|
||||||
"""
|
"""
|
||||||
pduLayer = pdu.PDU(LayerMode.SERVER)
|
pduLayer = pdu.PDU(pdu.PDUServerListener())
|
||||||
#pduLayer.getController().addObserver(self.buildObserver())
|
|
||||||
return tpkt.TPKT(tpdu.createServer(mcs.createServer(pduLayer), self._privateKeyFileName, self._certificateFileName));
|
return tpkt.TPKT(tpdu.createServer(mcs.createServer(pduLayer), self._privateKeyFileName, self._certificateFileName));
|
||||||
|
|
||||||
def buildObserver(self):
|
def buildObserver(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user