Blob Blame History Raw
From a2430d2ddcabca282d49e8dcd66cc0aaa1e85918 Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn@samba.org>
Date: Mon, 18 Nov 2019 10:29:55 +0100
Subject: [PATCH 159/187] libcli:auth: Remove unused E_md5hash()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14195

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit e19b115dd27891896364f5e943b0ce7fcc89344e)
---
 libcli/auth/proto.h      |  8 --------
 libcli/auth/smbencrypt.c | 33 ---------------------------------
 2 files changed, 41 deletions(-)

diff --git a/libcli/auth/proto.h b/libcli/auth/proto.h
index eef1c8dc095..eb725c83d15 100644
--- a/libcli/auth/proto.h
+++ b/libcli/auth/proto.h
@@ -105,14 +105,6 @@ bool SMBencrypt(const char *passwd, const uint8_t *c8, uint8_t p24[24]);
  */
 bool E_md4hash(const char *passwd, uint8_t 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 uint8_t salt[16], const uint8_t nthash[16], uint8_t hash_out[16]);
-
 /**
  * Creates the DES forward-only Hash of the users password in DOS ASCII charset
  * @param passwd password in 'unix' charset.
diff --git a/libcli/auth/smbencrypt.c b/libcli/auth/smbencrypt.c
index e33d29de19d..ab2c47ad9bb 100644
--- a/libcli/auth/smbencrypt.c
+++ b/libcli/auth/smbencrypt.c
@@ -94,39 +94,6 @@ bool E_md4hash(const char *passwd, uint8_t p16[16])
 	return true;
 }
 
-/**
- * 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 uint8_t salt[16], const uint8_t nthash[16], uint8_t hash_out[16])
-{
-	gnutls_hash_hd_t hash_hnd = NULL;
-	int rc;
-
-	rc = gnutls_hash_init(&hash_hnd, GNUTLS_DIG_MD5);
-	if (rc < 0) {
-		goto out;
-	}
-
-	rc = gnutls_hash(hash_hnd, salt, 16);
-	if (rc < 0) {
-		gnutls_hash_deinit(hash_hnd, NULL);
-		goto out;
-	}
-	rc = gnutls_hash(hash_hnd, nthash, 16);
-	if (rc < 0) {
-		gnutls_hash_deinit(hash_hnd, NULL);
-		goto out;
-	}
-	gnutls_hash_deinit(hash_hnd, hash_out);
-
-out:
-	return;
-}
-
 /**
  * Creates the DES forward-only Hash of the users password in DOS ASCII charset
  * @param passwd password in 'unix' charset.
-- 
2.23.0