Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1084080 - certtool generates encrypted pkcs8 when empty password is specified
certtool generates encrypted pkcs8 when empty password is specified
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: gnutls (Show other bugs)
7.0
All Linux
medium Severity medium
: rc
: ---
Assigned To: Nikos Mavrogiannopoulos
Jiri Jaburek
:
Depends On:
Blocks: 1094654
  Show dependency treegraph
 
Reported: 2014-04-03 10:50 EDT by Jiri Jaburek
Modified: 2015-03-05 02:06 EST (History)
4 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:06:15 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker 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 06:58:04 EST

  None (edit)
Description Jiri Jaburek 2014-04-03 10:50:51 EDT
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 Product and Program Management 2014-04-11 01:47:36 EDT
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 05:22:54 EDT
It is indeed an issue and there is a fix upstream already that can be backported.
Comment 16 errata-xmlrpc 2015-03-05 02:06:15 EST
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.