summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-12-02 18:15:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:17 -0500
commit00948a80724ccfe1454bc40fcfcdc2287b4e3f31 (patch)
tree3ac3722a4dd7dc543054020734d41b520db01d4b /source4
parent4299e989c0e50dcc4f2940b4db50a0b67117fd4c (diff)
downloadsamba-00948a80724ccfe1454bc40fcfcdc2287b4e3f31.tar.gz
samba-00948a80724ccfe1454bc40fcfcdc2287b4e3f31.tar.bz2
samba-00948a80724ccfe1454bc40fcfcdc2287b4e3f31.zip
r4044: only send supportedMech when we also send other data
metze (This used to be commit 1e0483a8482574fa0f8d7ad31cc4bf4a6155ec52)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/auth/spnego.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/libcli/auth/spnego.c b/source4/libcli/auth/spnego.c
index b6436fe8c6..3af1bc1e81 100644
--- a/source4/libcli/auth/spnego.c
+++ b/source4/libcli/auth/spnego.c
@@ -375,23 +375,26 @@ static NTSTATUS gensec_spnego_server_negTokenTarg(struct gensec_security *gensec
spnego_out.type = SPNEGO_NEG_TOKEN_TARG;
spnego_out.negTokenTarg.responseToken = unwrapped_out;
spnego_out.negTokenTarg.mechListMIC = null_data_blob;
-
+ spnego_out.negTokenTarg.supportedMech = NULL;
+
if (NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
- spnego_out.negTokenTarg.supportedMech
+ spnego_out.negTokenTarg.supportedMech
= spnego_state->sub_sec_security->ops->oid;
spnego_out.negTokenTarg.negResult = SPNEGO_ACCEPT_INCOMPLETE;
spnego_state->state_position = SPNEGO_SERVER_TARG;
} else if (NT_STATUS_IS_OK(nt_status)) {
- spnego_out.negTokenTarg.supportedMech = NULL;
+ if (unwrapped_out.data) {
+ spnego_out.negTokenTarg.supportedMech
+ = spnego_state->sub_sec_security->ops->oid;
+ }
spnego_out.negTokenTarg.negResult = SPNEGO_ACCEPT_COMPLETED;
spnego_state->state_position = SPNEGO_DONE;
} else {
- spnego_out.negTokenTarg.supportedMech = NULL;
spnego_out.negTokenTarg.negResult = SPNEGO_REJECT;
DEBUG(1, ("SPNEGO login failed: %s\n", nt_errstr(nt_status)));
spnego_state->state_position = SPNEGO_DONE;
}
-
+
if (spnego_write_data(out_mem_ctx, out, &spnego_out) == -1) {
DEBUG(1, ("Failed to write SPNEGO reply to NEG_TOKEN_TARG\n"));
return NT_STATUS_INVALID_PARAMETER;