openwrt/scripts
Baptiste Jonglez b30ba14e2a scripts/download.pl: fail loudly if provided hash is unsupported
Currently, if the provided hash is unsupported (length different from 32
or 64 bytes), we happily download the requested file without any kind of
checksum verification.

This is quite dangerous and may provide a false sense of security, because
a single typo in the hash (e.g. one character deleted by mistake) may skip
checksum verification entirely.

Instead, fail immediately if we don't support the provided hash.
In particular, if an external package repository decides to change the
hash algorithm one day, we will now fail loudly instead of skipping
checksum verification without complaints.

Note: if some users of scripts/download.pl knowingly provide an empty hash
because they don't need checksum verification, this change will break
them.  This does not seem to be the case currently, but if this feature is
ever needed, an option should be added to download.pl instead of relying
on the hash being empty.

Fixes: eaa4eba10a ("scripts/download.pl: add SHA-256 support")

Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
2017-09-11 17:13:02 +02:00
..
config scripts/config: properly handle select on symbols with unmet direct dependencies 2016-08-03 20:03:36 +02:00
flashing build: remove absolute path to perl and replace with /usr/bin/env perl 2017-05-02 14:33:58 +02:00
arm-magic.sh scripts/arm-magic.sh: make the generated kernels also include $IMG_PREFIX 2015-05-28 10:48:23 +00:00
brcmImage.pl scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
bundle-libraries.sh build: bundle-libraries.sh: do not override argv[0] in inner exec calls 2017-07-24 13:39:21 +02:00
checkpatch.pl build: remove absolute path to perl and replace with /usr/bin/env perl 2017-05-02 14:33:58 +02:00
clang-gcc-wrapper build: fix build on Mac OS X 10.9 2013-10-28 15:15:09 +00:00
clean-package.sh build: clean up stale files from a previous build when installing a package build to the staging dir 2013-05-29 10:31:45 +00:00
cleanfile build: remove absolute path to perl and replace with /usr/bin/env perl 2017-05-02 14:33:58 +02:00
cleanpatch build: remove absolute path to perl and replace with /usr/bin/env perl 2017-05-02 14:33:58 +02:00
combined-ext-image.sh build: use mkhash to replace various quirky md5sum/openssl calls 2017-01-05 11:09:12 +01:00
combined-image.sh scripts: make all scripts executable 2017-07-14 04:09:16 +02:00
config.guess update config.guess & config.sub 2015-11-02 18:12:45 +00:00
config.rpath add config.rpath and link it in autotools.mk if missing, some packages might need it, especially users of lib-link.m4 or iconv.m4 2011-02-27 15:39:27 +00:00
config.sub update config.guess & config.sub 2015-11-02 18:12:45 +00:00
deptest.sh scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
diffconfig.sh scripts/diffconfig.sh: fix output if TARGET_PER_DEVICE_ROOTFS is set 2016-10-06 22:00:10 +02:00
dl_cleanup.py dl_cleanup: Fix linux blacklist 2015-10-07 10:51:18 +00:00
download.pl scripts/download.pl: fail loudly if provided hash is unsupported 2017-09-11 17:13:02 +02:00
env env: allow passing a commit message on save 2015-05-01 17:23:15 +00:00
ext-toolchain.sh scripts: Probe external toolchains for libthread-db 2017-05-11 13:43:01 -07:00
feeds scripts/feeds: Reuse TOPDIR if defined in environment 2017-02-21 13:03:20 +01:00
fixup-makefile.pl build: add FIXUP option for make check 2016-12-17 10:36:45 +01:00
gen-dependencies.sh gen-dependencies.sh: fix handling variations in "file" output 2017-02-19 16:56:18 +01:00
gen_image_generic.sh scripts/gen_image_generic.sh: drop NOGRUB variable 2017-07-14 04:09:16 +02:00
get_source_date_epoch.sh scripts: get_source_date_epoch.sh: fix mercurial support, add mtime fallback 2017-02-02 00:13:50 +01:00
getver.sh scripts/getver.sh: append short git hash based on upstream commit 2017-02-01 17:48:45 +01:00
ipkg-build scripts: ipkg-build: do not require git or svn 2016-08-15 13:33:32 +02:00
ipkg-make-index.sh build: use mkhash to replace various quirky md5sum/openssl calls 2017-01-05 11:09:12 +01:00
kconfig.pl treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
make-ipkg-dir.sh branding: add LEDE branding 2016-03-24 22:40:13 +01:00
md5sum
metadata.pm scripts/package-metadata.pl: parse and validate field Require-User 2017-06-18 10:39:35 +08:00
mkhash.c build: add a small standalone utility for calculating md5/sha256 hash 2017-01-05 11:09:12 +01:00
mkits.sh scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
om-fwupgradecfg-gen.sh scripts: make all scripts executable 2017-07-14 04:09:16 +02:00
package-metadata.pl scripts/package-metadata.pl: inhibit compile deps on missing build types 2017-07-27 00:37:05 +02:00
pad_image scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
patch-kernel.sh scripts/patch-kernel.sh: remove -E flag to preserve empty files touched by patches 2015-08-25 07:46:32 +00:00
patch-specs.sh patch-specs.sh: gcc 3.4.6 has an additional "(OpenWrt-2.0)" after the version tag, cope with that 2012-01-29 20:19:06 +00:00
portable_date.sh scripts: fix GNU data invocation 2016-02-01 10:43:27 +00:00
qemustart scripts/qemustart: initial version 2017-04-23 09:19:34 +08:00
redboot-script.pl scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
relink-lib.sh base-files: relink uclibc and libgcc libraries to remove leftovers of the statically linked initial libgcc saves a few kb and gets rid of unused not exported functions as well should also improve the reliability of mklibs 2011-03-01 05:40:38 +00:00
remote-gdb build: remove libc version suffix from build/staging directories 2017-02-07 17:18:15 +01:00
rstrip.sh rstrip.sh: fix handling variations in "file" output 2017-02-19 16:56:17 +01:00
slugimage.pl
srecimage.pl treewide: replace jow@openwrt.org with jo@mein.io 2016-06-07 11:42:52 +02:00
strip-kmod.sh scripts/strip-kmod.sh: remove a few extra sections to slightly reduce kernel module size 2016-02-01 13:33:33 +00:00
symlink-tree.sh docs: remove all refrences in Makefiles/scripts 2016-11-30 10:13:14 +01:00
sysupgrade-tar.sh build: rename sysupgrade-nand to sysupgrade-tar 2016-07-29 16:53:03 +02:00
target-metadata.pl scripts: only generate config from feature flag if fully match 2017-03-20 22:04:41 +01:00
timestamp.pl fix timestamp checks for build system paths which have '.svn' in their directory name 2010-04-14 22:21:15 +00:00
ubinize-image.sh scripts/ubinize-image.sh: add support for adding custom partitions 2016-08-31 13:05:19 +02:00