summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-10-07 02:07:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:30 -0500
commit05c5d145e7cd4d9ca95159428f5732bf7880ecaf (patch)
treeda4a66598da97232959c681944ea5fafea3e871c
parent5e0fd505abd1926558e59ae77bcfd03cd0beecfa (diff)
downloadsamba-05c5d145e7cd4d9ca95159428f5732bf7880ecaf.tar.gz
samba-05c5d145e7cd4d9ca95159428f5732bf7880ecaf.tar.bz2
samba-05c5d145e7cd4d9ca95159428f5732bf7880ecaf.zip
r10796: Make getting an anonymous session info a utility function.
Andrew Bartlett (This used to be commit 6021fa373405f8788dc216aae82a3f4a80df4ba7)
-rw-r--r--source4/auth/auth_util.c26
-rw-r--r--source4/auth/gensec/schannel.c22
2 files changed, 27 insertions, 21 deletions
diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c
index a56a32d934..19fd63ed2e 100644
--- a/source4/auth/auth_util.c
+++ b/source4/auth/auth_util.c
@@ -456,6 +456,32 @@ NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
+ struct auth_session_info **_session_info)
+{
+ NTSTATUS nt_status;
+ struct auth_serversupplied_info *server_info = NULL;
+ struct auth_session_info *session_info = NULL;
+ TALLOC_CTX *mem_ctx = talloc_new(parent_ctx);
+
+ nt_status = auth_anonymous_server_info(mem_ctx,
+ &server_info);
+ if (!NT_STATUS_IS_OK(nt_status)) {
+ talloc_free(mem_ctx);
+ return nt_status;
+ }
+
+ /* references the server_info into the session_info */
+ nt_status = auth_generate_session_info(parent_ctx, server_info, &session_info);
+ talloc_free(mem_ctx);
+
+ NT_STATUS_NOT_OK_RETURN(nt_status);
+
+ *_session_info = session_info;
+
+ return NT_STATUS_OK;
+}
+
/****************************************************************************
prints a struct auth_session_info security token to debug output.
****************************************************************************/
diff --git a/source4/auth/gensec/schannel.c b/source4/auth/gensec/schannel.c
index 8d5c7554f5..dd0bc1eddd 100644
--- a/source4/auth/gensec/schannel.c
+++ b/source4/auth/gensec/schannel.c
@@ -167,28 +167,8 @@ NTSTATUS dcerpc_schannel_creds(struct gensec_security *gensec_security,
static NTSTATUS schannel_session_info(struct gensec_security *gensec_security,
struct auth_session_info **_session_info)
{
- NTSTATUS nt_status;
struct schannel_state *state = gensec_security->private_data;
- struct auth_serversupplied_info *server_info = NULL;
- struct auth_session_info *session_info = NULL;
- TALLOC_CTX *mem_ctx = talloc_new(state);
-
- nt_status = auth_anonymous_server_info(mem_ctx,
- &server_info);
- if (!NT_STATUS_IS_OK(nt_status)) {
- talloc_free(mem_ctx);
- return nt_status;
- }
-
- /* references the server_info into the session_info */
- nt_status = auth_generate_session_info(state, server_info, &session_info);
- talloc_free(mem_ctx);
-
- NT_STATUS_NOT_OK_RETURN(nt_status);
-
- *_session_info = session_info;
-
- return NT_STATUS_OK;
+ return auth_anonymous_session_info(state, _session_info);
}
static NTSTATUS schannel_start(struct gensec_security *gensec_security)