diff options
author | Stefan Metzmacher <metze@samba.org> | 2015-12-18 08:29:50 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2016-03-29 14:52:37 +0200 |
commit | 01acb212bbbbd9e34b41004bc3ca2c11af908e44 (patch) | |
tree | cc36ed951d1f9d845369356f5049ef4c667b3443 /source4/libcli | |
parent | 76b18260a3633085e7eccd95c1d52a4f25fb0071 (diff) | |
download | samba-01acb212bbbbd9e34b41004bc3ca2c11af908e44.tar.gz |
CVE-2016-2112: s4:libcli/ldap: make sure we detect downgrade attacks
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>
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ldap/ldap_bind.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c index db8de4e0ed4..79478e775d8 100644 --- a/source4/libcli/ldap/ldap_bind.c +++ b/source4/libcli/ldap/ldap_bind.c @@ -495,6 +495,20 @@ try_logon_again: conn->bind.type = LDAP_BIND_SASL; conn->bind.creds = creds; + if (wrap_flags & ADS_AUTH_SASL_SEAL) { + if (!gensec_have_feature(conn->gensec, GENSEC_FEATURE_SIGN)) { + return NT_STATUS_INVALID_NETWORK_RESPONSE; + } + + if (!gensec_have_feature(conn->gensec, GENSEC_FEATURE_SEAL)) { + return NT_STATUS_INVALID_NETWORK_RESPONSE; + } + } else if (wrap_flags & ADS_AUTH_SASL_SIGN) { + if (!gensec_have_feature(conn->gensec, GENSEC_FEATURE_SIGN)) { + return NT_STATUS_INVALID_NETWORK_RESPONSE; + } + } + if (!gensec_have_feature(conn->gensec, GENSEC_FEATURE_SIGN) && !gensec_have_feature(conn->gensec, GENSEC_FEATURE_SEAL)) { return NT_STATUS_OK; |