Bug 812348

Summary: Unable to change ssh key password while in FIPS mode (fips=1)
Product: Red Hat Enterprise Linux 6 Reporter: Ricky Nelson <rnelson>
Component: opensslAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Miroslav Vadkerti <mvadkert>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.2CC: cww, jjaburek, ksrot, mvadkert, syeghiay, tmraz
Target Milestone: rcKeywords: Regression, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openssl-1.0.0-26.el6 Doc Type: Bug Fix
Doc Text:
This was already documented in the Z-stream errata.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 10:43:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 836160, 848406    

Description Ricky Nelson 2012-04-13 13:22:29 UTC
Description of problem:


Version-Release number of selected component (if applicable):
openssh-5.3p1-70.el6_2.2.x86_64

How reproducible:
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
1

[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:
f6:f5:cb:d1:ce:79:a0:9f:f4:ed:18:64:79:39:ac:7e:d2:c7:61:6f root.pnq.redhat.com
The key's SHA1 randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|              ...|
|        S   . ++.|
|       . . . +o=.|
|          .  oBo+|
|            o+ %E|
|             oO+O|
+-----------------+

root@dhcp209-46 ~]# ssh-keygen -p -f rsa
Enter old passphrase:
Bad passphrase.


Expected results:
Should be able to change an ssh key password.

Comment 5 Petr Lautrbach 2012-04-24 19:38:49 UTC
This seems to be problem with used key format in OpenSSL.

Comment 9 Suzanne Logcher 2012-04-25 17:46:27 UTC
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.

Comment 10 Tomas Mraz 2012-04-26 10:34:48 UTC
The workaround:

umask 077
openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 aes128 -out rsa
restorecon rsa
ssh-keygen -y -f rsa > rsa.pub

This creates a key in pkcs8 format even on rhel-6.

Comment 11 Tomas Mraz 2012-04-26 10:35:41 UTC
Of course changing the passphrase with ssh-keygen is not possible - the openssl pkcs8 command has to be used instead.

Comment 26 errata-xmlrpc 2013-02-21 10:43:11 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.

http://rhn.redhat.com/errata/RHBA-2013-0443.html