-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify MD5 is available #807
Conversation
On some systems, such as a FIPS enabled system, MD5 hashing is unavailable. This commit will detect when that is the case, avoiding it where possible and raising a better error otherwise.
have access to it for various reasons, such as FIPS mode being enabled. | ||
:return: True if md5 is available. False if not. | ||
""" | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to check this each time. It's either available on the system or not. I'd prefer to just move this to a constant in this module.
165abea
to
eca32b4
Compare
MD5_AVAILABLE = False | ||
|
||
|
||
def get_md5(raise_error_if_unavailable=True, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussing, we can remove the raise_error_if_unavailable
argument implemented for the CLI and update the CLI code to not compute MD5's if it's not possible.
Looks good, just had that small comment about removing |
Verify MD5 is available
On some systems, such as a FIPS enabled system, MD5 hashing is unavailable. This commit will detect when that is the case, avoiding it where possible and raising a better error otherwise.
cc @jamesls @rayluo @kyleknap