Build repair
This commit is contained in:
@@ -22,12 +22,10 @@
|
|||||||
@see: http://msdn.microsoft.com/en-us/library/cc241880.aspx
|
@see: http://msdn.microsoft.com/en-us/library/cc241880.aspx
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from rdpy.network.type import CompositeType, UInt8, UInt16Le, UInt32Le, String, sizeof, FactoryType, ArrayType,\
|
from rdpy.network.type import CompositeType, UInt8, UInt16Le, UInt32Le, String, sizeof, FactoryType, ArrayType, Stream
|
||||||
Stream
|
|
||||||
from rdpy.base.error import InvalidExpectedDataException
|
from rdpy.base.error import InvalidExpectedDataException
|
||||||
import rdpy.base.log as log
|
import rdpy.base.log as log
|
||||||
import rdpy.protocol.rdp.sec as sec
|
import sec, rc4
|
||||||
import rdpy.protocol.rdp.rc4 as rc4
|
|
||||||
|
|
||||||
class MessageType(object):
|
class MessageType(object):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -201,6 +201,10 @@ class Client(X224Layer):
|
|||||||
else:
|
else:
|
||||||
self._selectedProtocol = Protocols.PROTOCOL_RDP
|
self._selectedProtocol = Protocols.PROTOCOL_RDP
|
||||||
|
|
||||||
|
#NLA protocol doesn't support in actual version of RDPY
|
||||||
|
if self._selectedProtocol in [ Protocols.PROTOCOL_HYBRID, Protocols.PROTOCOL_HYBRID_EX ]:
|
||||||
|
raise InvalidExpectedDataException("RDPY doesn't support NLA security Layer")
|
||||||
|
|
||||||
if message.protocolNeg.failureCode._is_readed:
|
if message.protocolNeg.failureCode._is_readed:
|
||||||
log.info("negotiation failure code %x"%message.protocolNeg.failureCode.value)
|
log.info("negotiation failure code %x"%message.protocolNeg.failureCode.value)
|
||||||
|
|
||||||
|
|||||||
@@ -96,9 +96,6 @@ class X224Case(unittest.TestCase):
|
|||||||
|
|
||||||
if t.protocolNeg.code != x224.NegociationType.TYPE_RDP_NEG_REQ:
|
if t.protocolNeg.code != x224.NegociationType.TYPE_RDP_NEG_REQ:
|
||||||
raise X224Case.X224_FAIL()
|
raise X224Case.X224_FAIL()
|
||||||
|
|
||||||
if t.protocolNeg.selectedProtocol.value != x224.Protocols.PROTOCOL_SSL:
|
|
||||||
raise X224Case.X224_FAIL()
|
|
||||||
|
|
||||||
def nextAutomata(data):
|
def nextAutomata(data):
|
||||||
raise X224Case.X224_PASS()
|
raise X224Case.X224_PASS()
|
||||||
@@ -108,33 +105,7 @@ class X224Case(unittest.TestCase):
|
|||||||
layer.recvConnectionConfirm = nextAutomata
|
layer.recvConnectionConfirm = nextAutomata
|
||||||
layer.connect()
|
layer.connect()
|
||||||
|
|
||||||
self.assertRaises(X224Case.X224_PASS, layer.recv, type.String('\x01\x02'))
|
self.assertRaises(X224Case.X224_PASS, layer.recv, type.String('\x01\x02'))
|
||||||
|
|
||||||
def test_x224_client_recvConnectionConfirm_negotiation_old(self):
|
|
||||||
"""
|
|
||||||
@summary: unit test for X224Client.recvConnectionConfirm and sendConnectionRequest function
|
|
||||||
whithout protocol negotiation (doesn't support)
|
|
||||||
"""
|
|
||||||
message = x224.ServerConnectionConfirm()
|
|
||||||
del message._typeName[message._typeName.index("protocolNeg")]
|
|
||||||
s = type.Stream()
|
|
||||||
s.writeType(message)
|
|
||||||
s.pos = 0
|
|
||||||
layer = x224.Client(None)
|
|
||||||
self.assertRaises(error.InvalidExpectedDataException, layer.recvConnectionConfirm, s)
|
|
||||||
|
|
||||||
def test_x224_client_recvConnectionConfirm_negotiation_failure(self):
|
|
||||||
"""
|
|
||||||
@summary: unit test for X224Client.recvConnectionConfirm and sendConnectionRequest function
|
|
||||||
check negotiation failure
|
|
||||||
"""
|
|
||||||
message = x224.ServerConnectionConfirm()
|
|
||||||
message.protocolNeg.code.value = x224.NegociationType.TYPE_RDP_NEG_FAILURE
|
|
||||||
s = type.Stream()
|
|
||||||
s.writeType(message)
|
|
||||||
s.pos = 0
|
|
||||||
layer = x224.Client(None)
|
|
||||||
self.assertRaises(error.InvalidExpectedDataException, layer.recvConnectionConfirm, s)
|
|
||||||
|
|
||||||
def test_x224_client_recvConnectionConfirm_negotiation_bad_protocol(self):
|
def test_x224_client_recvConnectionConfirm_negotiation_bad_protocol(self):
|
||||||
"""
|
"""
|
||||||
@@ -142,7 +113,7 @@ class X224Case(unittest.TestCase):
|
|||||||
Server ask another protocol than SSL
|
Server ask another protocol than SSL
|
||||||
"""
|
"""
|
||||||
message = x224.ServerConnectionConfirm()
|
message = x224.ServerConnectionConfirm()
|
||||||
message.protocolNeg.selectedProtocol.value = x224.Protocols.PROTOCOL_RDP
|
message.protocolNeg.selectedProtocol.value = x224.Protocols.PROTOCOL_HYBRID
|
||||||
s = type.Stream()
|
s = type.Stream()
|
||||||
s.writeType(message)
|
s.writeType(message)
|
||||||
s.pos = 0
|
s.pos = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user