glance_store/glance_store/tests/unit
Ade Lee a34419aecd Replace md5 with oslo version
md5 is not an approved algorithm in FIPS mode, and trying to
instantiate a hashlib.md5() will fail when the system is running in
FIPS mode.

md5 is allowed when in a non-security context.  There is a plan to
add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate
whether or not the instance is being used in a security context.

In the case where it is not, the instantiation of md5 will be allowed.
See https://bugs.python.org/issue9216 for more details.

Some downstream python versions already support this parameter.  To
support these versions, a new encapsulation of md5() has been added to
oslo_utils.  See https://review.opendev.org/#/c/750031/

This patch is to replace the instances of hashlib.md5() with this new
encapsulation, adding an annotation indicating whether the usage is
a security context or not.

It looks like the uses of the md5 are primarily for checksums and
generation of etags.

With this patch, all the unit and functional tests appear to pass
on a FIPS enabled system.

Change-Id: I0603ba217d6dc19f5c9f73c60c7b365efd28d30b
Depends-On: https://review.opendev.org/#/c/760160
2020-11-11 13:40:46 -05:00
..
common Fix mock import in unit tests 2020-07-02 15:08:19 -05:00
__init__.py Move glance_store tests into the main package 2015-06-12 15:15:10 +00:00
test_backend.py Use unittest.mock instead of third party mock 2020-04-18 11:52:47 -05:00
test_cinder_store.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_connection_manager.py Use unittest.mock instead of third party mock 2020-04-18 11:52:47 -05:00
test_driver.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_exceptions.py Improving GlanceStoreException 2015-10-06 15:34:34 +00:00
test_filesystem_store.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_http_store.py Use unittest.mock instead of third party mock 2020-04-18 11:52:47 -05:00
test_location.py use only exceptions for uri validations 2018-06-07 14:11:02 +00:00
test_multistore_cinder.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_multistore_filesystem.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_multistore_rbd.py Fix: API returns 503 if one of the store is mis-configured 2020-04-27 06:47:30 +00:00
test_multistore_s3.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_multistore_vmware.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_opts.py Handle sparse images in glance_store 2020-08-21 07:02:43 -07:00
test_rbd_store.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_s3_store.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_store_base.py Use unittest.mock instead of third party mock 2020-04-18 11:52:47 -05:00
test_store_capabilities.py Move glance_store tests into the main package 2015-06-12 15:15:10 +00:00
test_swift_store.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_swift_store_multibackend.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00
test_swift_store_utils.py Restore quotes removal for swift config in Python3 2020-01-28 18:11:03 -06:00
test_test_utils.py Bring FakeData utility over from glance 2020-08-26 07:38:55 -07:00
test_vmware_store.py Replace md5 with oslo version 2020-11-11 13:40:46 -05:00