mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
CVE-2016-2110: auth/ntlmssp: split allow_lm_response from allow_lm_key
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11644 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
This commit is contained in:
parent
2843f012b6
commit
7a6b3efdc6
@ -118,7 +118,10 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
|
||||
|
||||
ntlmssp_state->expected_state = NTLMSSP_NEGOTIATE;
|
||||
|
||||
if (lpcfg_lanman_auth(gensec_security->settings->lp_ctx) &&
|
||||
ntlmssp_state->allow_lm_response =
|
||||
lpcfg_lanman_auth(gensec_security->settings->lp_ctx);
|
||||
|
||||
if (ntlmssp_state->allow_lm_response &&
|
||||
gensec_setting_bool(gensec_security->settings,
|
||||
"ntlmssp_server", "allow_lm_key", false))
|
||||
{
|
||||
|
@ -64,6 +64,7 @@ struct ntlmssp_state
|
||||
bool use_ccache;
|
||||
bool resume_ccache;
|
||||
bool use_nt_response; /* Set to 'False' to debug what happens when the NT response is omited */
|
||||
bool allow_lm_response;/* The LM_RESPONSE code is not very secure... */
|
||||
bool allow_lm_key; /* The LM_KEY code is not very secure... */
|
||||
|
||||
const char *user;
|
||||
|
@ -447,7 +447,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
|
||||
if (ntlmssp_state->use_nt_response) {
|
||||
flags |= CLI_CRED_NTLM_AUTH;
|
||||
}
|
||||
if (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)) {
|
||||
if (ntlmssp_state->allow_lm_response) {
|
||||
flags |= CLI_CRED_LANMAN_AUTH;
|
||||
}
|
||||
|
||||
@ -474,7 +474,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
|
||||
}
|
||||
|
||||
if ((ntlmssp_state->neg_flags & NTLMSSP_NEGOTIATE_LM_KEY)
|
||||
&& lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx) && lm_session_key.length == 16) {
|
||||
&& ntlmssp_state->allow_lm_key && lm_session_key.length == 16) {
|
||||
DATA_BLOB new_session_key = data_blob_talloc(mem_ctx, NULL, 16);
|
||||
if (lm_response.length == 24) {
|
||||
SMBsesskeygen_lm_sess_key(lm_session_key.data, lm_response.data,
|
||||
@ -582,7 +582,9 @@ NTSTATUS gensec_ntlmssp_client_start(struct gensec_security *gensec_security)
|
||||
|
||||
ntlmssp_state->use_nt_response = gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "send_nt_reponse", true);
|
||||
|
||||
ntlmssp_state->allow_lm_key = (lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx)
|
||||
ntlmssp_state->allow_lm_response = lpcfg_client_lanman_auth(gensec_security->settings->lp_ctx);
|
||||
|
||||
ntlmssp_state->allow_lm_key = (ntlmssp_state->allow_lm_response
|
||||
&& (gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "allow_lm_key", false)
|
||||
|| gensec_setting_bool(gensec_security->settings, "ntlmssp_client", "lm_key", false)));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user