diff options
author | Stefan Metzmacher <metze@samba.org> | 2016-10-27 10:40:28 +0200 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2021-11-08 10:46:45 +0100 |
commit | 279f057f23ddff2a3d43eacccb041d55a3208544 (patch) | |
tree | ceba22386fc3842f65e77a69f97f519b122cdafd | |
parent | d1cf8259c52bdef83ed8db19ea0698341ae94468 (diff) | |
download | samba-279f057f23ddff2a3d43eacccb041d55a3208544.tar.gz |
CVE-2016-2124: s3:libsmb: don't fallback to non spnego authentication if we require kerberos
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>
-rw-r--r-- | source3/libsmb/cliconnect.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 853fb344bcd..c01846ac811 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1442,6 +1442,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, @@ -1483,6 +1485,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 |