pidgin: 5ae78fe6: Fix NTLM endianness issue.

elb at pidgin.im elb at pidgin.im
Tue Aug 16 11:11:48 EDT 2011


----------------------------------------------------------------------
Revision: 5ae78fe684f17a019325c6cc5606fb8c8fbab433
Parent:   4fea18d18cfec3ca002a169a312c742a22ac9374
Author:   jond578 at gmail.com
Date:     08/16/11 11:06:48
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5ae78fe684f17a019325c6cc5606fb8c8fbab433

Changelog: 

Fix NTLM endianness issue.

Fixes #14163

Changes against parent 4fea18d18cfec3ca002a169a312c742a22ac9374

  patched  COPYRIGHT
  patched  libpurple/ntlm.c

-------------- next part --------------
============================================================
--- COPYRIGHT	9dbbb7af00c3cd95bb098dc967aebe4ddcab79ad
+++ COPYRIGHT	65f8e9208fb744ce39b128dc83cc169e0c0a62e7
@@ -197,6 +197,7 @@ Ian Goldberg
 Gustavo Gir?ldez
 Richard Gobeille
 Ian Goldberg
+Jon Goldberg
 Matthew Goldstein
 Michael Golden
 Charlie Gordon
============================================================
--- libpurple/ntlm.c	5e2ea0f873201d1fbfbdf92456e17a24c5e584ab
+++ libpurple/ntlm.c	e3fcb94174458c16757ebc45b1fc2cffd5103c84
@@ -111,14 +111,16 @@ purple_ntlm_gen_type1(const gchar *hostn
 gchar *
 purple_ntlm_gen_type1(const gchar *hostname, const gchar *domain)
 {
-	int hostnamelen;
-	int domainlen;
+	int hostnamelen,host_off;
+	int domainlen,dom_off;
 	unsigned char *msg;
 	struct type1_message *tmsg;
 	gchar *tmp;
 
 	hostnamelen = strlen(hostname);
 	domainlen = strlen(domain);
+	host_off = sizeof(struct type1_message);
+	dom_off = sizeof(struct type1_message) + hostnamelen;
 	msg = g_malloc0(sizeof(struct type1_message) + hostnamelen + domainlen);
 	tmsg = (struct type1_message*)msg;
 	tmsg->protocol[0] = 'N';
@@ -132,11 +134,11 @@ purple_ntlm_gen_type1(const gchar *hostn
 	tmsg->type      = GUINT32_TO_LE(0x00000001);
 	tmsg->flags     = GUINT32_TO_LE(0x0000b203);
 	tmsg->dom_len1  = tmsg->dom_len2 = GUINT16_TO_LE(domainlen);
-	tmsg->dom_off   = GUINT32_TO_LE(sizeof(struct type1_message) + hostnamelen);
+	tmsg->dom_off   = GUINT32_TO_LE(dom_off);
 	tmsg->host_len1 = tmsg->host_len2 = GUINT16_TO_LE(hostnamelen);
-	tmsg->host_off  = GUINT32_TO_LE(sizeof(struct type1_message));
-	memcpy(msg + tmsg->host_off, hostname, hostnamelen);
-	memcpy(msg + tmsg->dom_off, domain, domainlen);
+	tmsg->host_off  = GUINT32_TO_LE(host_off);
+	memcpy(msg + host_off, hostname, hostnamelen);
+	memcpy(msg + dom_off, domain, domainlen);
 
 	tmp = purple_base64_encode(msg, sizeof(struct type1_message) + hostnamelen + domainlen);
 	g_free(msg);


More information about the Commits mailing list