diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-05-20 17:17:07 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-05-20 19:58:37 +0200 |
commit | 540b7130750f82d52a514a5117237e1b3e90e97b (patch) | |
tree | 3fd1075bffb225bd2890fb1c3e7a7ec88a497bd9 | |
parent | 5b55e47b71382eed168038fe0f94b25628b611f9 (diff) | |
download | samba-540b7130750f82d52a514a5117237e1b3e90e97b.tar.gz samba-540b7130750f82d52a514a5117237e1b3e90e97b.tar.bz2 samba-540b7130750f82d52a514a5117237e1b3e90e97b.zip |
s4:libcli/smb2: use raw ntlmssp if the server didn't provide a sec blob
metze
-rw-r--r-- | source4/libcli/smb2/session.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c index 127bb9bcae..cf50ba6831 100644 --- a/source4/libcli/smb2/session.c +++ b/source4/libcli/smb2/session.c @@ -207,6 +207,7 @@ struct composite_context *smb2_session_setup_spnego_send(struct smb2_session *se { struct composite_context *c; struct smb2_session_state *state; + const char *chosen_oid; c = composite_create(session, session->transport->socket->event.ctx); if (c == NULL) return NULL; @@ -235,7 +236,13 @@ struct composite_context *smb2_session_setup_spnego_send(struct smb2_session *se c->status = gensec_set_target_service(session->gensec, "cifs"); if (!composite_is_ok(c)) return c; - c->status = gensec_start_mech_by_oid(session->gensec, GENSEC_OID_SPNEGO); + if (session->transport->negotiate.secblob.length > 0) { + chosen_oid = GENSEC_OID_SPNEGO; + } else { + chosen_oid = GENSEC_OID_NTLMSSP; + } + + c->status = gensec_start_mech_by_oid(session->gensec, chosen_oid); if (!composite_is_ok(c)) return c; c->status = gensec_update(session->gensec, c, |