-
Notifications
You must be signed in to change notification settings - Fork 56
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
Use usedforsecurity=False for md5() calls to make suds work on FIPS enabled systems #72
Conversation
1923912
to
56caa0a
Compare
(part of subscription-manager/virt-who team here) While this seems OK-ish, I wonder whether the |
I think you're right, but I dont see an issue in using it. |
suds/reader.py
Outdated
h = md5(name.encode()).hexdigest() | ||
try: | ||
h = md5(name.encode()).hexdigest() | ||
except ValueError: |
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.
Thanks - I'm wondering if this could have "false positives" of catching ValueError
s (and then trying the version with usedforsecurity
) when it shouldn't.
A few other options from looking at how others approach this:
- Flip the order and catch AttributeError, e.g.
try:
# FIPS requires usedforsecurity=False and might not be
# available on all distros: https://bugs.python.org/issue9216
h = md5(name.encode(), usedforsecurity=False).hexdigest()
except AttributeError:
h = md5(name.encode()).hexdigest()
- A compatibility method: git-cola/git-cola@5ae40d2#diff-a5804055429122cbb41a6b906aa928641e4d7fee27c79dbe7bb47c726eeaeb73R32
- Just checking for python version >= 3.9 https://github.com/pytest-dev/pytest-randomly/pull/415/files#diff-77e4b024fe5132833f7d62b9ffc8028a856311e1a3afbb81f5715efc2bea28b9R5
If this is available in earlier versions of python on RHEL, I can see how checking for python 3.9 doesn't make sense.
No strong opinions on this, but let me know what you think.
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.
That sounds like a better way to do it. I've pushed the update.
No description provided.