Bug 1702454

Summary: [RHEL 7.6] Enabling FIPS mode breaks python-novaclient
Product: Red Hat OpenStack Reporter: Alberto Rivera Laporte <ariveral>
Component: python-novaclientAssignee: Artom Lifshitz <alifshit>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 14.0 (Rocky)CC: ariveral, dasmith, jhakimra, kchamart, mbooth, sbauza, sgordon, vromanso
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-novaclient-11.0.0-0.20180809174650.f1005ce.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-06 16:51:22 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:
Embargoed:

Description Alberto Rivera Laporte 2019-04-23 19:56:02 UTC
Description of problem:  


When the host has FIPS enabled both the nova and cinder clients fail. This is reflected in the attached stack trace during a 'server list` operations as an example.  The similar issue is encountered during a 'volume list' [0]. 


Example of the failures:

----------
[root@openshift-jump-1 ~]# openstack server list
error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips

[root@openshift-jump-1 ~]# openstack volume list
error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips
----------


Host Details:

----------
[cloud-user@openshift-jump-1 openstack]$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.6 (Maipo)


[cloud-user@openshift-jump-1 openstack]$ sysctl crypto.fips_enabled
crypto.fips_enabled = 1

[cloud-user@openshift-jump-1 openstack]$ cat /proc/sys/crypto/fips_enabled 

1


Packages: 

python2-cinderclient-4.0.1-0.20180809133302.460229c.el7ost.noarch
python2-novaclient-11.0.0-0.20180809174649.f1005ce.el7ost.noarch


----------


This appears to be the result in one of the functions under the completion_cache in the {nova,cinder}client/base.py:314 file [1] which uses md5 hashing function and fails as a result of md5 not an approved hashing function under the FIPS [2]. This is reproducible 100% of the time on a FIPS enabled host. 



[0]
----------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 135, in run
    ret_val = super(OpenStackShell, self).run(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 281, in run
    result = self.run_subcommand(remainder)
  File "/usr/lib/python2.7/site-packages/osc_lib/shell.py", line 175, in run_subcommand
    ret_value = super(OpenStackShell, self).run_subcommand(argv)
  File "/usr/lib/python2.7/site-packages/cliff/app.py", line 402, in run_subcommand
    result = cmd.run(parsed_args)
  File "/usr/lib/python2.7/site-packages/osc_lib/command/command.py", line 41, in run
    return super(Command, self).run(parsed_args)
  File "/usr/lib/python2.7/site-packages/cliff/display.py", line 116, in run
    column_names, data = self.take_action(parsed_args)
  File "/usr/lib/python2.7/site-packages/openstackclient/compute/v2/server.py", line 1266, in take_action
    limit=parsed_args.limit)
  File "/usr/lib/python2.7/site-packages/novaclient/v2/servers.py", line 858, in list
    "servers")
  File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 271, in _list
    with self.completion_cache('human_id', obj_class, mode="w"):
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 314, in completion_cache
    url.encode('utf-8')).hexdigest()
ValueError: error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips

END return value: 1
----------



[1]
----------
File: /usr/lib/python2.7/site-packages/novaclient/base.py
----------
---
313             uniqifier = hashlib.md5(username.encode('utf-8') +
314                                     url.encode('utf-8')).hexdigest()
---



[2]
https://csrc.nist.gov/projects/hash-functions

Comment 5 errata-xmlrpc 2019-11-06 16:51:22 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://access.redhat.com/errata/RHBA-2019:3746