]>
Commit | Line | Data |
---|---|---|
bd4a8f51 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" | |
5 | . "$TESTDIR/framework" | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture 'i386' | |
9 | confighashes 'MD5' | |
10 | ||
11 | insertpackage 'unstable' 'foo' 'i386' '1.0' | |
12 | insertsource 'unstable' 'foo' 'any' '1.0' | |
13 | ||
14 | setupaptarchive --no-update | |
15 | APTARCHIVE="$(readlink -f ./aptarchive)" | |
16 | ||
17 | msgmsg 'Release contains only weak hashes' | |
18 | FILENAME="${APTARCHIVE}/dists/unstable/InRelease" | |
19 | MANGLED="$(readlink -f ./rootdir)/var/lib/apt/lists/partial/$(echo "$FILENAME" | sed 's#/#_#g')" | |
a2025a9a | 20 | testfailuremsg "E: Failed to fetch file:${FILENAME} No Hash entry in Release file ${MANGLED} which is considered strong enough for security purposes |
bd4a8f51 DK |
21 | E: Some index files failed to download. They have been ignored, or old ones used instead." apt update |
22 | testnopackage foo | |
23 | testnosrcpackage foo | |
24 | ||
25 | msgmsg 'Release contains no hashes' | |
26 | sed -i -e '/^ / d' -e '/^MD5Sum:/ d' "$APTARCHIVE/dists/unstable/Release" | |
27 | signreleasefiles | |
f695e761 | 28 | testfailuremsg "E: Failed to fetch file:${FILENAME} No Hash entry in Release file ${MANGLED} |
bd4a8f51 DK |
29 | E: Some index files failed to download. They have been ignored, or old ones used instead." apt update |
30 | testnopackage foo | |
31 | testnosrcpackage foo | |
32 | ||
33 | msgmsg 'Release contains only weak hashes for some files' | |
34 | confighashes 'MD5' 'SHA256' | |
35 | generatereleasefiles | |
36 | sed -i '/^ [0-9a-fA-Z]\{64\} .*Sources$/d' "$APTARCHIVE/dists/unstable/Release" | |
37 | signreleasefiles | |
38 | testwarningmsg "W: Skipping acquire of configured file 'main/source/Sources' as repository 'file:${APTARCHIVE} unstable InRelease' provides only weak security information for it" apt update | |
39 | testsuccess apt show foo | |
40 | testnosrcpackage foo |