From be05d71b9e3fe3c73ada46f7bb7745bf19633716 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 14 Dec 2009 19:29:36 +0100 Subject: Simplify E_md5hash a bit --- libcli/auth/smbencrypt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libcli/auth/smbencrypt.c') diff --git a/libcli/auth/smbencrypt.c b/libcli/auth/smbencrypt.c index a3182cd806..f7c60e7de1 100644 --- 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); } -- cgit