summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-29 17:01:28 +0100
committerGünther Deschner <gd@samba.org>2010-03-24 17:34:49 +0100
commit83cc137d5eef9d50af9b458c5c64fa9abc20adde (patch)
tree92e885aad39659745909be3fb967294c292e16c8 /source4/auth
parent8df01705bf10c700ea2f76387cf6fedaacb24327 (diff)
downloadsamba-83cc137d5eef9d50af9b458c5c64fa9abc20adde.tar.gz
samba-83cc137d5eef9d50af9b458c5c64fa9abc20adde.tar.bz2
samba-83cc137d5eef9d50af9b458c5c64fa9abc20adde.zip
s4:ntlmssp: create a gensec_ntlmssp_context between gensec_security and ntlmssp_state
Inspired by the NTLMSSP merge work by Andrew Bartlett. metze Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/ntlmssp/ntlmssp.c27
-rw-r--r--source4/auth/ntlmssp/ntlmssp.h2
2 files changed, 20 insertions, 9 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp.c b/source4/auth/ntlmssp/ntlmssp.c
index f52d02dceb..dd3ba6e2e9 100644
--- a/source4/auth/ntlmssp/ntlmssp.c
+++ b/source4/auth/ntlmssp/ntlmssp.c
@@ -380,18 +380,29 @@ static bool gensec_ntlmssp_have_feature(struct gensec_security *gensec_security,
NTSTATUS gensec_ntlmssp_start(struct gensec_security *gensec_security)
{
- struct gensec_ntlmssp_state *gensec_ntlmssp_state;
-
- gensec_ntlmssp_state = talloc_zero(gensec_security, struct gensec_ntlmssp_state);
- if (!gensec_ntlmssp_state) {
+ struct gensec_ntlmssp_context *gensec_ntlmssp;
+ struct gensec_ntlmssp_state *ntlmssp_state;
+
+ gensec_ntlmssp = talloc_zero(gensec_security,
+ struct gensec_ntlmssp_context);
+ if (!gensec_ntlmssp) {
return NT_STATUS_NO_MEMORY;
}
- gensec_ntlmssp_state->gensec_security = gensec_security;
- gensec_ntlmssp_state->auth_context = NULL;
- gensec_ntlmssp_state->server_info = NULL;
+ gensec_ntlmssp->gensec_security = gensec_security;
+
+ ntlmssp_state = talloc_zero(gensec_ntlmssp,
+ struct gensec_ntlmssp_state);
+ if (!ntlmssp_state) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
+ ntlmssp_state->gensec_security = gensec_security;
+ ntlmssp_state->callback_private = gensec_ntlmssp;
+
+ gensec_ntlmssp->ntlmssp_state = ntlmssp_state;
- gensec_security->private_data = gensec_ntlmssp_state;
+ gensec_security->private_data = ntlmssp_state;
return NT_STATUS_OK;
}
diff --git a/source4/auth/ntlmssp/ntlmssp.h b/source4/auth/ntlmssp/ntlmssp.h
index 31a0bc39bd..2d8ec2db43 100644
--- a/source4/auth/ntlmssp/ntlmssp.h
+++ b/source4/auth/ntlmssp/ntlmssp.h
@@ -156,7 +156,7 @@ struct gensec_ntlmssp_state
struct gensec_ntlmssp_context {
struct gensec_security *gensec_security;
- struct ntlmssp_state *ntlmssp_state;
+ struct gensec_ntlmssp_state *ntlmssp_state;
struct auth_context *auth_context;
struct auth_serversupplied_info *server_info;
};