summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorTim Orling <ticotimo@gmail.com>2023-12-08 17:40:04 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-09 19:17:11 +0000
commit78ef0313ee6add0301d866074c4b4a23dbefd757 (patch)
treee265fe48ab764aac1d7ab5d3558f680c12fb24cd /scripts/lib
parent95c187e54e2d2d134c1f9a4b97a400c961bc9bba (diff)
downloadpoky-78ef0313ee6add0301d866074c4b4a23dbefd757.tar.gz
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. (From OE-Core rev: 560181a52111569f7bc57b09139b42510e0d0325) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/recipetool/create_buildsys_python.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/scripts/lib/recipetool/create_buildsys_python.py b/scripts/lib/recipetool/create_buildsys_python.py
index 5e07222ece..a2af41fdda 100644
--- a/scripts/lib/recipetool/create_buildsys_python.py
+++ b/scripts/lib/recipetool/create_buildsys_python.py
@@ -167,16 +167,11 @@ class PythonRecipeHandler(RecipeHandler):
167 if pypi_package_ext != "tar.gz": 167 if pypi_package_ext != "tar.gz":
168 extravalues["PYPI_PACKAGE_EXT"] = pypi_package_ext 168 extravalues["PYPI_PACKAGE_EXT"] = pypi_package_ext
169 169
170 # Pypi class will handle S and SRC_URIxxx variables, so remove them 170 # Pypi class will handle S and SRC_URI variables, so remove them
171 # TODO: allow oe.recipeutils.patch_recipe_lines() to accept regexp so we can simplify the following to: 171 # TODO: allow oe.recipeutils.patch_recipe_lines() to accept regexp so we can simplify the following to:
172 # extravalues['SRC_URI(?:\[.*?\])?'] = None 172 # extravalues['SRC_URI(?:\[.*?\])?'] = None
173 extravalues['S'] = None 173 extravalues['S'] = None
174 extravalues['SRC_URI'] = None 174 extravalues['SRC_URI'] = None
175 extravalues['SRC_URI[md5sum]'] = None
176 extravalues['SRC_URI[sha1sum]'] = None
177 extravalues['SRC_URI[sha256sum]'] = None
178 extravalues['SRC_URI[sha384sum]'] = None
179 extravalues['SRC_URI[sha512sum]'] = None
180 175
181 classes.append('pypi') 176 classes.append('pypi')
182 177