[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: [PATCH] smbk5passwd module should uppercase the NT/LM hashes

You should submit patches via ITS to make sure they actually get tracked.

I think you should instead file a bug with the Samba project, since there are a variety of systems and tools out there already working with these hashes regardless of upper/lower case issues. It would help if you provide the version number of Samba that you're running with.

And finally, if you really want this change in functionality, just change the definition of the "hex" array.

Buchan Milne wrote:

Hash: SHA1

I was playing with smbk5passwd from HEAD built for 2.2, and I found that
it worked, but the alpha characters in the sambaNTPassword and
sambaLMPassword attrbitutes were lower-cased (whereas previously they
were upper-cased, as set by samba or other tools).

With this change, the module does the right thing (ie after a password
change with ldappasswd I could authenticate to samba with the new password).


Index: contrib/slapd-modules/smbk5pwd/smbk5pwd.c
RCS file:
retrieving revision 1.3
diff -u -r1.3 smbk5pwd.c
- --- contrib/slapd-modules/smbk5pwd/smbk5pwd.c   24 Jan 2005 20:46:06 -0000
+++ contrib/slapd-modules/smbk5pwd/smbk5pwd.c   1 Apr 2005 12:59:25 -0000
@@ -51,6 +51,7 @@
#ifdef DO_SAMBA
#include <openssl/des.h>
#include <openssl/md4.h>
+#include <ac/ctype.h>

static AttributeDescription *ad_sambaLMPassword;
static AttributeDescription *ad_sambaNTPassword;
@@ -104,8 +105,8 @@
       a = out->bv_val;
       b = (unsigned char *)in;
       for (i=0; i<HASHLEN; i++) {
- -               *a++ = hex[*b >> 4];
- -               *a++ = hex[*b++ & 0x0f];
+               *a++ = TOUPPER(hex[*b >> 4]);
+               *a++ = TOUPPER(hex[*b++ & 0x0f]);
       *a++ = '\0';

- --
Buchan Milne                      Senior Support Technician
Obsidian Systems                  http://www.obsidian.co.za
B.Eng          RHCE (803004789010797),LPIC-1 (LPI000074592)
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support