Skip to contentSkip to conversation

fetch2: Limit shown checksums to sha256

PATCH In review Richard Purdie 2 participants 3 messages Feb 29, 2020 – Mar 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch2: Limit shown checksums to sha256

Currently bitbake will list many checksums for a recipe when none are present, encouraging users to add them all to a recipe. We don't need/want them all.

We used to show md5 and sha256 but given the concerns about md5, switch to showing just sha256 going forward which seems like the sensible one to standardise upon.

There will be no change to existing recipe functionality.

---
 lib/bb/fetch2/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/fetch2/__init__.py +4 -1
index b83347ad90..9734e21126 100644
@@ -34,6 +34,7 @@ _checksum_cache = bb.checksum.FileChecksumCache()
 logger = logging.getLogger("BitBake.Fetcher")
 
 CHECKSUM_LIST = [ "md5", "sha256", "sha1", "sha384", "sha512" ]
+SHOWN_CHECKSUM_LIST = ["sha256"]
 
 class BBFetchException(Exception):
     """Class all fetch exceptions inherit from"""
@@ -580,7 +581,9 @@ def verify_checksum(ud, d, precomputed={}):
     checksum_dict = {ci["id"] : ci["data"] for ci in checksum_infos}
     checksum_event = {"%ssum" % ci["id"] : ci["data"] for ci in checksum_infos}
 
-    checksum_lines = ["SRC_URI[%s] = \"%s\"" % (ci["name"], ci["data"]) for ci in checksum_infos]
+    for ci in checksum_infos:
+        if ci["id"] in SHOWN_CHECKSUM_LIST:
+            checksum_lines = ["SRC_URI[%s] = \"%s\"" % (ci["name"], ci["data"])]
 
     # If no checksum has been provided
     if ud.method.recommends_checksum(ud) and all(ci["expected"] is None for ci in checksum_infos):
Signature · 1 line
2.25.0
#1 lore raw
Quoted 7 lines · Richard Purdie

Currently bitbake will list many checksums for a recipe when none are present, encouraging users to add them all to a recipe. We don't need/want them all.

We used to show md5 and sha256 but given the concerns about md5, switch to showing just sha256 going forward which seems like the sensible one to standardise upon.

Should this be interpreted so that going forward, it's recommended to drop the md5 checksums from recipes when doing version upgrades?

Signature · 4 lines
Tanu

https://www.patreon.com/tanuk
https://liberapay.com/tanuk
#2 lore raw
Quoted 6 lines · Tanu Kaskinen
Quoted 5 lines · Richard Purdie

Currently bitbake will list many checksums for a recipe when none are
present, encouraging users to add them all to a recipe. We don't need/want them all.

Quoted 6 lines
Quoted 3 lines

We used to show md5 and sha256 but given the concerns about md5, switch to showing just sha256 going forward which seems like the sensible one to standardise upon.

Should this be interpreted so that going forward, it's recommended to drop the md5 checksums from recipes when doing version upgrades?

Yes, that is the intent/plan. We don't really need both and this usability fix is a good opportunity to rationalise what we're doing.

Cheers,

Richard