Use SHA256 instead of MD5 for file import in FIPS enabled environment#931
Use SHA256 instead of MD5 for file import in FIPS enabled environment#931shekhar-himanshu wants to merge 3 commits intoopenmainframeproject:masterfrom
Conversation
There was a problem hiding this comment.
I see a serious problem with that. The API parameter for GET /images and POST /images is called md5sum.
Maybe we should support a parameter named sha256sum as well?
Or use a generic checksum parameter (keeping undocumented md5sum for compatibility), and determine at run time which kind it is?
I did not check what happens at database level. Maybe ther's a md5sum field too in it...
Also, please add documentation to those sections:
https://cloudlib4zvm.readthedocs.io/en/latest/restapi.html#list-images
https://cloudlib4zvm.readthedocs.io/en/latest/restapi.html#create-image
Maybe updating the unit tests would also be nice, I am not sure.
| @@ -2902,7 +2902,7 @@ def _scheme2backend(self, scheme): | |||
| def _get_md5sum(self, fpath): | |||
There was a problem hiding this comment.
We should rename this function as it may return something else than MD5 sum.
| """Calculate the md5sum of the specific image file""" | ||
| try: | ||
| current_md5 = hashlib.md5() | ||
| current_md5 = zvmutils.get_hash_object() |
There was a problem hiding this comment.
We should also rename the current_md5 variable.
It has been observed that sdkserevr fails to deploy VM with below error if FIPS mode is enabled:
This is because
md5is not allowed in FIPS enabled environment. So, this Pull Request is to use SHA256 instead of MD5 if FIPS is enabled.