mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
Picked up by the build farm - despite all my efforts, security=server was
broken by my NTLM2 commit. This should correctly cause the NTLM2 case not to be negotiated when 'security=server' is in effect. Andrew Bartlett
This commit is contained in:
parent
c8485d3f00
commit
19bb4b582f
@ -340,7 +340,6 @@ static void ntlmssp_handle_neg_flags(struct ntlmssp_state *ntlmssp_state,
|
||||
|
||||
if (!(neg_flags & NTLMSSP_NEGOTIATE_NTLM2)) {
|
||||
ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_NTLM2;
|
||||
ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_LM_KEY;
|
||||
}
|
||||
|
||||
if (!(neg_flags & NTLMSSP_NEGOTIATE_128)) {
|
||||
@ -403,13 +402,6 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
|
||||
|
||||
ntlmssp_handle_neg_flags(ntlmssp_state, neg_flags, lp_lanman_auth());
|
||||
|
||||
chal_flags = ntlmssp_state->neg_flags;
|
||||
|
||||
target_name = ntlmssp_target_name(ntlmssp_state,
|
||||
neg_flags, &chal_flags);
|
||||
if (target_name == NULL)
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
/* Ask our caller what challenge they would like in the packet */
|
||||
cryptkey = ntlmssp_state->get_challenge(ntlmssp_state);
|
||||
|
||||
@ -418,6 +410,19 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
|
||||
ntlmssp_state->neg_flags &= ~NTLMSSP_NEGOTIATE_NTLM2;
|
||||
}
|
||||
|
||||
/* The flags we send back are not just the negotiated flags,
|
||||
* they are also 'what is in this packet'. Therfore, we
|
||||
* operate on 'chal_flags' from here on
|
||||
*/
|
||||
|
||||
chal_flags = ntlmssp_state->neg_flags;
|
||||
|
||||
/* get the right name to fill in as 'target' */
|
||||
target_name = ntlmssp_target_name(ntlmssp_state,
|
||||
neg_flags, &chal_flags);
|
||||
if (target_name == NULL)
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
|
||||
ntlmssp_state->chal = data_blob_talloc(ntlmssp_state->mem_ctx, cryptkey, 8);
|
||||
ntlmssp_state->internal_chal = data_blob_talloc(ntlmssp_state->mem_ctx, cryptkey, 8);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user