Bug 1432907

Summary: Cipher suite mismatch with latest nss
Product: Red Hat Enterprise Linux 7 Reporter: Patrik Kis <pkis>
Component: openldapAssignee: Matus Honek <mhonek>
Status: CLOSED ERRATA QA Contact: Patrik Kis <pkis>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: hkario, nkinder, pkis
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openldap-2.4.44-4.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 20:19:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Patrik Kis 2017-03-16 11:26:51 UTC
Description of problem:
Openldap does not ask for TLS_AES.*GCM cipher suites in client hello while the latest nss supports these suites.

Version-Release number of selected component (if applicable):
openldap-2.4.44-1.el7.x86_64
nss-3.28.3-3.el7.x86_64

How reproducible:
always

Steps to Reproduce:

openssl req -x509 -newkey rsa -keyout localhost.key -out localhost.crt -nodes -batch
tshark -i lo -f "port 4433"  -o 'ssl.desegment_ssl_records:TRUE' -V -d tcp.port==4433,ssl &>capture.txt &
openssl s_server -accept 4433 -key localhost.key -cert localhost.crt -www 2> /dev/null > /dev/null &
ldapsearch -d -1 -H ldaps://localhost:4433/

# kill the s_server and tshark and check the results


Actual results:
# grep TLS_AES.*GCM capture.txt 


Expected results:
# grep TLS_AES.*GCM capture.txt 
TLS_AES_128_GCM_SHA256
TLS_AES_256_GCM_SHA384


Additional info:

The latest nss-3.28.3-3.el7 supports these suites:

/usr/lib64/nss/unsupported-tools/listsuites |grep -v 'suites:' | sed ':a;/:$/{N;s/\\n//;ba}' | grep -v SSL2 |grep TLS_AES.*GCM
TLS_AES_128_GCM_SHA256:
TLS_AES_256_GCM_SHA384:

Comment 2 Patrik Kis 2017-03-16 11:31:57 UTC
One important step to the reproducer:

echo -e "TLS_CIPHER_SUITE ALL\n" > ~/.ldaprc

Comment 3 Patrik Kis 2017-03-16 14:32:43 UTC
Another issue discovered that was caused by updated nss is with the default cipher suites. The following suites are missing from client hello sent:

-TLS_AES_128_GCM_SHA256
-TLS_CHACHA20_POLY1305_SHA256
-TLS_AES_256_GCM_SHA384
-TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
-TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
-TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256


The reproducer is the same as above, just add 'TLS_CIPHER_SUITE DEFAULT' or nothing to ~/.ldaprc.

rm -f ~/.ldaprc
openssl req -x509 -newkey rsa -keyout localhost.key -out localhost.crt -nodes -batch
tshark -i lo -f "port 4433"  -o 'ssl.desegment_ssl_records:TRUE' -V -d tcp.port==4433,ssl &>capture.txt &
openssl s_server -accept 4433 -key localhost.key -cert localhost.crt -www 2> /dev/null > /dev/null &
ldapsearch -d -1 -H ldaps://localhost:4433/


grep -A 100 'Client Hello' capture.txt | grep -o 'TLS_\w*' > client_hello.suites

/usr/lib64/nss/unsupported-tools/listsuites | grep -v 'suites:' | sed ':a;/:$/{N;s/\n//;ba}' | grep Enabled | grep -o '^[^:]*' > default.suites


diff default.suites client_hello.suites 28,33d27
< TLS_AES_128_GCM_SHA256
< TLS_CHACHA20_POLY1305_SHA256
< TLS_AES_256_GCM_SHA384
< TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
< TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
< TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256

Comment 5 Alicja Kario 2017-03-17 10:46:46 UTC
(In reply to Patrik Kis from comment #3)
> Another issue discovered that was caused by updated nss is with the default
> cipher suites. The following suites are missing from client hello sent:
> 
> -TLS_AES_128_GCM_SHA256
> -TLS_CHACHA20_POLY1305_SHA256
> -TLS_AES_256_GCM_SHA384

Those are expected to be missing: those are TLSv1.3 cipihersuites and we are not enabling TLSv1.3 in NSS in RHEL just yet - tlsv1.3 is not yet finished.

> -TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
> -TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
> -TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256

Note that openldap will need sff rating for those ciphers - those are 256 bit ciphers.

Comment 19 errata-xmlrpc 2017-08-01 20:19:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:1852