Red Hat Bugzilla – Bug 1059682
Default cipher ordering doesn't include ECDSA ciphers and doesn't follow current best practice
Last modified: 2016-05-10 17:08:25 EDT
Description of problem: When curl connects to server using ECDSA certificate, the connection is refused with "no shared ciphers" SSL error. Version-Release number of selected component (if applicable): nss-3.15.1-15.el6.x86_64 curl-7.19.7-37.el6_4.x86_64 How reproducible: Always Steps to Reproduce: 1. Setup ftps or https server with ECDSA certificates 2. Try to download a file from it using `curl' Actual results: Connection refused, no shared cipher. * About to connect() to localhost port 21 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 21 (#0) < 220 (vsFTPd 2.2.2) > AUTH SSL < 234 Proceed with negotiation. * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/CA/certs/ca_cert.pem CApath: none * NSS error -12286 * Error in TLS handshake, trying SSLv3... > USER anonymous < 500 OOPS: error:1408A0C1:SSL routines:SSL3_GET_CLIENT_HELLO:no shared cipher * Access denied: 500 * Closing connection #0 curl: (67) Access denied: 500 Expected results: File downloaded, certificate verified successfully. Additional info: Looking at ClientHello sent by curl, the only ciphers advertised are: Cipher Suite: TLS_EMPTY_RENEGOTIATION_INFO_SCSV (0x00ff) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA (0x0039) Cipher Suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 (0x006b) Cipher Suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA (0x0038) Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035) Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA256 (0x003d) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA (0x0033) Cipher Suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 (0x0067) Cipher Suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA (0x0032) Cipher Suite: TLS_RSA_WITH_RC4_128_SHA (0x0005) Cipher Suite: TLS_RSA_WITH_RC4_128_MD5 (0x0004) Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f) Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256 (0x003c) Cipher Suite: TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA (0x0016) Cipher Suite: TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA (0x0013) Cipher Suite: TLS_RSA_WITH_3DES_EDE_CBC_SHA (0x000a) All ECDHE and ECDSA suites are missing. I'm not sure if advertising support for GCM and SHA-2 suites is correct if client also doesn't advertise TLSv1.2, I don't think it is. SHA-2 ciphers are placed after their SHA-1 versions, suites that provide PFS are placed before suites that don't support it. RC4 ciphers are not placed last. The cipher ordering should match ordering from Firefox 27 (with rationale available here https://briansmith.org/browser-ciphersuites-01.html)
To be clear, what hubert is asking for is a change in what NSS enables by default. NOTE: Brian smith's list is two things: 1) what the default cipher order is for NSS. 2) what the default ciphers are that mozilla enables. The default cipher order should happen upstream (If firefox has a new order, then a new upstream version of NSS will have that order). The default cipher list is something we can handle either upstream or in redhat (that would be a relatively small patch. I support Huberts call to make this change, but we should get a comment from RHEL 6 release management. It means a semantic change in RHEL 6 (apps would suddenly start using new ciphers they didn't previously use). We aren't turning any ciphers off, so I think this should be OK.
This bug subject 'Default cipher ordering doesn't include ECDSA ciphers and doesn't follow current best practice' has to two parts: 1) Enabling the ECDSA ciphers by default - No problem here. 2) Following current best practice - Problematic and it requires a reordering such as was done upstream and what we did for rhel-7. At first I thought it would be would be a subset of what we did in rhel-7. The problem is that reordering would case a regression on Bug 1159926 where we had to introduce a patch to revert the changes done upstream and keep the table with same order of cipher suites as in nss-3.15.5-3.
Created attachment 1115485 [details] Enable ECDSA ciphers by the default Backport to nss-3.19.1 of what I comitted upstream for nss-3.21.
Created attachment 1115486 [details] Enable ECDSA ciphers with 3DES by the default This part was not suitable upstream abut we included as a local patch in fedora. The second change is RSA and maybe dropped given that this request is for ECDSA.
Created attachment 1115487 [details] Changes to nss.spec - in patch format Assuming we only have the two patches for enabling which don't do reordering.
(In reply to Elio Maldonado Batiz from comment #4) >> is that reordering would case a regression on Bug 1159926 where we had to Correction: The bug in question is actually Bug 1123092
Comment on attachment 1115485 [details] Enable ECDSA ciphers by the default Patch no longer needed because we rebased to nss-3.21.0 which has these ciphers enabled by default.
Comment on attachment 1115487 [details] Changes to nss.spec - in patch format Mot needed, the spec file changed with the rebase to NSS 3.21.
Created attachment 1135043 [details] ssl differences beetween rhel-6.7.z and rhel-6.8 - in patch format The lib/ssl differences beetween rhel-6.7.z and rhel-6.8 after all patches have been applied.
OK, we only need to turn off AES GCM 128 by default then.
Comment on attachment 1115486 [details] Enable ECDSA ciphers with 3DES by the default r+
Comment on attachment 1135043 [details] ssl differences beetween rhel-6.7.z and rhel-6.8 - in patch format based on the regression, let's turn AES_GCM_128 off by default in 6.8. The rest of the patch is fine.
Created attachment 1135069 [details] disables AES_GCM_128 ciphers by default as suggested in Comment 19
Problem is, that to fix bug 1123092, we would have to disable also TLS_RSA_WITH_AES_128_GCM_SHA256, which was enabled quite far back.
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://rhn.redhat.com/errata/RHBA-2016-0820.html