Skip to content

Commit 11a3875

Browse files
build: migrate tarball integrity checksums from sha1 to sha512
Replace the per-tarball sha1 integrity pins with sha512 (upstream asked for sha512 rather than sha256). - fetch-package: verify ${FILE}.sha512 with sha512sum (was sha1sum / .sha1); the second argument is now the SHA512 directory. - crosstool-ng.make: update the "how to pin a new package" comment to sha512sum / .sha512. - Convert every active upstream/*.sha1 to upstream/*.sha512 (hashes computed from the verified tarballs) and drop all now-unused .sha1 pins for versions no longer referenced. Every checksum was generated from a tarball first verified against its previous sha1 pin, so the sha512 values correspond to exactly the bytes ONIE already trusted. Note: this also pins acpica-unix-20260408, libpcap-1.10.6 and tcpdump-4.99.6, whose current-version checksums would otherwise be absent. Signed-off-by: Brad House <bhouse@nexthop.ai>
1 parent 921cc21 commit 11a3875

234 files changed

Lines changed: 80 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build-config/make/crosstool-ng.make

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
# Default GCC version to build for the toolchain.
1515
# Tip: Reference a Debian install for related component versions.
16-
# To upgrade sha1 for new package:
17-
# sha1sum ./gcc-8.3.0.tar.xz > ./upstream/gcc-8.3.0.tar.xz.sha1
16+
# To upgrade the sha512 pin for a new package:
17+
# sha512sum ./gcc-8.3.0.tar.xz > ./upstream/gcc-8.3.0.tar.xz.sha512
1818
# https://ftp.gnu.org/pub/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
1919
GCC_VERSION ?= 14.3.0
2020

build-config/scripts/fetch-package

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
usage() {
1313
cat <<EOF
1414
$0: Usage
15-
$0 <download dir> <SHA1 dir> <base file name> <URL1> [[URL2] .. [URLx]]
15+
$0 <download dir> <SHA512 dir> <base file name> <URL1> [[URL2] .. [URLx]]
1616
1717
Download file into download directory using the list of base URLs.
1818
For example the following URL is attempted:
1919
2020
\$URL1/\$base_file_name
2121
22-
The <SHA1 dir> contains <base file name>.sha1, which is verified
22+
The <SHA512 dir> contains <base file name>.sha512, which is verified
2323
after downloading.
2424
EOF
2525
}
@@ -35,7 +35,7 @@ EOF
3535
DOWNLOAD_CACHE_DIR="/var/cache/onie/download"
3636

3737
OUTDIR=$1
38-
SHA1DIR=$2
38+
SHA512DIR=$2
3939
FILE=$3
4040

4141
shift 3
@@ -46,8 +46,8 @@ shift 3
4646
exit 1
4747
}
4848

49-
[ -d "$SHA1DIR" ] || {
50-
echo "Error: SHA1 directory does not exist: $SHA1DIR"
49+
[ -d "$SHA512DIR" ] || {
50+
echo "Error: SHA512 directory does not exist: $SHA512DIR"
5151
usage
5252
exit 1
5353
}
@@ -109,9 +109,9 @@ else
109109
echo ""
110110
fi
111111

112-
# Verify SHA1
113-
cd $OUTDIR && sha1sum -c ${SHA1DIR}/${FILE}.sha1 || {
114-
echo " ERROR: Unable to verify sha1 for ${FILE}"
112+
# Verify SHA512
113+
cd $OUTDIR && sha512sum -c ${SHA512DIR}/${FILE}.sha512 || {
114+
echo " ERROR: Unable to verify sha512 for ${FILE}"
115115
exit 1
116116
}
117117

upstream/0.3.0.tar.gz.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

upstream/0.7.2.tar.gz.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

upstream/0.7.2.tar.gz.sha512

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cdab37f86191c009b8264f065c3ca8ca051d8c1366191dca4c142d4146a0f7b7614cb17e53b6a8ca6fde0462bc113d4a1a751673b755eea0b3ed6e90da507f5a 0.7.2.tar.gz

upstream/11cb2ddd43fd1ff493f4b7cd63f1cf654294165f.tar.gz.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

upstream/18.tar.gz.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

upstream/18.tar.gz.sha512

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
04e40a705cb82440fd823043b598ef9fd1acc2ceda3e8d043a93e49d43ea9481b7386cad0f46de9862beff19b8a5480d79e7d6522ae584aff6655472f967764d 18.tar.gz

upstream/39.tar.gz.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.

upstream/39.tar.gz.sha512

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
04493c30efbfc2773abac9a3dd93aa13403c05e29e3bfc72877d2054930811fae99119aadcb1729b6ca85abf5a24db786ea0c27c16d5458ef1b19e74696f5ff7 39.tar.gz

0 commit comments

Comments
 (0)