Red Hat Bugzilla – Bug 812348
Unable to change ssh key password while in FIPS mode (fips=1)
Last modified: 2013-02-21 05:43:11 EST
Description of problem:
Version-Release number of selected component (if applicable):
Enable FIPS (fips=1 on kernel line), create an ssh key with a valid password, then attempt to change the password. This fails with 'Bad passphrase.'
Steps to Reproduce:
[root@dhcp209-46 ~]# cat /proc/sys/crypto/fips_enabled
[root@dhcp209-46 ~]# ssh-keygen -t rsa -f rsa -b 2048
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in rsa.
Your public key has been saved in rsa.pub.
The key SHA1 fingerprint is:
The key's SHA1 randomart image is:
+--[ RSA 2048]----+
| S . ++.|
| . . . +o=.|
| . oBo+|
| o+ %E|
root@dhcp209-46 ~]# ssh-keygen -p -f rsa
Enter old passphrase:
Should be able to change an ssh key password.
This seems to be problem with used key format in OpenSSL.
This request was evaluated by Red Hat Product Management for inclusion in the
current release of Red Hat Enterprise Linux. Because the affected component is
not scheduled to be updated in the current release, Red Hat is unfortunately
unable to address this request at this time. It has been proposed for the next
release. If you would like it considered as an exception in the current
release, please ask your support representative.
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 aes128 -out rsa
ssh-keygen -y -f rsa > rsa.pub
This creates a key in pkcs8 format even on rhel-6.
Of course changing the passphrase with ssh-keygen is not possible - the openssl pkcs8 command has to be used instead.
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.