[oe-commits] [bitbake] 02/02: data/siggen: Switch md5 -> sha256
git at git.openembedded.org
git at git.openembedded.org
Thu Jan 3 22:47:51 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 9c351dbc2fc7cf0fdf43a4c5438972e04111e486
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Dec 17 14:53:06 2018 +0000
data/siggen: Switch md5 -> sha256
Similarly to the codeparser change, change to sha256 hashes due to worries
over collisions. The main impact of this change is slightly slower parsing
time as well as longer sstate file names.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/data.py | 2 +-
lib/bb/data_smart.py | 2 +-
lib/bb/siggen.py | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/bb/data.py b/lib/bb/data.py
index 6bcfcf4..29c2388 100644
--- a/lib/bb/data.py
+++ b/lib/bb/data.py
@@ -436,7 +436,7 @@ def generate_dependency_hash(tasklist, gendeps, lookupcache, whitelist, fn):
if var is not None:
data = data + str(var)
k = fn + "." + task
- basehash[k] = hashlib.md5(data.encode("utf-8")).hexdigest()
+ basehash[k] = hashlib.sha256(data.encode("utf-8")).hexdigest()
taskdeps[task] = alldeps
return taskdeps, basehash
diff --git a/lib/bb/data_smart.py b/lib/bb/data_smart.py
index c342ada..1f45cd9 100644
--- a/lib/bb/data_smart.py
+++ b/lib/bb/data_smart.py
@@ -1074,4 +1074,4 @@ class DataSmart(MutableMapping):
data.update({i:value})
data_str = str([(k, data[k]) for k in sorted(data.keys())])
- return hashlib.md5(data_str.encode("utf-8")).hexdigest()
+ return hashlib.sha256(data_str.encode("utf-8")).hexdigest()
diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 5508523..66aea79 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -216,7 +216,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
self.taints[k] = taint
logger.warning("%s is tainted from a forced run" % k)
- h = hashlib.md5(data.encode("utf-8")).hexdigest()
+ h = hashlib.sha256(data.encode("utf-8")).hexdigest()
self.taskhash[k] = h
#d.setVar("BB_TASKHASH_task-%s" % task, taskhash[task])
return h
@@ -650,7 +650,7 @@ def calc_basehash(sigdata):
if val is not None:
basedata = basedata + str(val)
- return hashlib.md5(basedata.encode("utf-8")).hexdigest()
+ return hashlib.sha256(basedata.encode("utf-8")).hexdigest()
def calc_taskhash(sigdata):
data = sigdata['basehash']
@@ -668,7 +668,7 @@ def calc_taskhash(sigdata):
else:
data = data + sigdata['taint']
- return hashlib.md5(data.encode("utf-8")).hexdigest()
+ return hashlib.sha256(data.encode("utf-8")).hexdigest()
def dump_sigfile(a):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list