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