From: Peter Å. <as...@ce...> - 2011-09-22 12:25:26
|
This looks very good, thanks for your work on this! We will try this patch and assuming there are no problems we will commit it. Best regards, Peter On Tue, 20 Sep 2011, Thomas Uhle wrote: > Hi Peter, > > I have done some more investigations on RDP licensing and believe that > I understand now how it works. Indeed, the terminal server replies with > a license error message with the error code STATUS_VALID_CLIENT after > checking the presented CAL when rdesktop is running the second and third > time. This behaviour corresponds to case 1 in [MS-RDPELE] section 3.2.5.3 > "Processing Client License Information" at http://msdn.microsoft.com/en-us/library/cc241955%28v=prot.10%29.aspx , > ending the licensing protocol. Yet I wanted to know whether rdesktop > behaves correctly, so I inserted some additional debug messages to > licence.c (patch is attached to this e-mail) and realised that the > licensing protocol is complete only the first time that rdesktop is > called. The second time, a disconnect PDU is received right after the > licensing PDU with the CAL was sent. I recognised that licence_process() > in licence.c has no implementation for the cases LICENCE_TAG_RESULT (that > is if the PDU contains a license error message) and LICENCE_TAG_REISSUE > (that is if the PDU contains an upgraded permanent license). But that was > not really a problem this time. Then I checked the License Information > packet built in licence_present() according to [MS-RDPELE] section 2.2.2.3 > "Client License Information" at http://msdn.microsoft.com/en-us/library/cc241919%28v=prot.10%29.aspx , > which has been almost correct except for the calculation of the packet > length (which really was a hard job to find out) and the type id for the > BLOB with the encrypted master secret. After applying these fixes, > rdesktop again works like a charm (no more "work-arounds" needed). I have > prepared a unidiff file providing all these patches, which is attached to > this e-mail. Please feel free to commit these changes to the rdesktop > repository for being able to close the pending bug #2817779. > Apart from that, I am not sure whether it makes sense to implement the > missing function for the case LICENCE_TAG_RESULT in licence_process(). > The information needed to parse a license error message packet can be > found at http://msdn.microsoft.com/en-us/library/cc240482%28v=prot.10%29.aspx . > > Best regards, > > > Thomas Uhle --- Peter Åstrand ThinLinc Chief Developer Cendio AB http://www.cendio.com Wallenbergs gata 4 583 30 Linköping Phone: +46-13-21 46 00 |