blob: 25e148ed0e41984dd67fdc93a7ff5c8b4072906a [file] [log] [blame]
Patrick Williamsddad1a12017-02-23 20:36:32 -06001openldap CVE-2015-3276
2
3the patch comes from:
4https://bugzilla.redhat.com/show_bug.cgi?id=1238322
5https://bugzilla.redhat.com/attachment.cgi?id=1055640
6
7The nss_parse_ciphers function in libraries/libldap/tls_m.c in
8OpenLDAP does not properly parse OpenSSL-style multi-keyword mode
9cipher strings, which might cause a weaker than intended cipher to
10be used and allow remote attackers to have unspecified impact via
11unknown vectors.
12
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013Upstream-Status: Pending
14
Patrick Williamsddad1a12017-02-23 20:36:32 -060015Signed-off-by: Li Wang <li.wang@windriver.com>
16---
17 libraries/libldap/tls_m.c | 27 ++++++++++++++++-----------
18 1 file changed, 16 insertions(+), 11 deletions(-)
19
20diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
21index 9b101f9..e6f3051 100644
22--- a/libraries/libldap/tls_m.c
23+++ b/libraries/libldap/tls_m.c
24@@ -621,18 +621,23 @@ nss_parse_ciphers(const char *cipherstr, int cipher_list[ciphernum])
25 */
26 if (mask || strength || protocol) {
27 for (i=0; i<ciphernum; i++) {
28- if (((ciphers_def[i].attr & mask) ||
29- (ciphers_def[i].strength & strength) ||
30- (ciphers_def[i].version & protocol)) &&
31- (cipher_list[i] != -1)) {
32- /* Enable the NULL ciphers only if explicity
33- * requested */
34- if (ciphers_def[i].attr & SSL_eNULL) {
35- if (mask & SSL_eNULL)
36- cipher_list[i] = action;
37- } else
38+ /* if more than one mask is provided
39+ * then AND logic applies (to match openssl)
40+ */
41+ if ( cipher_list[i] == -1) )
42+ continue;
43+ if ( mask && ! (ciphers_def[i].attr & mask) )
44+ continue;
45+ if ( strength && ! (ciphers_def[i].strength & strength) )
46+ continue;
47+ if ( protocol && ! (ciphers_def[i].version & protocol) )
48+ continue;
49+ /* Enable the NULL ciphers only if explicity requested */
50+ if (ciphers_def[i].attr & SSL_eNULL) {
51+ if (mask & SSL_eNULL)
52 cipher_list[i] = action;
53- }
54+ } else
55+ cipher_list[i] = action;
56 }
57 } else {
58 for (i=0; i<ciphernum; i++) {
59--
601.7.9.5
61