shithub: rd

Download patch

ref: 8b659ea4c3bb1eea2caad4865b77bf821353a087
parent: 2ad36efabe53bf7146756b7c97fa97fdb96a0731
author: Yaroslav Kolomiiets <[email protected]>
date: Fri Aug 19 10:51:46 EDT 2016

msg: shorten Connect-Initial

--- a/msg.c
+++ b/msg.c
@@ -108,7 +108,7 @@
 	switch(m->type){
 	case Xconnect:
 		/* 5.4.2.1 Negotiation-Based Approach */
-		nld = 25+8;
+		nld = 20+8;
 		n = mktpcr(b, nb, nld);
 		if(n < 0)
 			return -1;
@@ -115,9 +115,9 @@
 		p = b+n-nld;
 		ep = b+n;
 	
-		memcpy(p, "Cookie: mstshash=eltons\r\n", 25);
+		memcpy(p, "Cookie: mstshash=x\r\n", 20);
 		neg = (Rdpnego){Tnego, 0, m->negproto};
-		if(putnego(p+25, ep-p, &neg) != 8){
+		if(putnego(p+20, ep-p, &neg) != 8){
 			werrstr("pnego failed: %r");
 			return -1;
 		}