cameronmaske / celery-once

Celery Once allows you to prevent multiple execution and queuing of celery tasks.
https://pypi.python.org/pypi/celery_once/
BSD 2-Clause "Simplified" License
659 stars 91 forks source link

File backend hashlib.md5 not supported in FIPS mode #124

Open wonkybream opened 3 years ago

wonkybream commented 3 years ago

I have a quite specific environment and noticed one issue with it.

My environment is in OpenSSL FIPS 140-2 mode and using md5 is not supported.

Following line raises an error ValueError: [digital envelope routines: FIPS_DIGESTINIT] disabled for fips. https://github.com/cameronmaske/celery-once/blob/4f68b6b3c8503b9360179a246521b07315cdf577/celery_once/backends/file.py#L20

I'm suggesting to change that to hashlib.sha1() which is supported in even if FIPS mode is enabled in cryptographic library.

If proposed change is allowed I'm more than happy to do the pull request.

With best regards, Wonky