[dovecot-cvs] dovecot/src/auth mech-ntlm.c,1.7,1.8

cras at dovecot.org cras at dovecot.org
Fri Oct 22 16:34:09 EEST 2004


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv6661/auth

Modified Files:
	mech-ntlm.c 
Log Message:
support OEM encoding in NTLM messages. Patch by Andrey Panin.



Index: mech-ntlm.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/mech-ntlm.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- mech-ntlm.c	13 Oct 2004 16:38:32 -0000	1.7
+++ mech-ntlm.c	22 Oct 2004 13:34:06 -0000	1.8
@@ -26,6 +26,7 @@
 
 	/* requested: */
 	int ntlm2_negotiated;
+	int unicode_negotiated;
 	const unsigned char *challenge;
 
 	/* received: */
@@ -141,6 +142,7 @@
 			(struct ntlmssp_request *)data;
 		const struct ntlmssp_challenge *message;
 		size_t message_size;
+		uint32_t flags;
 
 		if (!ntlmssp_check_request(ntlm_request, data_size, &error)) {
 			if (verbose) {
@@ -154,8 +156,9 @@
 
 		message = ntlmssp_create_challenge(request->pool, ntlm_request,
 						   &message_size);
-		request->ntlm2_negotiated =
-			read_le32(&message->flags) & NTLMSSP_NEGOTIATE_NTLM2;
+		flags = read_le32(&message->flags);
+		request->ntlm2_negotiated = flags & NTLMSSP_NEGOTIATE_NTLM2;
+		request->unicode_negotiated = flags & NTLMSSP_NEGOTIATE_UNICODE;
 		request->challenge = message->challenge;
 
 		auth_request->callback(auth_request,
@@ -180,7 +183,8 @@
 		memcpy(request->response, response, data_size);
 
 		username = p_strdup(auth_request->pool,
-				    ntlmssp_t_str(request->response, user));
+				    ntlmssp_t_str(request->response, user, 
+				    request->unicode_negotiated));
 
 		if (!mech_fix_username(username, &error)) {
 			if (verbose) {



More information about the dovecot-cvs mailing list