Skip to content
Snippets Groups Projects
Commit 71ef9f95 authored by Aleksandar Nikolic's avatar Aleksandar Nikolic Committed by Steve Sakoman
Browse files

install-buildtools: remove md5 checksum validation


No need to validate with the md5 checksum, as the file is not even
uploaded to the Yocto release webpage (the download never failed due
to a wrong indentation of an else statement). For validation purposes,
use the sha256 checksum only.

(From OE-Core rev: b331769084996ffeb74007fe6ca7e385edd7a577)

Signed-off-by: default avatarAleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: default avatarRichard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b740d2f9d40aef1e18c022d1e82b4fb2c5c1fc22)
Signed-off-by: default avatarAleksandar Nikolic <aleksandar.nikolic@zeiss.com>
Signed-off-by: default avatarSteve Sakoman <steve@sakoman.com>
parent e19ef622
No related branches found
No related tags found
No related merge requests found
......@@ -238,19 +238,15 @@ def main():
# Verify checksum
if args.check:
logger.info("Fetching buildtools installer checksum")
checksum_type = ""
for checksum_type in ["md5sum", "sha256sum"]:
check_url = "{}.{}".format(buildtools_url, checksum_type)
checksum_filename = "{}.{}".format(filename, checksum_type)
tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename)
ret = subprocess.call("wget -q -O %s %s" %
(tmpbuildtools_checksum, check_url), shell=True)
if ret == 0:
break
else:
if ret != 0:
logger.error("Could not download file from %s" % check_url)
return ret
checksum_type = "sha256sum"
check_url = "{}.{}".format(buildtools_url, checksum_type)
checksum_filename = "{}.{}".format(filename, checksum_type)
tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename)
ret = subprocess.call("wget -q -O %s %s" %
(tmpbuildtools_checksum, check_url), shell=True)
if ret != 0:
logger.error("Could not download file from %s" % check_url)
return ret
regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$")
with open(tmpbuildtools_checksum, 'rb') as f:
original = f.read()
......@@ -263,10 +259,7 @@ def main():
logger.error("Filename does not match name in checksum")
return 1
checksum = m.group('checksum')
if checksum_type == "md5sum":
checksum_value = md5_file(tmpbuildtools)
else:
checksum_value = sha256_file(tmpbuildtools)
checksum_value = sha256_file(tmpbuildtools)
if checksum == checksum_value:
logger.info("Checksum success")
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment