-
Notifications
You must be signed in to change notification settings - Fork 481
Allow md5hash to function in fips environments #1267
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
base: master
Are you sure you want to change the base?
Conversation
I posted this in #1258 as well. Change |
Thanks for catching this wasn't looking closely when I copy-pasted haha. Will update now! |
@ghmj2417 are you able to approve and merge this, would love to get this added in! |
@Gallaecio can you give this a review and lmk if any changes are needed when you have the chance? |
Co-authored-by: Adrián Chaves <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1267 +/- ##
=======================================
Coverage 97.47% 97.47%
=======================================
Files 234 234
Lines 2775 2776 +1
=======================================
+ Hits 2705 2706 +1
Misses 70 70 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Please, install |
hashlib.new was to accommodate Python 3.8. If setup.py is going to require >= 3.9 then hashlib.md5 is fine. |
Many secure environments disable the
hashlib.md5
function because it is insecure, this causes the line below to fail making dateparser unusable in these environments:dateparser/dateparser/conf.py
Line 52 in 02bd2e5
This is remedied by replacing that line with
return hashlib.new("md5", "".join(keys).encode("utf-8"), usedforsecurity=False).hexdigest()
which appropriately bypasses the fips security check because dateparser is not using the md5 hash for security applications.Corresponding issue: #1258