blob: ce8b47ae4e022ec00df67fa2ac1be3e1649e9703 [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
Brad Bishop34ae6002019-04-08 15:21:03 -040015CVE: CVE-2015-3276
16
Patrick Williamsddad1a12017-02-23 20:36:32 -060017Signed-off-by: Li Wang <li.wang@windriver.com>
18---
19 libraries/libldap/tls_m.c | 27 ++++++++++++++++-----------
20 1 file changed, 16 insertions(+), 11 deletions(-)
21
22diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
23index 9b101f9..e6f3051 100644
24--- a/libraries/libldap/tls_m.c
25+++ b/libraries/libldap/tls_m.c
26@@ -621,18 +621,23 @@ nss_parse_ciphers(const char *cipherstr, int cipher_list[ciphernum])
27 */
28 if (mask || strength || protocol) {
29 for (i=0; i<ciphernum; i++) {
30- if (((ciphers_def[i].attr & mask) ||
31- (ciphers_def[i].strength & strength) ||
32- (ciphers_def[i].version & protocol)) &&
33- (cipher_list[i] != -1)) {
34- /* Enable the NULL ciphers only if explicity
35- * requested */
36- if (ciphers_def[i].attr & SSL_eNULL) {
37- if (mask & SSL_eNULL)
38- cipher_list[i] = action;
39- } else
40+ /* if more than one mask is provided
41+ * then AND logic applies (to match openssl)
42+ */
43+ if ( cipher_list[i] == -1) )
44+ continue;
45+ if ( mask && ! (ciphers_def[i].attr & mask) )
46+ continue;
47+ if ( strength && ! (ciphers_def[i].strength & strength) )
48+ continue;
49+ if ( protocol && ! (ciphers_def[i].version & protocol) )
50+ continue;
51+ /* Enable the NULL ciphers only if explicity requested */
52+ if (ciphers_def[i].attr & SSL_eNULL) {
53+ if (mask & SSL_eNULL)
54 cipher_list[i] = action;
55- }
56+ } else
57+ cipher_list[i] = action;
58 }
59 } else {
60 for (i=0; i<ciphernum; i++) {
61--
621.7.9.5
63