secur32: Use NTLM2 instead of NTLMv2.
authorKai Blin <kai.blin@gmail.com>
Mon, 19 Apr 2010 08:15:15 +0000 (10:15 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 19 Apr 2010 12:56:12 +0000 (14:56 +0200)
In the current code NTLMv2 is used when talking about second generation
NTLM crypto algorithms. Most other publiations call this NTLM2, and use
NTLMv2 to describe a different crypto handshake that can be used by
either NTLM1 or NTLM2 crypto.

dlls/secur32/hmac_md5.c
dlls/secur32/ntlm.c
dlls/secur32/secur32_priv.h
dlls/secur32/util.c

index 6dafa312e4d43ae81f19773f70cf9f4728be758e..3479178132db570abcebc583f4b25ae4a3fb4707 100644 (file)
@@ -16,7 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  *
  * This file implements RFC 2104 (HMAC) for the MD5 provider.
- * It is needed for NTLMv2 signing and sealing.
+ * It is needed for NTLM2 signing and sealing.
  */
 
 #include "hmac_md5.h"
index a7330e221d9753f095213618854150e2aec31178..0ef5b5167884d264d815c5fb0d748e2a3a508a6c 100644 (file)
@@ -593,15 +593,15 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
             MultiByteToWideChar(CP_ACP, 0, password ? password : ntlm_cred->password,
                                 password ? pwlen : ntlm_cred->pwlen, unicode_password, passwd_lenW);
 
-            SECUR32_CreateNTLMv1SessionKey((PBYTE)unicode_password,
-                                           passwd_lenW * sizeof(SEC_WCHAR), helper->session_key);
+            SECUR32_CreateNTLM1SessionKey((PBYTE)unicode_password,
+                                          passwd_lenW * sizeof(SEC_WCHAR), helper->session_key);
 
             HeapFree(GetProcessHeap(), 0, unicode_password);
         }
         else
             memset(helper->session_key, 0, 16);
 
-        /* Allocate space for a maximal string of 
+        /* Allocate space for a maximal string of
          * "SF NTLMSSP_FEATURE_SIGN NTLMSSP_FEATURE_SEAL
          * NTLMSSP_FEATURE_SESSION_KEY"
          */
@@ -913,7 +913,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
         helper->crypt.ntlm.a4i = SECUR32_arc4Alloc();
         SECUR32_arc4Init(helper->crypt.ntlm.a4i, helper->session_key, 16);
         helper->crypt.ntlm.seq_num = 0l;
