]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2016-2124: s3:libsmb: don't fallback to non spnego authentication if we require...
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Oct 2016 08:40:28 +0000 (10:40 +0200)
committerJule Anger <janger@samba.org>
Tue, 9 Nov 2021 19:45:34 +0000 (19:45 +0000)
We should not send NTLM[v2] nor plaintext data on the wire if the user
asked for kerberos only.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12444

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/libsmb/cliconnect.c

index 63c505f8ed5e6bea5012762ba26d2e54dc0856b9..d894ef76a36bb3907d9b91001088150723e046cf 100644 (file)
@@ -1450,6 +1450,8 @@ struct tevent_req *cli_session_setup_creds_send(TALLOC_CTX *mem_ctx,
        uint32_t in_sess_key = 0;
        const char *in_native_os = NULL;
        const char *in_native_lm = NULL;
+       enum credentials_use_kerberos krb5_state =
+               cli_credentials_get_kerberos_state(creds);
        NTSTATUS status;
 
        req = tevent_req_create(mem_ctx, &state,
@@ -1491,6 +1493,13 @@ struct tevent_req *cli_session_setup_creds_send(TALLOC_CTX *mem_ctx,
                return req;
        }
 
+       if (krb5_state == CRED_USE_KERBEROS_REQUIRED) {
+               DBG_WARNING("Kerberos authentication requested, but "
+                           "the server does not support SPNEGO authentication\n");
+               tevent_req_nterror(req, NT_STATUS_NETWORK_CREDENTIAL_CONFLICT);
+               return tevent_req_post(req, ev);
+       }
+
        if (smbXcli_conn_protocol(cli->conn) < PROTOCOL_LANMAN1) {
                /*
                 * SessionSetupAndX was introduced by LANMAN 1.0. So we skip