hard bug corrected
This commit is contained in:
@@ -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_())
|
||||
@@ -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):
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user