From 374c94838bf7e9de9fd94370563caa15a0138c47 Mon Sep 17 00:00:00 2001 From: Sagar Gonsalves Date: Tue, 21 Feb 2023 13:42:31 -0800 Subject: [PATCH 1/2] Set "usedforsecurity' to Flase for md5 checksum. There is no cryptographic use of md5 done. So setting usedforsecurity to False. Doing so will make this FIPS complaint. --- dateparser/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dateparser/conf.py b/dateparser/conf.py index 3a7c41f89..3343c5cd8 100644 --- a/dateparser/conf.py +++ b/dateparser/conf.py @@ -46,7 +46,7 @@ def get_key(cls, settings=None): return 'default' keys = sorted(['%s-%s' % (key, str(settings[key])) for key in settings]) - return hashlib.md5(''.join(keys).encode('utf-8')).hexdigest() + return hashlib.md5(''.join(keys).encode('utf-8'), usedforsecurity=Flase).hexdigest() @classmethod def _get_settings_from_pyfile(cls): From 56f8f286e1da02e4ac59d2d122f32bb23fd6ade0 Mon Sep 17 00:00:00 2001 From: Sagar Gonsalves Date: Tue, 21 Feb 2023 14:21:09 -0800 Subject: [PATCH 2/2] Fix typo --- dateparser/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dateparser/conf.py b/dateparser/conf.py index 3343c5cd8..53b8a192d 100644 --- a/dateparser/conf.py +++ b/dateparser/conf.py @@ -46,7 +46,7 @@ def get_key(cls, settings=None): return 'default' keys = sorted(['%s-%s' % (key, str(settings[key])) for key in settings]) - return hashlib.md5(''.join(keys).encode('utf-8'), usedforsecurity=Flase).hexdigest() + return hashlib.md5(''.join(keys).encode('utf-8'), usedforsecurity=False).hexdigest() @classmethod def _get_settings_from_pyfile(cls):