Red Hat Bugzilla – Bug 1084080
certtool generates encrypted pkcs8 when empty password is specified
Last modified: 2015-03-05 02:06:15 EST
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-----
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.
It is indeed an issue and there is a fix upstream already that can be backported.
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