From b78453326bf41cf3af239a5415dfef80a842d555 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 21 Apr 2008 08:01:51 +0200 Subject: Remove the "pwd" struct from rpc_pipe_client The only user of this was decrypt_trustdom_secret, and this only needs the NT hash anyway. (This used to be commit 3d8c2a47e677a4c4aacf4abf148b1bd8163c3351) --- source3/rpc_client/cli_pipe.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'source3/rpc_client/cli_pipe.c') diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index d4ce45446b..828307cace 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2139,6 +2139,18 @@ bool rpccli_is_pipe_idx(struct rpc_pipe_client *cli, int pipe_idx) return (cli->abstract_syntax == pipe_names[pipe_idx].abstr_syntax); } +bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]) +{ + if (!((cli->auth.auth_type == PIPE_AUTH_TYPE_NTLMSSP) + || (cli->auth.auth_type == PIPE_AUTH_TYPE_SPNEGO_NTLMSSP))) { + E_md4hash(cli->cli->pwd.password, nt_hash); + return true; + } + + memcpy(nt_hash, cli->auth.a_u.ntlmssp_state->nt_hash, 16); + return true; +} + struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p) { return p->cli; @@ -2337,8 +2349,6 @@ static struct rpc_pipe_client *cli_rpc_pipe_open_ntlmssp_internal(struct cli_sta goto err; } - pwd_set_cleartext(&result->pwd, password); - *perr = ntlmssp_client_start(&ntlmssp_state); if (!NT_STATUS_IS_OK(*perr)) { goto err; -- cgit