Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 932826 Details for
Bug 1062444
certificate generation uses deprecated SHA-1 hash algorithm for signing
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to use SHA-2 hashes
0001-keyutil-genkey-use-SHA-2-hashes-by-default-for-certs.patch (text/plain), 3.84 KB, created by
Adam Williamson
on 2014-08-29 23:15:21 UTC
(
hide
)
Description:
patch to use SHA-2 hashes
Filename:
MIME Type:
Creator:
Adam Williamson
Created:
2014-08-29 23:15:21 UTC
Size:
3.84 KB
patch
obsolete
>From e810421866d7de22647470c347d2070b5cbfcd31 Mon Sep 17 00:00:00 2001 >From: Adam Williamson <awilliam@redhat.com> >Date: Fri, 29 Aug 2014 14:58:39 -0700 >Subject: [PATCH] - keyutil, genkey: use SHA-2 hashes by default for certs > (#1062444) > >Per http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf >SHA-1 should not be used for newly-generated certificates after 2013. This >makes both certificate generation paths (NSS-native and OpenSSL-compatible) >use SHA-256 by default. > >It also makes both paths use SHA-384 or SHA-512 for very long keys. It >doesn't make sense to use a hash algorithm that provides less security >than the public key, so when using a key longer than 3072 bits (which is >considered to provide approximately 128 bits of security) we should move >up from SHA-256 (which provides 128 bits of security), and when using a >key longer than 7680 bits (which is considered to provide approximately >192 bits of security) we should move up from SHA-384. NIST reference for >the RSA key size strengths: >http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57_part1_rev3_general.pdf >--- > crypto-utils.spec | 5 ++++- > genkey.pl | 10 ++++++++++ > keyutil.c | 17 ++++++++++++++++- > 3 files changed, 30 insertions(+), 2 deletions(-) > >diff --git a/crypto-utils.spec b/crypto-utils.spec >index 1a8660e..b30935f 100644 >--- a/crypto-utils.spec >+++ b/crypto-utils.spec >@@ -4,7 +4,7 @@ > Summary: SSL certificate and key management utilities > Name: crypto-utils > Version: 2.4.1 >-Release: 55%{?dist} >+Release: 56%{?dist} > Group: Applications/System > # certwatch.c is GPLv2 > # pemutil.c etc are (MPLv1.1+ or GPLv2+ or LPGLv2+) >@@ -135,6 +135,9 @@ chmod -R u+w $RPM_BUILD_ROOT > %{perl_vendorarch}/auto/Crypt > > %changelog >+* Fri Aug 29 2014 Adam Williamson <awilliam@redhat.com> - 2.4.1-55.1 >+- keyutil, genkey: use SHA-2 hashes by default for certs (#1062444) >+ > * Wed Aug 27 2014 Jitka Plesnikova <jplesnik@redhat.com> - 2.4.1-55 > - Perl 5.20 rebuild > >diff --git a/genkey.pl b/genkey.pl >index 2f3b582..0f6b85a 100644 >--- a/genkey.pl >+++ b/genkey.pl >@@ -962,6 +962,15 @@ sub makeCertNSS > my $trustargs = $ca_mode ? "CT,," : "u,,"; > $trustargs = "\"" . $trustargs. "\""; > >+ # Hash algorithm choice: see http://www.keylength.com/en/4/ and >+ # http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf >+ my $hashalg = "SHA256"; >+ if ($bits > 7680) { >+ $hashalg = "SHA512"; >+ } elsif ($bits > 3072) { >+ $hashalg = "SHA384"; >+ } >+ > my $args = "-S "; > $args .= "-n $nickname "; > $args .= "-s $subject "; >@@ -976,6 +985,7 @@ sub makeCertNSS > $args .= "-d $modNssDbDir "; > $args .= "-p $nssDBPrefix " if $nssDBPrefix; > $args .= "-o $certfile " if $certfile; >+ $args .= "-Z $hashalg "; > > nssUtilCmd("$bindir/certutil", $args); > >diff --git a/keyutil.c b/keyutil.c >index eeb2019..80f33c3 100644 >--- a/keyutil.c >+++ b/keyutil.c >@@ -1522,7 +1522,22 @@ static int keyutil_main( > keyutil_extns[ext_policyConstr] = PR_FALSE; > keyutil_extns[ext_inhibitAnyPolicy] = PR_FALSE; > >- hashAlgTag = SEC_OID_SHA1; >+ /* >+ * Hash algorithm should be at least SHA-256 after 2013: >+ * http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf >+ * Per http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57_part1_rev3_general.pdf >+ * a 3072-bit key provides 128 bits of security and a 7680-bit key provides >+ * 192 bits of security, so when producing certificates that use keys >+ * longer than those lengths, we should use a correspondingly stronger >+ * hash algorithm >+ */ >+ if (keysize > 7680) { >+ hashAlgTag = SEC_OID_SHA512; >+ } else if (keysize > 3072) { >+ hashAlgTag = SEC_OID_SHA384; >+ } else { >+ hashAlgTag = SEC_OID_SHA256; >+ } > > /* Make a cert request */ > rv = CertReq(privkey, pubkey, rsaKey, hashAlgTag, subject, >-- >2.1.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1062444
:
932826
|
932828