From 1d5b15a310e12fc38c0a54f627599dbf16d98fc5 Mon Sep 17 00:00:00 2001 From: speyrefitte Date: Fri, 6 Feb 2015 14:35:41 +0100 Subject: [PATCH] fix minor bug to work with rdesktop but finally there is a bug in rdesktop --- rdpy/core/type.py | 2 +- rdpy/protocol/rdp/gcc.py | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rdpy/core/type.py b/rdpy/core/type.py index deff9e1..804ca5d 100644 --- a/rdpy/core/type.py +++ b/rdpy/core/type.py @@ -811,7 +811,7 @@ class String(Type, CallableValue): self.value = s.getvalue()[s.pos:] else: self.value = "" - while self.value[-len(self._until):] != self._until or s.dataLen() == 0: + while self.value[-len(self._until):] != self._until and s.dataLen() != 0: self.value += s.read(1) else: self.value = s.read(self._readLen.value) diff --git a/rdpy/protocol/rdp/gcc.py b/rdpy/protocol/rdp/gcc.py index 942c41b..9b5a5bc 100644 --- a/rdpy/protocol/rdp/gcc.py +++ b/rdpy/protocol/rdp/gcc.py @@ -256,17 +256,17 @@ class ClientCoreData(CompositeType): self.keyboardType = UInt32Le(KeyboardType.IBM_101_102_KEYS) self.keyboardSubType = UInt32Le(0) self.keyboardFnKeys = UInt32Le(12) - self.imeFileName = String("\x00"*64, readLen = UInt8(64)) - self.postBeta2ColorDepth = UInt16Le(ColorDepth.RNS_UD_COLOR_8BPP) - self.clientProductId = UInt16Le(1) - self.serialNumber = UInt32Le(0) - self.highColorDepth = UInt16Le(HighColor.HIGH_COLOR_24BPP) - self.supportedColorDepths = UInt16Le(Support.RNS_UD_15BPP_SUPPORT | Support.RNS_UD_16BPP_SUPPORT | Support.RNS_UD_24BPP_SUPPORT | Support.RNS_UD_32BPP_SUPPORT) - self.earlyCapabilityFlags = UInt16Le(CapabilityFlags.RNS_UD_CS_SUPPORT_ERRINFO_PDU) - self.clientDigProductId = String("\x00"*64, readLen = UInt8(64)) - self.connectionType = UInt8() - self.pad1octet = UInt8() - self.serverSelectedProtocol = UInt32Le() + self.imeFileName = String("\x00"*64, readLen = UInt8(64), optional = True) + self.postBeta2ColorDepth = UInt16Le(ColorDepth.RNS_UD_COLOR_8BPP, optional = True) + self.clientProductId = UInt16Le(1, optional = True) + self.serialNumber = UInt32Le(0, optional = True) + self.highColorDepth = UInt16Le(HighColor.HIGH_COLOR_24BPP, optional = True) + self.supportedColorDepths = UInt16Le(Support.RNS_UD_15BPP_SUPPORT | Support.RNS_UD_16BPP_SUPPORT | Support.RNS_UD_24BPP_SUPPORT | Support.RNS_UD_32BPP_SUPPORT, optional = True) + self.earlyCapabilityFlags = UInt16Le(CapabilityFlags.RNS_UD_CS_SUPPORT_ERRINFO_PDU, optional = True) + self.clientDigProductId = String("\x00"*64, readLen = UInt8(64), optional = True) + self.connectionType = UInt8(optional = True) + self.pad1octet = UInt8(optional = True) + self.serverSelectedProtocol = UInt32Le(optional = True) class ServerCoreData(CompositeType): """