Skip to content

Commit 560181a

Browse files
moto-timorpurdie
authored andcommitted
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. Signed-off-by: Tim Orling <[email protected]> Signed-off-by: Richard Purdie <[email protected]>
1 parent 29775b5 commit 560181a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

scripts/lib/recipetool/create_buildsys_python.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,11 @@ def process_url(self, args, classes, handled, extravalues):
167167
if pypi_package_ext != "tar.gz":
168168
extravalues["PYPI_PACKAGE_EXT"] = pypi_package_ext
169169

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
171171
# TODO: allow oe.recipeutils.patch_recipe_lines() to accept regexp so we can simplify the following to:
172172
# extravalues['SRC_URI(?:\[.*?\])?'] = None
173173
extravalues['S'] = None
174174
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
180175

181176
classes.append('pypi')
182177

0 commit comments

Comments
 (0)