]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_client: remove unused cli_get_session_key()
authorStefan Metzmacher <metze@samba.org>
Sat, 14 Sep 2024 13:58:44 +0000 (15:58 +0200)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:14 +0000 (11:27 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 3a3338bd184e3c51eab48fb1a03b1b3e749f2dc6)

source3/rpc_client/cli_pipe.c
source3/rpc_client/cli_pipe.h

index 83869015d5e2fa82f07480b8817e0bc81b551c46..5be23b99054229e5195b4fed69f2b4674a17c400 100644 (file)
@@ -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;
-}
index d9826ca8e5cdb2a5c3854ee39c96660fdc177d04..e6a66bbbe158ebc1f24fb577f1934d3995cf5183 100644 (file)
@@ -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: */