From 8b42f526f47bc8075b5a6f81b2293787ccb066bc Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 1 Aug 2012 10:18:22 +0200 Subject: s3:rpc_client: make use of smbXcli_session_application_key() metze --- source3/rpc_client/cli_pipe.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 8b9e513b00..bd4981316d 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -2862,9 +2862,22 @@ NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli, auth->user_name = talloc_strdup(auth, cli->user_name); auth->domain = talloc_strdup(auth, cli->domain); - auth->user_session_key = data_blob_talloc(auth, - cli->user_session_key.data, - cli->user_session_key.length); + + if (transport == NCACN_NP) { + struct smbXcli_session *session; + + if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) { + session = cli->smb2.session; + } else { + session = cli->smb1.session; + } + + status = smbXcli_session_application_key(session, auth, + &auth->user_session_key); + if (!NT_STATUS_IS_OK(status)) { + auth->user_session_key = data_blob_null; + } + } if ((auth->user_name == NULL) || (auth->domain == NULL)) { TALLOC_FREE(result); -- cgit