svn commit: samba r2142 - in trunk/source/libsmb: .

abartlet at samba.org abartlet at samba.org
Tue Aug 31 20:23:56 GMT 2004


Author: abartlet
Date: 2004-08-31 20:23:56 +0000 (Tue, 31 Aug 2004)
New Revision: 2142

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source/libsmb&rev=2142&nolog=1

Log:
Merge 'long password' change from Samba 3.0 -> trunk.

Allow SMBEncrypt to return false if the password is longer than 14 dos
characters (and is therefore invalid for LM hashing).

Andrew Bartlett

Modified:
   trunk/source/libsmb/smbencrypt.c


Changeset:
Modified: trunk/source/libsmb/smbencrypt.c
===================================================================
--- trunk/source/libsmb/smbencrypt.c	2004-08-31 20:22:25 UTC (rev 2141)
+++ trunk/source/libsmb/smbencrypt.c	2004-08-31 20:23:56 UTC (rev 2142)
@@ -28,13 +28,17 @@
 /*
    This implements the X/Open SMB password encryption
    It takes a password ('unix' string), a 8 byte "crypt key" 
-   and puts 24 bytes of encrypted password into p24 */
-void SMBencrypt(const char *passwd, const uchar *c8, uchar p24[24])
+   and puts 24 bytes of encrypted password into p24 
+
+   Returns False if password must have been truncated to create LM hash
+*/
+BOOL SMBencrypt(const char *passwd, const uchar *c8, uchar p24[24])
 {
+	BOOL ret;
 	uchar p21[21];
 
 	memset(p21,'\0',21);
-	E_deshash(passwd, p21); 
+	ret = E_deshash(passwd, p21); 
 
 	SMBOWFencrypt(p21, c8, p24);
 
@@ -44,6 +48,8 @@
 	dump_data(100, (const char *)c8, 8);
 	dump_data(100, (char *)p24, 24);
 #endif
+
+	return ret;
 }
 
 /**



More information about the samba-cvs mailing list