Skip to content

Commit 51badbc

Browse files
committed
Add 'usedforsecurity=False' parameter to md5 call
This allows to execute in a restricted environment, like a FIPS-enabled Kubernetes cluster. See https://docs.python.org/3/library/hashlib.html#hash-algorithms: > False indicates that the hashing algorithm is [used] as a > non-cryptographic one-way compression function.
1 parent e8a10b1 commit 51badbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kubernetes/base/dynamic/discovery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, client, cache_file):
4545
default_cache_id = self.client.configuration.host
4646
if six.PY3:
4747
default_cache_id = default_cache_id.encode('utf-8')
48-
default_cachefile_name = 'osrcp-{0}.json'.format(hashlib.md5(default_cache_id).hexdigest())
48+
default_cachefile_name = 'osrcp-{0}.json'.format(hashlib.md5(default_cache_id, usedforsecurity=False).hexdigest())
4949
self.__cache_file = cache_file or os.path.join(tempfile.gettempdir(), default_cachefile_name)
5050
self.__init_cache()
5151

0 commit comments

Comments
 (0)