summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-01-12 16:12:02 +0100
committerStefan Metzmacher <metze@samba.org>2012-01-31 20:17:09 +0100
commit204dfd2c1d40e6f0450004b38805bd3d78a4b5a9 (patch)
treea7ddf32bbfe0d146342ded7baa816a3e170e7d38 /source3
parentab364e987433bb5d5f7dd08e8ef74a32c0aa592a (diff)
downloadsamba-204dfd2c1d40e6f0450004b38805bd3d78a4b5a9.tar.gz
samba-204dfd2c1d40e6f0450004b38805bd3d78a4b5a9.tar.bz2
samba-204dfd2c1d40e6f0450004b38805bd3d78a4b5a9.zip
s3:libsmb/auth_generic: make use of gensec_spnego in the client
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/auth_generic.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/libsmb/auth_generic.c b/source3/libsmb/auth_generic.c
index 39d14f6fe0..d38c11cb47 100644
--- a/source3/libsmb/auth_generic.c
+++ b/source3/libsmb/auth_generic.c
@@ -52,7 +52,7 @@ NTSTATUS auth_generic_client_prepare(TALLOC_CTX *mem_ctx, struct auth_generic_st
{
struct auth_generic_state *ans;
NTSTATUS nt_status;
-
+ size_t idx = 0;
struct gensec_settings *gensec_settings;
struct loadparm_context *lp_ctx;
@@ -76,18 +76,23 @@ NTSTATUS auth_generic_client_prepare(TALLOC_CTX *mem_ctx, struct auth_generic_st
return NT_STATUS_NO_MEMORY;
}
- gensec_settings->backends = talloc_zero_array(gensec_settings, struct gensec_security_ops *, 3);
+ gensec_settings->backends = talloc_zero_array(gensec_settings,
+ struct gensec_security_ops *, 4);
if (gensec_settings->backends == NULL) {
TALLOC_FREE(ans);
return NT_STATUS_NO_MEMORY;
}
- gensec_settings->backends[0] = &gensec_ntlmssp3_client_ops;
+ gensec_settings->backends[idx++] = &gensec_ntlmssp3_client_ops;
#if defined(HAVE_KRB5) && defined(HAVE_GSS_WRAP_IOV)
- gensec_settings->backends[1] = &gensec_gse_krb5_security_ops;
+ gensec_settings->backends[idx++] = &gensec_gse_krb5_security_ops;
#endif
+ gensec_init();
+ gensec_settings->backends[idx++] = gensec_security_by_oid(NULL,
+ GENSEC_OID_SPNEGO);
+
nt_status = gensec_client_start(ans, &ans->gensec_security, gensec_settings);
if (!NT_STATUS_IS_OK(nt_status)) {