Bug 1084080 - certtool generates encrypted pkcs8 when empty password is specified
Summary: certtool generates encrypted pkcs8 when empty password is specified
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gnutls
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Nikos Mavrogiannopoulos
QA Contact: Jiri Jaburek
URL:
Whiteboard:
Depends On:
Blocks: 1094654
TreeView+ depends on / blocked
 
Reported: 2014-04-03 14:50 UTC by Jiri Jaburek
Modified: 2019-07-11 07:55 UTC (History)
4 users (show)

Fixed In Version: gnutls-3.3.8-1.el7
Doc Type: Bug Fix
Doc Text:
Previously when certtool generated a PKCS #8 format private key with no password, an encrypted structure was generated with an empty password. This has been fixed and with this update unencrypted PKCS #8 format private keys will be generated.
Clone Of:
Environment:
Last Closed: 2015-03-05 07:06:15 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0315 normal SHIPPED_LIVE gnutls bug fix and enhancement update 2015-03-05 11:58:04 UTC

Description Jiri Jaburek 2014-04-03 14:50:51 UTC
Description of problem:

on rhel-6, gnutls-2.8.5-13.el6_5 correctly generates nonencrypted key:

$ certtool --generate-privkey --pkcs8 --outfile pkcs8.key
Generating a 2048 bit RSA private key...
Enter password: 
Confirm password: 
$ head -n1 pkcs8.key
-----BEGIN PRIVATE KEY-----
$ openssl pkcs8 -nocrypt -in pkcs8.key
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDE6WwcTPk3Qpex
<snip>
-----END PRIVATE KEY-----

on rhel-7, gnutls-3.1.18-8.el7 doesn't want confirmation and generates an encrypted key:

$ certtool --generate-privkey --pkcs8 --outfile pkcs8.key
Generating a 2432 bit RSA private key...
Enter password: 
$ head -n1 pkcs8.key
-----BEGIN ENCRYPTED PRIVATE KEY-----
$ openssl pkcs8 -nocrypt -in pkcs8.key
Error decrypting key
140405575759776:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: PRIVATE KEY


Version-Release number of selected component (if applicable):
gnutls-3.1.18-8.el7

How reproducible:
always

Actual results:
certtool generates encrypted key when empty password is used

Expected results:
certtool generates non-encrypted key when empty password is used


Additional info:

While the --password option doesn't seem to be working on rhel-6 in this case, it works on rhel-7 and can be used as a workaround:

$ certtool --generate-privkey --pkcs8 --password "" --outfile pkcs8.key
Generating a 2432 bit RSA private key...
$ head -n1 pkcs8.key
-----BEGIN PRIVATE KEY-----
$ openssl pkcs8 -nocrypt -in pkcs8.key
-----BEGIN PRIVATE KEY-----
MIIFlQIBADANBgkqhkiG9w0BAQEFAASCBX8wggV7AgEAAoIBMQDAqgZqgS495A/Q
<snip>
-----END PRIVATE KEY-----

Comment 2 RHEL Program Management 2014-04-11 05:47:36 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Nikos Mavrogiannopoulos 2014-05-27 09:22:54 UTC
It is indeed an issue and there is a fix upstream already that can be backported.

Comment 16 errata-xmlrpc 2015-03-05 07:06:15 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://rhn.redhat.com/errata/RHBA-2015-0315.html


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