FreeRDP/FreeRDP — pull request #579 by awakecoding (2012-05-05 23:01:37+00:00)
Title: Terminal Server Gateway (Round 1)

Initial TS Gateway integration

* cleanup and rewrite of most of the original code contribution
* Implementation of an lightweight HTTP library
* Implementation of NTLM over HTTP authentication
* Implementation of RTS (Request To Send) packets
* Implementation of most of the TS Gateway connection sequence

* Move of libfreerdp-sspi to libwinpr-sspi
* Creation of new library called "libwinpr-rpc" for MSRPC

libwinpr-sspi and libwinpr-rpc are the first steps towards a new spin-off project called "WinPR: Windows Portable Runtime" which will aim at providing a portable implementation of important portions of the Windows API like SSPI and MSRPC.

The current code which deals with MSRPC for TS Gateway is making use of blobs and hardcoded offsets, and shall be replaced by the full MSRPC engine when completed. With certain deployments, the connection sequence will complete, but with others it won't. Something is wrong with the current flaky MSRPC implementation, feel free to attempt to "fix" it before I'm done with the MSRPC engine. On the long term, we definitely need a solid solution like libwinpr-rpc, which is why I'm working hard on this.

If you're lucky, you'll get past the connection sequence, but then something goes wrong with the send/recv buffer and it crashes after a few messages. If you can get to that point, you can help fixing that part, such that when I can get MSRPC working solidly we'll be done with TS Gateway support.

Command-line usage (will need to be improved on):

xfreerdp -u username -p password --tsg username password hostname hostname

the first username and password are for the target machine, the second username password and hostname are for the gateway. In my setup, it's the same password for both. Normally those should be separate, it's possible to use different credentials with the gateway than for the target server.