b6b438
From 5913cd056fae4d3a147326a30182a2d30bfe7857 Mon Sep 17 00:00:00 2001
b6b438
From: Andrew Bartlett <abartlet@samba.org>
b6b438
Date: Fri, 16 Aug 2019 14:22:42 +1200
b6b438
Subject: [PATCH 097/187] s3-librpc: Remove unused init_netr_CryptPassword()
b6b438
b6b438
Unused since 38d4dba37406515181e4d6f1a1faffc18e652e27 in 2013
b6b438
b6b438
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
b6b438
Reviewed-by: Andreas Schneider <asn@samba.org>
b6b438
(cherry picked from commit 1aa249e7f4a1c4222b4cc79bac64c8b95c89d868)
b6b438
---
b6b438
 source3/rpc_client/cli_netlogon.c  |  1 -
b6b438
 source3/rpc_client/init_netlogon.c | 50 ------------------------------
b6b438
 source3/rpc_client/init_netlogon.h | 29 -----------------
b6b438
 source3/wscript_build              |  5 ---
b6b438
 4 files changed, 85 deletions(-)
b6b438
 delete mode 100644 source3/rpc_client/init_netlogon.c
b6b438
 delete mode 100644 source3/rpc_client/init_netlogon.h
b6b438
b6b438
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
b6b438
index 505a1d015bc..ea9cb757048 100644
b6b438
--- a/source3/rpc_client/cli_netlogon.c
b6b438
+++ b/source3/rpc_client/cli_netlogon.c
b6b438
@@ -30,7 +30,6 @@
b6b438
 #include "../librpc/gen_ndr/ndr_netlogon_c.h"
b6b438
 #include "../librpc/gen_ndr/schannel.h"
b6b438
 #include "rpc_client/cli_netlogon.h"
b6b438
-#include "rpc_client/init_netlogon.h"
b6b438
 #include "rpc_client/util_netlogon.h"
b6b438
 #include "../libcli/security/security.h"
b6b438
 #include "lib/param/param.h"
