summaryrefslogtreecommitdiff
path: root/cinderclient
diff options
context:
space:
mode:
authorJoshua Cornutt <jcornutt@gmail.com>2018-11-05 18:53:02 -0500
committerEric Harney <eharney@redhat.com>2018-12-05 10:51:42 -0500
commit4cf62cf31f3fcc0d00ce4daa291be6003ab331ed (patch)
treef29ef6c95348878c6b933de70d10923328312c80 /cinderclient
parent7cb50b4c4a05494650da334de346345af0bfb953 (diff)
downloadpython-cinderclient-4cf62cf31f3fcc0d00ce4daa291be6003ab331ed.tar.gz
Change cache uniqifier from using md5 to sha-1
FIPS 140-2 does not allow MD5 use for most purposes and systems in "FIPS mode" (fips=1 kernel flag) will cause software using MD5 from popular libraries to fail. Also change the default cache dir to use ~/.cache/ Change-Id: I6f653f10249992196abb04e05c54df5fb244b182
Diffstat (limited to 'cinderclient')
-rw-r--r--cinderclient/base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cinderclient/base.py b/cinderclient/base.py
index 85dffb6..a6999ad 100644
--- a/cinderclient/base.py
+++ b/cinderclient/base.py
@@ -261,14 +261,14 @@ class Manager(common_base.HookableMixin):
often enough to keep the cache reasonably up-to-date.
"""
base_dir = utils.env('CINDERCLIENT_UUID_CACHE_DIR',
- default="~/.cinderclient")
+ default="~/.cache/cinderclient")
# NOTE(sirp): Keep separate UUID caches for each username + endpoint
# pair
username = utils.env('OS_USERNAME', 'CINDER_USERNAME')
url = utils.env('OS_URL', 'CINDER_URL')
- uniqifier = hashlib.md5(username.encode('utf-8') +
- url.encode('utf-8')).hexdigest()
+ uniqifier = hashlib.sha1(username.encode('utf-8') +
+ url.encode('utf-8')).hexdigest()
cache_dir = os.path.expanduser(os.path.join(base_dir, uniqifier))