-        SECUR32_CreateNTLMv2SubKeys(helper);
+        SECUR32_CreateNTLM2SubKeys(helper);
         helper->crypt.ntlm2.send_a4i = SECUR32_arc4Alloc();
         helper->crypt.ntlm2.recv_a4i = SECUR32_arc4Alloc();
         SECUR32_arc4Init(helper->crypt.ntlm2.send_a4i,
@@ -1471,7 +1471,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_RevertSecurityContext(PCtxtHandle phContex
 /***********************************************************************
  *             ntlm_CreateSignature
  * As both MakeSignature and VerifySignature need this, but different keys
- * are needed for NTLMv2, the logic goes into a helper function.
+ * are needed for NTLM2, the logic goes into a helper function.
  * To ensure maximal reusability, we can specify the direction as NTLM_SEND for
  * signing/encrypting and NTLM_RECV for verfying/decrypting. When encrypting,
  * the signature is encrypted after the message was encrypted, so
index 7b4f3ffcb8a91267d1aa4a378ae014e12cfcac04..e2b0cd042a289c6f9d4cd05ba6dc5c1c543712c3 100644 (file)
@@ -138,7 +138,7 @@ void cleanup_helper(PNegoHelper helper);
 void check_version(PNegoHelper helper);
 
 /* Functions from base64_codec.c used elsewhere */
-SECURITY_STATUS encodeBase64(PBYTE in_buf, int in_len, char* out_buf, 
+SECURITY_STATUS encodeBase64(PBYTE in_buf, int in_len, char* out_buf,
         int max_len, int *out_len);
 
 SECURITY_STATUS decodeBase64(char *in_buf, int in_len, BYTE *out_buf,
@@ -146,8 +146,8 @@ SECURITY_STATUS decodeBase64(char *in_buf, int in_len, BYTE *out_buf,
 
 /* Functions from util.c */
 ULONG ComputeCrc32(const BYTE *pData, INT iLen, ULONG initial_crc);
-SECURITY_STATUS SECUR32_CreateNTLMv1SessionKey(PBYTE password, int len, PBYTE session_key);
-SECURITY_STATUS SECUR32_CreateNTLMv2SubKeys(PNegoHelper helper);
+SECURITY_STATUS SECUR32_CreateNTLM1SessionKey(PBYTE password, int len, PBYTE session_key);
+SECURITY_STATUS SECUR32_CreateNTLM2SubKeys(PNegoHelper helper);
 arc4_info *SECUR32_arc4Alloc(void);
 void SECUR32_arc4Init(arc4_info *a4i, const BYTE *key, unsigned int keyLen);
 void SECUR32_arc4Process(arc4_info *a4i, BYTE *inoutString, unsigned int length);
index a226bf5e87b99c12d9e41604b5f85c8f637d4359..ab52251281f83035a251b3f083bfbf53fcfda9df 100644 (file)
@@ -121,7 +121,7 @@ ULONG ComputeCrc32(const BYTE *pData, INT iLen, ULONG initial_crc)
   return ~crc;
 }
 
-SECURITY_STATUS SECUR32_CreateNTLMv1SessionKey(PBYTE password, int len, PBYTE session_key)
+SECURITY_STATUS SECUR32_CreateNTLM1SessionKey(PBYTE password, int len, PBYTE session_key)
 {
     MD4_CTX ctx;
     BYTE ntlm_hash[16];
@@ -143,7 +143,7 @@ SECURITY_STATUS SECUR32_CreateNTLMv1SessionKey(PBYTE password, int len, PBYTE se
     return SEC_E_OK;
 }
 
-static void SECUR32_CalcNTLMv2Subkey(const BYTE *session_key, const char *magic, PBYTE subkey)
+static void SECUR32_CalcNTLM2Subkey(const BYTE *session_key, const char *magic, PBYTE subkey)
 {
     MD5_CTX ctx;
 
@@ -155,7 +155,7 @@ static void SECUR32_CalcNTLMv2Subkey(const BYTE *session_key, const char *magic,
 }
 
 /* This assumes we do have a valid NTLM2 user session key */
-SECURITY_STATUS SECUR32_CreateNTLMv2SubKeys(PNegoHelper helper)
+SECURITY_STATUS SECUR32_CreateNTLM2SubKeys(PNegoHelper helper)
 {
     helper->crypt.ntlm2.send_sign_key = HeapAlloc(GetProcessHeap(), 0, 16);
     helper->crypt.ntlm2.send_seal_key = HeapAlloc(GetProcessHeap(), 0, 16);
@@ -164,24 +164,24 @@ SECURITY_STATUS SECUR32_CreateNTLMv2SubKeys(PNegoHelper helper)
 
     if(helper->mode == NTLM_CLIENT)
     {
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, client_to_server_sign_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, client_to_server_sign_constant,
                 helper->crypt.ntlm2.send_sign_key);
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, client_to_server_seal_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, client_to_server_seal_constant,
                 helper->crypt.ntlm2.send_seal_key);
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, server_to_client_sign_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, server_to_client_sign_constant,
                 helper->crypt.ntlm2.recv_sign_key);
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, server_to_client_seal_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, server_to_client_seal_constant,
                 helper->crypt.ntlm2.recv_seal_key);
     }
     else
     {
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, server_to_client_sign_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, server_to_client_sign_constant,
                 helper->crypt.ntlm2.send_sign_key);
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, server_to_client_seal_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, server_to_client_seal_constant,
                 helper->crypt.ntlm2.send_seal_key);
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, client_to_server_sign_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, client_to_server_sign_constant,
                 helper->crypt.ntlm2.recv_sign_key);
-        SECUR32_CalcNTLMv2Subkey(helper->session_key, client_to_server_seal_constant,
+        SECUR32_CalcNTLM2Subkey(helper->session_key, client_to_server_seal_constant,
                 helper->crypt.ntlm2.recv_seal_key);
     }