hard bug corrected

This commit is contained in:
speyrefitte
2013-10-24 17:12:25 +02:00
parent d73cb63777
commit 1070ea8b6a
4 changed files with 14 additions and 14 deletions

View File

@@ -23,7 +23,7 @@ if __name__ == '__main__':
#w.show() #w.show()
from twisted.internet import reactor from twisted.internet import reactor
#reactor.connectTCP("127.0.0.1", 5901, factory.RfbFactory(protocol)) #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.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.135.73", 3389, factory.RfbFactory(tpkt.TPKT(tpdu.TPDU(mcs.MCS()))))
reactor.run() reactor.run()
#sys.exit(app.exec_()) #sys.exit(app.exec_())

View File

@@ -202,7 +202,7 @@ class CompositeType(Type):
init list of simple value init list of simple value
''' '''
#list of ordoned type #list of ordoned type
self._type = [] self._typeName = []
def __setattr__(self, name, value): def __setattr__(self, name, value):
''' '''
@@ -210,8 +210,8 @@ class CompositeType(Type):
@param name: name of new attribute @param name: name of new attribute
@param value: value 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): if name[0] != '_' and (isinstance(value, Type) or isinstance(value, tuple)) and not name in self._typeName:
self._type.append(value) self._typeName.append(name)
self.__dict__[name] = value self.__dict__[name] = value
def read(self, s): def read(self, s):
@@ -219,16 +219,16 @@ class CompositeType(Type):
call read on each ordered subtype call read on each ordered subtype
@param s: Stream @param s: Stream
''' '''
for i in self._type: for name in self._typeName:
s.readType(i) s.readType(self.__dict__[name])
def write(self, s): def write(self, s):
''' '''
call write on each ordered subtype call write on each ordered subtype
@param s: Stream @param s: Stream
''' '''
for i in self._type: for name in self._typeName:
s.writeType(i) s.writeType(self.__dict__[name])
def __sizeof__(self): def __sizeof__(self):
''' '''
@@ -236,8 +236,8 @@ class CompositeType(Type):
@return: sum of sizeof of each public type attributes @return: sum of sizeof of each public type attributes
''' '''
size = 0 size = 0
for i in self._type: for name in self._typeName:
size += sizeof(i) size += sizeof(self.__dict__[name])
return size return size
class UInt8(SimpleType): class UInt8(SimpleType):

View File

@@ -160,7 +160,7 @@ class ClientSecuritySettings(CompositeType):
''' '''
def __init__(self): def __init__(self):
CompositeType.__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() self.extEncryptionMethods = UInt32Le()
class Channel(object): class Channel(object):
@@ -212,7 +212,7 @@ def writeClientDataBlocks(settings):
@param settings: ClientSettings @param settings: ClientSettings
''' '''
return (writeClientCoreData(settings.core), return (writeClientCoreData(settings.core),
writeClientNetworkData(settings.networkChannels), #writeClientNetworkData(settings.networkChannels),
writeClientSecurityData(settings.security)) writeClientSecurityData(settings.security))
def writeClientCoreData(core): def writeClientCoreData(core):

View File

@@ -169,9 +169,9 @@ class ClientTLSContext(ssl.ClientContextFactory):
''' '''
client context factory for open ssl client context factory for open ssl
''' '''
isClient = 1
def getContext(self): def getContext(self):
context = SSL.Context(SSL.TLSv1_METHOD) 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_DONT_INSERT_EMPTY_FRAGMENTS)
context.set_options(SSL.OP_TLS_BLOCK_PADDING_BUG) context.set_options(SSL.OP_TLS_BLOCK_PADDING_BUG)
return context return context