From b640002afd6a3d3694b800db3bcc1711509a5514 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 14 Sep 2024 15:58:44 +0200 Subject: [PATCH] s3:rpc_client: remove unused cli_get_session_key() Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (cherry picked from commit 3a3338bd184e3c51eab48fb1a03b1b3e749f2dc6) --- source3/rpc_client/cli_pipe.c | 49 ----------------------------------- source3/rpc_client/cli_pipe.h | 4 --- 2 files changed, 53 deletions(-) diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 83869015d5e..5be23b99054 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3725,52 +3725,3 @@ NTSTATUS cli_rpc_pipe_open_schannel_with_creds(struct cli_state *cli, *_rpccli = rpccli; return NT_STATUS_OK; } - -NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, - struct rpc_pipe_client *cli, - DATA_BLOB *session_key) -{ - NTSTATUS status; - struct pipe_auth_data *a; - struct gensec_security *gensec_security; - DATA_BLOB sk = { .data = NULL }; - bool make_dup = false; - - if (!session_key || !cli) { - return NT_STATUS_INVALID_PARAMETER; - } - - a = cli->auth; - - if (a == NULL) { - return NT_STATUS_INVALID_PARAMETER; - } - - switch (cli->auth->auth_type) { - case DCERPC_AUTH_TYPE_NONE: - sk = data_blob_const(a->transport_session_key.data, - a->transport_session_key.length); - make_dup = true; - break; - default: - gensec_security = a->auth_ctx; - status = gensec_session_key(gensec_security, mem_ctx, &sk); - if (!NT_STATUS_IS_OK(status)) { - return status; - } - make_dup = false; - break; - } - - if (!sk.data) { - return NT_STATUS_NO_USER_SESSION_KEY; - } - - if (make_dup) { - *session_key = data_blob_dup_talloc(mem_ctx, sk); - } else { - *session_key = sk; - } - - return NT_STATUS_OK; -} diff --git a/source3/rpc_client/cli_pipe.h b/source3/rpc_client/cli_pipe.h index d9826ca8e5c..e6a66bbbe15 100644 --- a/source3/rpc_client/cli_pipe.h +++ b/source3/rpc_client/cli_pipe.h @@ -134,10 +134,6 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli, TALLOC_CTX *mem_ctx, struct netlogon_creds_cli_context **pcreds); -NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, - struct rpc_pipe_client *cli, - DATA_BLOB *session_key); - #endif /* _CLI_PIPE_H */ /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */ -- 2.47.2