Bug 1150033 - OpenSSL selects weak digest for (EC)DH kex signing in TLSv1.2
Summary: OpenSSL selects weak digest for (EC)DH kex signing in TLSv1.2
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: openssl
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Hubert Kario
Depends On:
Blocks: 1057566
TreeView+ depends on / blocked
Reported: 2014-10-07 09:53 UTC by Hubert Kario
Modified: 2016-06-14 09:41 UTC (History)
4 users (show)

Fixed In Version: openssl-1.0.1e-40.el7
Doc Type: Bug Fix
Doc Text:
No doc text needed
Clone Of: 1150032
Last Closed: 2015-03-05 11:04:28 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1150032 None None None Never
Red Hat Bugzilla 1155180 None None None Never
Red Hat Product Errata RHBA-2015:0478 normal SHIPPED_LIVE openssl bug fix and enhancement update 2015-03-05 15:44:08 UTC

Internal Links: 1150032 1155180

Description Hubert Kario 2014-10-07 09:53:25 UTC
Description of problem:
When connecting to a virtual, SNI defined host openssl selects SHA1 digest instead of SHA512, as it does for the default host.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. openssl req -x509 -newkey rsa:2048 -keyout localhost.key -out localhost.crt -subj /CN=localhost -nodes -batch
2. openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -subj /CN=server -nodes -batch
3. openssl s_server -key localhost.key -cert localhost.crt -key2 server.key -cert2 server.crt -servername server

In other console, using OpenSSL 1.0.2:
1. openssl s_client -connect localhost:4433 </dev/null 2>/dev/null| grep 'Peer signing digest'
2. openssl s_client -connect localhost:4433 -servername server </dev/null 2>/dev/null| grep 'Peer signing digest'

Actual results:
1. Peer signing digest: SHA512
2. Peer signing digest: SHA1

Expected results:
1. Peer signing digest: SHA512
2. Peer signing digest: SHA512

Additional info:
The same issue is present when defining virtual hosts using mod_ssl in apache httpd.

Comment 1 Tomas Mraz 2014-10-07 16:27:38 UTC
The problem is that the second SSL context that is used when the server receives the servername extension does not have full copy of settings from the main context. Namely the tls1_process_sigalgs() is not properly called for it.

It is fairly nontrivial to fix this but I'll try to report it upstream.

Comment 2 Hubert Kario 2014-10-08 17:15:59 UTC
Reported upstream:

Comment 4 Hubert Kario 2014-10-21 13:59:44 UTC
Second upstream bug:

Comment 9 errata-xmlrpc 2015-03-05 11:04:28 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.


Note You need to log in before you can comment on or make changes to this bug.