Patch NTLMv2 hash, samba-3.0.2a

Jianliang Lu j.lu at tiesse.com
Thu Mar 18 11:16:11 GMT 2004


When we logon from a Windows XP to Samba use "net use 
\\server\... /u:domain\user password", or when we do joindomain from a XP to 
a Samba domain called "DOMAIN", if we edit the domain name in 
lowercase "domain" instead of the uppercase "DOMAIN" we will get a "WRONG 
PASSWORD" error. This because Samba generate the NTLMv2 hash use the "Unicode 
uppercase username concatenated with the Unicode uppercase authentication 
target (domain or server name)", this is wrong. We should applied the HMAC-
MD5 algorithm to "Unicode uppercase username concatenated with the Unicode 
authentication target". The authentication target (domain or server name) is 
that in message type 3 on the wire without transform it in uppercase!

The patch was tested in a XP-SAMBA environment.

Jianliang Lu
------------------------------------------

Patch: 

--- libsmb/smbencrypt.c.orig    Tue Mar 16 18:32:40 2004
+++ libsmb/smbencrypt.c Thu Mar 18 11:34:23 2004
@@ -141,7 +141,6 @@
    }

    strupper_w(user);
-   strupper_w(domain);

    SMB_ASSERT(user_byte_len >= 2);
    SMB_ASSERT(domain_byte_len >= 2);

----------------------------------------------------
Jianliang Lu
TieSse s.p.a.     Ivrea (To) - Italy
j.lu at tiesse.com   luj at libero.it
http://www.tiesse.com


More information about the samba-technical mailing list