Skip to contentSkip to conversation

recipetool: pypi: do not clobber SRC_URI checksums

PATCH Superseded Tim Orling 2 participants 2 messages Dec 9, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

PATCH 1/1 recipetool: pypi: do not clobber SRC_URI checksums

The pypi change:
"85a2a6f68af recipetool: create_buildsys_python: add pypi support" deleted all the SRC_URI variables, including the SRC_URI checksums. These are not generated by the pypi.bbclass (how could they be trusted?)

Without the checksum(s), we are vulnerable to a man-in-the-middle attack and zero checks on the validity of the downloaded tarball from pypi.org.

Fix by only setting S and SRC_URI to None.

---
 scripts/lib/recipetool/create_buildsys_python.py | 5 -----
 1 file changed, 5 deletions(-)
scripts/lib/recipetool/create_buildsys_python.py +0 -5
index 5e07222ece1..66de36ba3e4 100644
@@ -172,11 +172,6 @@ class PythonRecipeHandler(RecipeHandler):
             # extravalues['SRC_URI(?:\[.*?\])?'] = None
             extravalues['S'] = None
             extravalues['SRC_URI'] = None
-            extravalues['SRC_URI[md5sum]'] = None
-            extravalues['SRC_URI[sha1sum]'] = None
-            extravalues['SRC_URI[sha256sum]'] = None
-            extravalues['SRC_URI[sha384sum]'] = None
-            extravalues['SRC_URI[sha512sum]'] = None
 
             classes.append('pypi')
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 27 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Tim Orling
Sent: den 9 december 2023 02:37
To: [email protected]
Cc: Tim Orling <[email protected]>
Subject: [OE-core] [PATCH] recipetool: pypi: do not clobber SRC_URI checksums

The pypi change:
"85a2a6f68af recipetool: create_buildsys_python: add pypi support" deleted all the SRC_URI variables, including the SRC_URI checksums. These are not generated by the pypi.bbclass (how could they be trusted?)

Without the checksum(s), we are vulnerable to a man-in-the-middle attack and zero checks on the validity of the downloaded tarball from pypi.org.

Fix by only setting S and SRC_URI to None.

---
 scripts/lib/recipetool/create_buildsys_python.py | 5 -----
 1 file changed, 5 deletions(-)
scripts/lib/recipetool/create_buildsys_python.py +0 -0
index 5e07222ece1..66de36ba3e4 100644

scripts/lib/recipetool/create_buildsys_python.py class PythonRecipeHandler(RecipeHandler): · line 172

Quoted 1 line
scripts/lib/recipetool/create_buildsys_python.py +0 -0
@@ -172,11 +172,6 @@ class PythonRecipeHandler(RecipeHandler):
             # extravalues['SRC_URI(?:\[.*?\])?'] = None

The TODO comment above should also be removed as it should not be done.

Quoted 11 lines
scripts/lib/recipetool/create_buildsys_python.py +0 -6
             extravalues['S'] = None
             extravalues['SRC_URI'] = None
-            extravalues['SRC_URI[md5sum]'] = None
-            extravalues['SRC_URI[sha1sum]'] = None
-            extravalues['SRC_URI[sha256sum]'] = None
-            extravalues['SRC_URI[sha384sum]'] = None
-            extravalues['SRC_URI[sha512sum]'] = None
 
             classes.append('pypi')
 
--
Quoted 1 line

2.34.1

//Peter