summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-24 09:37:12 +0200
committerStefan Metzmacher <metze@samba.org>2009-07-24 09:48:13 +0200
commit210181de7503966ea9fbfdbe2c030ab7b04b973c (patch)
tree8b5e1fbd6b09b4dd0697e605646be2da7ae9da1a
parentc00e4040bcbe18b76f8147bb124409d079bdb8c9 (diff)
downloadsamba-210181de7503966ea9fbfdbe2c030ab7b04b973c.tar.gz
samba-210181de7503966ea9fbfdbe2c030ab7b04b973c.tar.bz2
samba-210181de7503966ea9fbfdbe2c030ab7b04b973c.zip
s4:gensec_gssapi: pass the correct oid to the gssapi layer.
metze
-rw-r--r--source4/auth/gensec/gensec_gssapi.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index 7129db72b8..a23f913264 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -38,6 +38,7 @@
#include "auth/session_proto.h"
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_krb5.h>
+#include <gssapi/gssapi_spnego.h>
#include "auth/gensec/gensec_gssapi.h"
static size_t gensec_gssapi_max_input_size(struct gensec_security *gensec_security);
@@ -206,8 +207,16 @@ static NTSTATUS gensec_gssapi_start(struct gensec_security *gensec_security)
gensec_gssapi_state->want_flags |= GSS_C_DCE_STYLE;
}
- gensec_gssapi_state->gss_oid = GSS_C_NULL_OID;
-
+ switch (gensec_security->ops->auth_type) {
+ case DCERPC_AUTH_TYPE_SPNEGO:
+ gensec_gssapi_state->gss_oid = gss_mech_spnego;
+ break;
+ case DCERPC_AUTH_TYPE_KRB5:
+ default:
+ gensec_gssapi_state->gss_oid = gss_mech_krb5;
+ break;
+ }
+
send_to_kdc.func = smb_krb5_send_and_recv_func;
send_to_kdc.ptr = gensec_security->event_ctx;
@@ -336,8 +345,6 @@ static NTSTATUS gensec_gssapi_client_start(struct gensec_security *gensec_securi
gensec_gssapi_state = talloc_get_type(gensec_security->private_data, struct gensec_gssapi_state);
- gensec_gssapi_state->gss_oid = gss_mech_krb5;
-
principal = gensec_get_target_principal(gensec_security);
if (principal && lp_client_use_spnego_principal(gensec_security->settings->lp_ctx)) {
name_type = GSS_C_NULL_OID;