From 1070ea8b6a7090e5c85a68bb4c1af323d5a392a8 Mon Sep 17 00:00:00 2001 From: speyrefitte Date: Thu, 24 Oct 2013 17:12:25 +0200 Subject: [PATCH] hard bug corrected --- rdpy/main.py | 4 ++-- rdpy/protocol/network/type.py | 18 +++++++++--------- rdpy/protocol/rdp/gcc.py | 4 ++-- rdpy/protocol/rdp/tpdu.py | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/rdpy/main.py b/rdpy/main.py index 66c86f1..98a443a 100644 --- a/rdpy/main.py +++ b/rdpy/main.py @@ -23,7 +23,7 @@ if __name__ == '__main__': #w.show() from twisted.internet import reactor #reactor.connectTCP("127.0.0.1", 5901, factory.RfbFactory(protocol)) - reactor.connectTCP("192.168.1.90", 3389, factory.RfbFactory(tpkt.TPKT(tpdu.TPDU(mcs.MCS())))) - #reactor.connectTCP("192.168.135.73", 3389, factory.RfbFactory(tpkt.TPKT(tpdu.TPDU(mcs.MCS())))) + #reactor.connectTCP("192.168.1.90", 3389, factory.RfbFactory(tpkt.TPKT(tpdu.TPDU(mcs.MCS())))) + reactor.connectTCP("192.168.135.73", 3389, factory.RfbFactory(tpkt.TPKT(tpdu.TPDU(mcs.MCS())))) reactor.run() #sys.exit(app.exec_()) \ No newline at end of file diff --git a/rdpy/protocol/network/type.py b/rdpy/protocol/network/type.py index aa5cd2f..4c59691 100644 --- a/rdpy/protocol/network/type.py +++ b/rdpy/protocol/network/type.py @@ -202,7 +202,7 @@ class CompositeType(Type): init list of simple value ''' #list of ordoned type - self._type = [] + self._typeName = [] def __setattr__(self, name, value): ''' @@ -210,8 +210,8 @@ class CompositeType(Type): @param name: name of new attribute @param value: value of new attribute ''' - if name[0] != '_' and (isinstance(value, Type) or isinstance(value, tuple)) and not self.__dict__.has_key(name): - self._type.append(value) + if name[0] != '_' and (isinstance(value, Type) or isinstance(value, tuple)) and not name in self._typeName: + self._typeName.append(name) self.__dict__[name] = value def read(self, s): @@ -219,16 +219,16 @@ class CompositeType(Type): call read on each ordered subtype @param s: Stream ''' - for i in self._type: - s.readType(i) + for name in self._typeName: + s.readType(self.__dict__[name]) def write(self, s): ''' call write on each ordered subtype @param s: Stream ''' - for i in self._type: - s.writeType(i) + for name in self._typeName: + s.writeType(self.__dict__[name]) def __sizeof__(self): ''' @@ -236,8 +236,8 @@ class CompositeType(Type): @return: sum of sizeof of each public type attributes ''' size = 0 - for i in self._type: - size += sizeof(i) + for name in self._typeName: + size += sizeof(self.__dict__[name]) return size class UInt8(SimpleType): diff --git a/rdpy/protocol/rdp/gcc.py b/rdpy/protocol/rdp/gcc.py index 156f841..48c87e5 100644 --- a/rdpy/protocol/rdp/gcc.py +++ b/rdpy/protocol/rdp/gcc.py @@ -160,7 +160,7 @@ class ClientSecuritySettings(CompositeType): ''' def __init__(self): CompositeType.__init__(self) - self.encryptionMethods = UInt32Le() + self.encryptionMethods = UInt32Le()#Encryption.ENCRYPTION_FLAG_128BIT | Encryption.ENCRYPTION_FLAG_40BIT | Encryption.ENCRYPTION_FLAG_56BIT | Encryption.FIPS_ENCRYPTION_FLAG self.extEncryptionMethods = UInt32Le() class Channel(object): @@ -212,7 +212,7 @@ def writeClientDataBlocks(settings): @param settings: ClientSettings ''' return (writeClientCoreData(settings.core), - writeClientNetworkData(settings.networkChannels), + #writeClientNetworkData(settings.networkChannels), writeClientSecurityData(settings.security)) def writeClientCoreData(core): diff --git a/rdpy/protocol/rdp/tpdu.py b/rdpy/protocol/rdp/tpdu.py index 1264b58..cae6673 100644 --- a/rdpy/protocol/rdp/tpdu.py +++ b/rdpy/protocol/rdp/tpdu.py @@ -169,9 +169,9 @@ class ClientTLSContext(ssl.ClientContextFactory): ''' client context factory for open ssl ''' - isClient = 1 def getContext(self): context = SSL.Context(SSL.TLSv1_METHOD) + context.set_options(0x00020000)#SSL_OP_NO_COMPRESSION context.set_options(SSL.OP_DONT_INSERT_EMPTY_FRAGMENTS) context.set_options(SSL.OP_TLS_BLOCK_PADDING_BUG) return context \ No newline at end of file