summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-17 14:53:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-08 11:16:03 +0000
commitf008c24dab14fcea7d0ff1c650255c8ea7126d43 (patch)
tree2bcbc39c4008a2679aff630ec20c94873821d869 /bitbake/lib
parent941c5ddd191993fe18aba5796e397f6244fa80eb (diff)
downloadpoky-f008c24dab14fcea7d0ff1c650255c8ea7126d43.tar.gz
bitbake: 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. (Bitbake rev: 66f1b766997d53b4375fdd25719b1175f3828903) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/data.py2
-rw-r--r--bitbake/lib/bb/data_smart.py2
-rw-r--r--bitbake/lib/bb/siggen.py6
3 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py
index 6bcfcf46cc..29c2388038 100644
--- a/bitbake/lib/bb/data.py
+++ b/bitbake/lib/bb/data.py
@@ -436,7 +436,7 @@ def generate_dependency_hash(tasklist, gendeps, lookupcache, whitelist, fn):
436 if var is not None: 436 if var is not None:
437 data = data + str(var) 437 data = data + str(var)
438 k = fn + "." + task 438 k = fn + "." + task
439 basehash[k] = hashlib.md5(data.encode("utf-8")).hexdigest() 439 basehash[k] = hashlib.sha256(data.encode("utf-8")).hexdigest()
440 taskdeps[task] = alldeps 440 taskdeps[task] = alldeps
441 441
442 return taskdeps, basehash 442 return taskdeps, basehash
diff --git a/bitbake/lib/bb/data_smart.py b/bitbake/lib/bb/data_smart.py
index c342adaa0a..1f45cd975d 100644
--- a/bitbake/lib/bb/data_smart.py
+++ b/bitbake/lib/bb/data_smart.py
@@ -1074,4 +1074,4 @@ class DataSmart(MutableMapping):
1074 data.update({i:value}) 1074 data.update({i:value})
1075 1075
1076 data_str = str([(k, data[k]) for k in sorted(data.keys())]) 1076 data_str = str([(k, data[k]) for k in sorted(data.keys())])
1077 return hashlib.md5(data_str.encode("utf-8")).hexdigest() 1077 return hashlib.sha256(data_str.encode("utf-8")).hexdigest()
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 5508523f2d..66aea79355 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -216,7 +216,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
216 self.taints[k] = taint 216 self.taints[k] = taint
217 logger.warning("%s is tainted from a forced run" % k) 217 logger.warning("%s is tainted from a forced run" % k)
218 218
219 h = hashlib.md5(data.encode("utf-8")).hexdigest() 219 h = hashlib.sha256(data.encode("utf-8")).hexdigest()
220 self.taskhash[k] = h 220 self.taskhash[k] = h
221 #d.setVar("BB_TASKHASH_task-%s" % task, taskhash[task]) 221 #d.setVar("BB_TASKHASH_task-%s" % task, taskhash[task])
222 return h 222 return h
@@ -650,7 +650,7 @@ def calc_basehash(sigdata):
650 if val is not None: 650 if val is not None:
651 basedata = basedata + str(val) 651 basedata = basedata + str(val)
652 652
653 return hashlib.md5(basedata.encode("utf-8")).hexdigest() 653 return hashlib.sha256(basedata.encode("utf-8")).hexdigest()
654 654
655def calc_taskhash(sigdata): 655def calc_taskhash(sigdata):
656 data = sigdata['basehash'] 656 data = sigdata['basehash']
@@ -668,7 +668,7 @@ def calc_taskhash(sigdata):
668 else: 668 else:
669 data = data + sigdata['taint'] 669 data = data + sigdata['taint']
670 670
671 return hashlib.md5(data.encode("utf-8")).hexdigest() 671 return hashlib.sha256(data.encode("utf-8")).hexdigest()
672 672
673 673
674def dump_sigfile(a): 674def dump_sigfile(a):