summaryrefslogtreecommitdiffstats
path: root/source/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-08-06 05:44:26 +0000
committerGerald Carter <jerry@samba.org>2004-08-06 05:44:26 +0000
commit547587d57c0ca7fa5babac358d4b2f67a472e142 (patch)
treeabbcd3ba0d6ab0e15317fc0930a3c8e109f322f9 /source/libsmb
parentfecd5ea163ffcd1bbee5b06e05112dbff9aa71b1 (diff)
downloadsamba-3.0.6rc2.tar.gz
samba-3.0.6rc2.tar.xz
samba-3.0.6rc2.zip
r1664: last changes before 3.0.6rc2samba-3.0.6rc2
Diffstat (limited to 'source/libsmb')
-rw-r--r--source/libsmb/smbencrypt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/libsmb/smbencrypt.c b/source/libsmb/smbencrypt.c
index 9f936b77aec..d4b05574118 100644
--- a/source/libsmb/smbencrypt.c
+++ b/source/libsmb/smbencrypt.c
@@ -73,6 +73,26 @@ void E_md4hash(const char *passwd, uchar p16[16])
}
/**
+ * Creates the MD5 Hash of a combination of 16 byte salt and 16 byte NT hash.
+ * @param 16 byte salt.
+ * @param 16 byte NT hash.
+ * @param 16 byte return hashed with md5, caller allocated 16 byte buffer
+ */
+
+void E_md5hash(const uchar salt[16], const uchar nthash[16], uchar hash_out[16])
+{
+ struct MD5Context tctx;
+ uchar array[32];
+
+ memset(hash_out, '\0', 16);
+ memcpy(array, salt, 16);
+ memcpy(&array[16], nthash, 16);
+ MD5Init(&tctx);
+ MD5Update(&tctx, array, 32);
+ MD5Final(hash_out, &tctx);
+}
+
+/**
* Creates the DES forward-only Hash of the users password in DOS ASCII charset
* @param passwd password in 'unix' charset.
* @param p16 return password hashed with DES, caller allocated 16 byte buffer