Bug 1062777

Summary: [RFE] automatically choose signature hash strength according to key size when generating certificates
Product: [Fedora] Fedora Reporter: Peter Backes <rtc>
Component: opensslAssignee: Tomas Mraz <tmraz>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: hkario, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-10 11:02: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 Peter Backes 2014-02-08 00:03:37 UTC
Description of problem:
openssl currently employs SHA256 for signing certificates by default. For larger key sizes, it would be better to choose a stronger hash algorithm  instead, as long as the user doesn't request some specific algorithm. See "Recommendation for Key Management," NIST Special Publication 800-57 Part 1 Rev. 3, 07/2012:

By default, unless the user requests otherwise,
use SHA-256 for RSA bits <= 3072
use SHA-384 for 3072 < RSA bits <= 7680
use SHA-512 for 7680 < RSA bits

See also bug 1062444 and bug 1062325.

Version-Release number of selected component (if applicable):
openssl-1.0.1e-39.fc21.i686

How reproducible:
always

Steps to Reproduce:
1. cd /etc/pki/tls/certs
2. make KEYLEN=7680 test.pem
3. openssl x509 -in test.pem -text | grep Signature

Actual results:
    Signature Algorithm: sha256WithRSAEncryption

Expected results:
    Signature Algorithm: sha384WithRSAEncryption

Comment 1 Tomas Mraz 2017-01-10 11:02:32 UTC
This is request for a new upstream feature and it would be best handled within OpenSSL upstream. Please report it to OpenSSL project in:
https://github.com/openssl/openssl/issues