b6b438
diff --git a/source3/rpc_client/init_netlogon.c b/source3/rpc_client/init_netlogon.c
b6b438
deleted file mode 100644
b6b438
index 26deaba8065..00000000000
b6b438
--- a/source3/rpc_client/init_netlogon.c
b6b438
+++ /dev/null
b6b438
@@ -1,50 +0,0 @@
b6b438
-/*
b6b438
- *  Unix SMB/CIFS implementation.
b6b438
- *  RPC Pipe client / server routines
b6b438
- *  Copyright (C) Guenther Deschner                  2008,2012
b6b438
- *
b6b438
- *  This program is free software; you can redistribute it and/or modify
b6b438
- *  it under the terms of the GNU General Public License as published by
b6b438
- *  the Free Software Foundation; either version 3 of the License, or
b6b438
- *  (at your option) any later version.
b6b438
- *
b6b438
- *  This program is distributed in the hope that it will be useful,
b6b438
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
b6b438
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b6b438
- *  GNU General Public License for more details.
b6b438
- *
b6b438
- *  You should have received a copy of the GNU General Public License
b6b438
- *  along with this program; if not, see <http://www.gnu.org/licenses/>.
b6b438
- */
b6b438
-
b6b438
-#include "includes.h"
b6b438
-#include "../libcli/auth/libcli_auth.h"
b6b438
-#include "../lib/crypto/crypto.h"
b6b438
-#include "rpc_client/init_netlogon.h"
b6b438
-
b6b438
-/*************************************************************************
b6b438
- inits a netr_CryptPassword structure
b6b438
- *************************************************************************/
b6b438
-
b6b438
-void init_netr_CryptPassword(const char *pwd,
b6b438
-			     struct netlogon_creds_CredentialState *creds,
b6b438
-			     struct netr_CryptPassword *pwd_buf)
b6b438
-{
b6b438
-	struct samr_CryptPassword password_buf;
b6b438
-	NTSTATUS status;
b6b438
-
b6b438
-	encode_pw_buffer(password_buf.data, pwd, STR_UNICODE);
b6b438
-
b6b438
-	if (creds->negotiate_flags & NETLOGON_NEG_SUPPORTS_AES) {
b6b438
-		netlogon_creds_aes_encrypt(creds, password_buf.data, 516);
b6b438
-	} else {
b6b438
-		status = netlogon_creds_arcfour_crypt(creds,
b6b438
-						      password_buf.data,
b6b438
-						      516);
b6b438
-		if (!NT_STATUS_IS_OK(status)) {
b6b438
-			return;
b6b438
-		}
b6b438
-	}
b6b438
-	memcpy(pwd_buf->data, password_buf.data, 512);
b6b438
-	pwd_buf->length = IVAL(password_buf.data, 512);
b6b438
-}
b6b438
diff --git a/source3/rpc_client/init_netlogon.h b/source3/rpc_client/init_netlogon.h
b6b438
deleted file mode 100644
b6b438
index bb4496b4cd9..00000000000
b6b438
--- a/source3/rpc_client/init_netlogon.h
b6b438
+++ /dev/null
b6b438
@@ -1,29 +0,0 @@
b6b438
-/*
b6b438
- *  Unix SMB/CIFS implementation.
b6b438
- *  RPC Pipe client / server routines
b6b438
- *  Copyright (C) Guenther Deschner                  2008.
b6b438
- *
b6b438
- *  This program is free software; you can redistribute it and/or modify
b6b438
- *  it under the terms of the GNU General Public License as published by
b6b438
- *  the Free Software Foundation; either version 3 of the License, or
b6b438
- *  (at your option) any later version.
b6b438
- *
b6b438
- *  This program is distributed in the hope that it will be useful,
b6b438
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
b6b438
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b6b438
- *  GNU General Public License for more details.
b6b438
- *
b6b438
- *  You should have received a copy of the GNU General Public License
b6b438
- *  along with this program; if not, see <http://www.gnu.org/licenses/>.
b6b438
- */
b6b438
-
b6b438
-#ifndef _RPC_CLIENT_INIT_NETLOGON_H_
b6b438
-#define _RPC_CLIENT_INIT_NETLOGON_H_
b6b438
-
b6b438
-/* The following definitions come from rpc_client/init_netlogon.c  */
b6b438
-
b6b438
-void init_netr_CryptPassword(const char *pwd,
b6b438
-			     struct netlogon_creds_CredentialState *creds,
b6b438
-			     struct netr_CryptPassword *pwd_buf);
b6b438
-
b6b438
-#endif /* _RPC_CLIENT_INIT_NETLOGON_H_ */
b6b438
diff --git a/source3/wscript_build b/source3/wscript_build
b6b438
index b73f6dc0664..ce3fa362bc2 100644
b6b438
--- a/source3/wscript_build
b6b438
+++ b/source3/wscript_build
b6b438
@@ -1024,7 +1024,6 @@ bld.SAMBA3_LIBRARY('libcli_netlogon3',
b6b438
                    deps='''
b6b438
                         msrpc3
b6b438
                         RPC_NDR_NETLOGON
b6b438
-                        INIT_NETLOGON
b6b438
                         cliauth
b6b438
                         smbconf
b6b438
                         NETLOGON_CREDS_CLI''',
b6b438
@@ -1057,10 +1056,6 @@ bld.SAMBA3_SUBSYSTEM('INIT_LSA',
b6b438
                     source='rpc_client/init_lsa.c',
b6b438
                     deps='samba-util')
b6b438
 
b6b438
-bld.SAMBA3_SUBSYSTEM('INIT_NETLOGON',
b6b438
-                    source='rpc_client/init_netlogon.c',
b6b438
-                    deps='samba-util')
b6b438
-
b6b438
 bld.SAMBA3_SUBSYSTEM('INIT_SAMR',
b6b438
                     source='rpc_client/init_samr.c',
b6b438
                     deps='samba-util GNUTLS_HELPERS')
b6b438
-- 
b6b438
2.23.0
b6b438