summaryrefslogtreecommitdiff
path: root/glanceclient/v2
diff options
context:
space:
mode:
authorBrian Rosmaita <rosmaita.fossdev@gmail.com>2020-04-07 00:13:49 -0400
committerBrian Rosmaita <rosmaita.fossdev@gmail.com>2020-05-04 08:56:58 -0400
commit56186d6d5aa1a0c8fde99eeb535a650b0495925d (patch)
treee94280deebebcc70ee69bd050466a42937d47a99 /glanceclient/v2
parentcf5434a1b886b152781a206815adff176d2e67fd (diff)
downloadpython-glanceclient-56186d6d5aa1a0c8fde99eeb535a650b0495925d.tar.gz
Fail gracefully when MD5 is unavailable
The glanceclient currently assumes that MD5 will always be available. This is not the case, however, in a FIPS-compliant environment. This patch enables the glanceclient to fail gracefully in such a case. Closes-bug: #1871675 Change-Id: Ibd89989e06cc5be7da71f5f21561d73b5abc4104
Diffstat (limited to 'glanceclient/v2')
-rw-r--r--glanceclient/v2/images.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/glanceclient/v2/images.py b/glanceclient/v2/images.py
index c062cb8..b07eecc 100644
--- a/glanceclient/v2/images.py
+++ b/glanceclient/v2/images.py
@@ -209,9 +209,11 @@ class Controller(object):
specified hash algorithm is not available AND allow_md5_fallback
is True, then continue to step #2
2. else if the image has a checksum property, MD5 is used to
- validate against the 'checksum' value
+ validate against the 'checksum' value. (If MD5 is not available
+ to the client, the download fails.)
3. else if the download response has a 'content-md5' header, MD5
- is used to validate against the header value
+ is used to validate against the header value. (If MD5 is not
+ available to the client, the download fails.)
4. if none of 1-3 obtain, the data is **not validated** (this is
compatible with legacy behavior)