summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-06-05 01:54:16 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:28 -0500
commit8de7e76e789f7b0b767fd61f34e5176c63e1ff8d (patch)
treeffa995db16bedbbaa9af9eb7715d5a318acddb48 /source4/auth
parent0d466258be1fc7156de469daec07b79701557168 (diff)
downloadsamba-8de7e76e789f7b0b767fd61f34e5176c63e1ff8d.tar.gz
samba-8de7e76e789f7b0b767fd61f34e5176c63e1ff8d.tar.bz2
samba-8de7e76e789f7b0b767fd61f34e5176c63e1ff8d.zip
r1020: Add an (untested, until the other end is hooked in) method for
obtaining the session_info from an NTLMSSP authenticated user. Andrew Bartlett (This used to be commit 7961f1a18d67a6a0cf2c61bcc1c3b42ed06176f7)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/auth_ntlmssp.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/auth/auth_ntlmssp.c b/source4/auth/auth_ntlmssp.c
index 29bd92e7ef..b5b6352c00 100644
--- a/source4/auth/auth_ntlmssp.c
+++ b/source4/auth/auth_ntlmssp.c
@@ -203,3 +203,31 @@ NTSTATUS auth_ntlmssp_update(struct auth_ntlmssp_state *auth_ntlmssp_state,
out_mem_ctx,
in, out);
}
+
+/**
+ * Return the credentials of a logged on user, including session keys
+ * etc.
+ *
+ * Only valid after a successful authentication
+ *
+ */
+
+NTSTATUS auth_ntlmssp_get_session_info(struct auth_ntlmssp_state *auth_ntlmssp_state,
+ struct auth_session_info **session_info)
+{
+ NTSTATUS nt_status;
+ nt_status = make_session_info(auth_ntlmssp_state->server_info, session_info);
+
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ return nt_status;
+ }
+
+ /* the session_info owns this now */
+ auth_ntlmssp_state->server_info = NULL;
+
+ (*session_info)->session_key = data_blob_talloc((*session_info)->mem_ctx,
+ auth_ntlmssp_state->ntlmssp_state->session_key.data,
+ auth_ntlmssp_state->ntlmssp_state->session_key.length);
+
+ return NT_STATUS_OK;
+}