1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

auth/spnego: make sure a fatal error or the final success make the state as SPNEGO_DONE

This means any further gensec_update() will fail with
NT_STATUS_INVALID_PARAMETER.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2017-05-10 17:12:14 +02:00 committed by Andrew Bartlett
parent 06fa3ae313
commit b713da052b

View File

@ -1351,6 +1351,10 @@ static NTSTATUS gensec_spnego_update_out(struct gensec_security *gensec_security
return spnego_state->out_status; return spnego_state->out_status;
} }
/*
* We're completely done, further updates are not allowed.
*/
spnego_state->state_position = SPNEGO_DONE;
return gensec_child_ready(gensec_security, return gensec_child_ready(gensec_security,
spnego_state->sub_sec_security); spnego_state->sub_sec_security);
} }
@ -1424,6 +1428,10 @@ static NTSTATUS gensec_spnego_update_wrapper(struct gensec_security *gensec_secu
} }
if (!NT_STATUS_IS_OK(status) && if (!NT_STATUS_IS_OK(status) &&
!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {
/*
* A fatal error, further updates are not allowed.
*/
spnego_state->state_position = SPNEGO_DONE;
return status; return status;
} }