The branch, v3-3-test has been updated
       via  93b56755f739889da3a67b18a6430b14306d84f7 (commit)
      from  7541a0103ad22000e94ffc6d057ffd5d33d1a930 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 93b56755f739889da3a67b18a6430b14306d84f7
Author: Günther Deschner <[EMAIL PROTECTED]>
Date:   Tue Jun 10 21:35:34 2008 +0200

    rpc_client: add cli_get_session_key().
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/include/proto.h       |    3 +++
 source/rpc_client/cli_pipe.c |   31 +++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/proto.h b/source/include/proto.h
index 79a9251..70ab390 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -7130,6 +7130,9 @@ struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct 
cli_state *cli,
                                                const char *username,
                                                const char *password,
                                                NTSTATUS *perr);
+NTSTATUS cli_get_session_key(struct rpc_pipe_client *cli,
+                            DATA_BLOB *session_key);
+
 
 /* The following definitions come from rpc_client/cli_reg.c  */
 
diff --git a/source/rpc_client/cli_pipe.c b/source/rpc_client/cli_pipe.c
index 2fd0a6e..469142d 100644
--- a/source/rpc_client/cli_pipe.c
+++ b/source/rpc_client/cli_pipe.c
@@ -3340,3 +3340,34 @@ struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct 
cli_state *cli,
        return NULL;
 #endif
 }
+
+NTSTATUS cli_get_session_key(struct rpc_pipe_client *cli,
+                            DATA_BLOB *session_key)
+{
+       if (!session_key || !cli) {
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
+       if (!cli->auth) {
+               return NT_STATUS_INVALID_PARAMETER;
+       }
+
+       switch (cli->auth->auth_type) {
+               case PIPE_AUTH_TYPE_SCHANNEL:
+                       *session_key = 
data_blob(cli->auth->a_u.schannel_auth->sess_key, 16);
+                       break;
+               case PIPE_AUTH_TYPE_NTLMSSP:
+               case PIPE_AUTH_TYPE_SPNEGO_NTLMSSP:
+                       *session_key = 
cli->auth->a_u.ntlmssp_state->session_key;
+                       break;
+               case PIPE_AUTH_TYPE_KRB5:
+               case PIPE_AUTH_TYPE_SPNEGO_KRB5:
+                       *session_key = 
cli->auth->a_u.kerberos_auth->session_key;
+                       break;
+               case PIPE_AUTH_TYPE_NONE:
+               default:
+                       return NT_STATUS_NO_USER_SESSION_KEY;
+       }
+
+       return NT_STATUS_OK;
+}


-- 
Samba Shared Repository

Reply via email to