[dovecot-cvs] dovecot/src/lib-ntlm ntlm-encrypt.c, 1.5, 1.6 ntlm-encrypt.h, 1.2, 1.3 ntlm-message.c, 1.3, 1.4

cras at dovecot.org cras at dovecot.org
Tue Oct 5 23:01:08 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-ntlm
In directory talvi:/tmp/cvs-serv5822/src/lib-ntlm

Modified Files:
	ntlm-encrypt.c ntlm-encrypt.h ntlm-message.c 
Log Message:
NTLM2 authentication support. Patch by Andrey Panin



Index: ntlm-encrypt.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-ntlm/ntlm-encrypt.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ntlm-encrypt.c	22 Sep 2004 19:53:18 -0000	1.5
+++ ntlm-encrypt.c	5 Oct 2004 20:01:05 -0000	1.6
@@ -4,7 +4,7 @@
  * Copyright (c) 2004 Andrey Panin <pazke at donpac.ru>
  *
  * This library is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published 
+ * it under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  */
@@ -110,6 +110,23 @@
 }
 
 void
+ntlmssp2_response(const unsigned char *hash,
+		  const unsigned char *server_challenge,
+		  const unsigned char *client_challenge,
+		  unsigned char response[NTLMSSP_RESPONSE_SIZE])
+{
+	struct md5_context ctx;
+	unsigned char session_hash[16];
+
+	md5_init(&ctx);
+	md5_update(&ctx, server_challenge, NTLMSSP_CHALLENGE_SIZE);
+	md5_update(&ctx, client_challenge, NTLMSSP_CHALLENGE_SIZE);
+	md5_final(&ctx, session_hash);
+
+	ntlmssp_v1_response(hash, session_hash, response);
+}
+
+void
 ntlmssp_v2_response(const char *user, const char *target,
 		    const unsigned char *hash_v1,
 		    const unsigned char *challenge,

Index: ntlm-encrypt.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-ntlm/ntlm-encrypt.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ntlm-encrypt.h	30 Jul 2004 01:43:21 -0000	1.2
+++ ntlm-encrypt.h	5 Oct 2004 20:01:05 -0000	1.3
@@ -11,6 +11,11 @@
 			 const unsigned char *challenge,
 			 unsigned char response[NTLMSSP_RESPONSE_SIZE]);
 
+void ntlmssp2_response( const unsigned char *hash,
+			const unsigned char *server_challenge,
+			const unsigned char *client_challenge,
+			unsigned char response[NTLMSSP_RESPONSE_SIZE]);
+
 void ntlmssp_v2_response(const char *user, const char *target,
 			 const unsigned char *hash_v1,
 			 const unsigned char *challenge,

Index: ntlm-message.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-ntlm/ntlm-message.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ntlm-message.c	30 Jul 2004 07:52:14 -0000	1.3
+++ ntlm-message.c	5 Oct 2004 20:01:05 -0000	1.4
@@ -119,6 +119,9 @@
 			 NTLMSSP_NEGOTIATE_NTLM |
 			 NTLMSSP_NEGOTIATE_TARGET_INFO;
 
+	if (client_flags & NTLMSSP_NEGOTIATE_NTLM2)
+		flags |= NTLMSSP_NEGOTIATE_NTLM2;
+
 	if (client_flags & NTLMSSP_REQUEST_TARGET)
 		flags |= NTLMSSP_REQUEST_TARGET | NTLMSSP_TARGET_TYPE_SERVER;
 



More information about the dovecot-cvs mailing list