Add sha256 in ceph fetch keys

fetch_ceph_keys.py is using insecure sha1 function, this patch adds
sha256 beside sha1 - in order to remove sha1 safely in U release.

Change-Id: I32ba1abd204c9dba4bbe3132b5650b0e391616af
Closes-Bug: #1826327
(cherry picked from commit 0a2dc8aa1d)
This commit is contained in:
Michal Nasiadka 2019-04-25 09:06:28 +02:00 committed by Mark Goddard
parent e735b0985e
commit ac8609c0f1
1 changed files with 2 additions and 0 deletions

View File

@ -49,8 +49,10 @@ def read_file(filename):
with open(filename_path, 'rb') as f:
raw_data = f.read()
# TODO(mnasiadka): Remove sha1 in U
return {'content': base64.b64encode(zlib.compress(raw_data)),
'sha1': hashlib.sha1(raw_data).hexdigest(),
'sha256': hashlib.sha256(raw_data).hexdigest(),
'filename': filename}