]> git.saurik.com Git - apt.git/blob - test/integration/test-releasefile-date-older
treat older Release files than we already have as an IMSHit
[apt.git] / test / integration / test-releasefile-date-older
1 #!/bin/sh
2 set -e
3
4 TESTDIR=$(readlink -f $(dirname $0))
5 . $TESTDIR/framework
6 setupenvironment
7 configarchitecture 'i386'
8
9 insertpackage 'wheezy' 'apt' 'all' '0.8.15'
10
11 setupaptarchive --no-update
12
13 # we don't complain as the server could have just sent a 'Hit' here and this
14 # 'downgrade attack' is usually performed by out-of-sync mirrors. Valid-Until
15 # catches the 'real' downgrade attacks (expect that it finds stale mirrors).
16 # Scaring users with an error here serves hence no point.
17
18 msgmsg 'InRelease file is silently rejected if' 'new Date is before old Date'
19 rm -rf rootdir/var/lib/apt/lists
20 generatereleasefiles 'now' 'now + 7 days'
21 signreleasefiles
22 testsuccess aptget update
23 listcurrentlistsdirectory > listsdir.lst
24 redatereleasefiles 'now - 2 days'
25 testsuccess aptget update
26 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
27
28 msgmsg 'Release.gpg file is silently rejected if' 'new Date is before old Date'
29 rm -rf rootdir/var/lib/apt/lists
30 generatereleasefiles 'now' 'now + 7 days'
31 signreleasefiles
32 find aptarchive -name 'InRelease' -delete
33 testsuccess aptget update
34 listcurrentlistsdirectory > listsdir.lst
35 redatereleasefiles 'now - 2 days'
36 find aptarchive -name 'InRelease' -delete
37 testsuccess aptget update
38 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
39
40 msgmsg 'Crisscross InRelease/Release.gpg file is silently rejected if' 'new Date is before old Date'
41 rm -rf rootdir/var/lib/apt/lists
42 generatereleasefiles 'now' 'now + 7 days'
43 signreleasefiles
44 find aptarchive -name 'Release.gpg' -delete
45 testsuccess aptget update
46 listcurrentlistsdirectory > listsdir.lst
47 redatereleasefiles 'now - 2 days'
48 find aptarchive -name 'InRelease' -delete
49 testsuccess aptget update
50 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"
51
52 msgmsg 'Crisscross Release.gpg/InRelease file is silently rejected if' 'new Date is before old Date'
53 rm -rf rootdir/var/lib/apt/lists
54 generatereleasefiles 'now' 'now + 7 days'
55 signreleasefiles
56 find aptarchive -name 'InRelease' -delete
57 testsuccess aptget update
58 listcurrentlistsdirectory > listsdir.lst
59 redatereleasefiles 'now - 2 days'
60 find aptarchive -name 'Release.gpg' -delete
61 testsuccess aptget update
62 testfileequal 'listsdir.lst' "$(listcurrentlistsdirectory)"