git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2042f49
)
Simplify E_md5hash a bit
author
Volker Lendecke
<vl@samba.org>
Mon, 14 Dec 2009 18:29:36 +0000
(19:29 +0100)
committer
Karolin Seeger
<kseeger@samba.org>
Mon, 25 Jan 2010 11:41:57 +0000
(12:41 +0100)
libcli/auth/smbencrypt.c
patch
|
blob
|
history
diff --git
a/libcli/auth/smbencrypt.c
b/libcli/auth/smbencrypt.c
index a3182cd806bd510de891c86a306e21628fdc89fd..f7c60e7de123c4f4e6716a772a35a07b7c6af91d 100644
(file)
--- a/
libcli/auth/smbencrypt.c
+++ b/
libcli/auth/smbencrypt.c
@@
-100,13
+100,9
@@
bool E_md4hash(const char *passwd, uint8_t p16[16])
void E_md5hash(const uint8_t salt[16], const uint8_t nthash[16], uint8_t hash_out[16])
{
struct MD5Context tctx;
- uint8_t array[32];
-
- memset(hash_out, '\0', 16);
- memcpy(array, salt, 16);
- memcpy(&array[16], nthash, 16);
MD5Init(&tctx);
- MD5Update(&tctx, array, 32);
+ MD5Update(&tctx, salt, 16);
+ MD5Update(&tctx, nthash, 16);
MD5Final(hash_out, &tctx);
}