summaryrefslogtreecommitdiff
path: root/test/integration/test-releasefile-verification
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-03-13 14:21:00 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-03-13 14:21:00 +0100
commitb829fb2602a506a01cb2b3fd371e975784d4377c (patch)
treea0999795c61b95e3a9ec2cf30575e22e1b4d7337 /test/integration/test-releasefile-verification
parentb3887af24029cdc6179470fcb8587fff39a3eee9 (diff)
parent544cc111be38bd0a3dfc887da3a70610b3cabe9e (diff)
merged from debian-experimental2
Diffstat (limited to 'test/integration/test-releasefile-verification')
-rwxr-xr-xtest/integration/test-releasefile-verification29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification
index 8bf02a78f..4f65cfa3b 100755
--- a/test/integration/test-releasefile-verification
+++ b/test/integration/test-releasefile-verification
@@ -153,6 +153,35 @@ runtest() {
installaptold
}
+runtest2() {
+ prepare ${PKGFILE}
+ rm -rf rootdir/var/lib/apt/lists
+ signreleasefiles 'Joe Sixpack'
+ msgtest 'Cold archive signed by' 'Joe Sixpack'
+ aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
+
+ # New .deb but now an unsigned archive. For example MITM to circumvent
+ # package verification.
+ prepare ${PKGFILE}-new
+ find aptarchive/ -name InRelease -delete
+ find aptarchive/ -name Release.gpg -delete
+ msgtest 'Warm archive signed by' 'nobody'
+ aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
+ testequal "$(cat ${PKGFILE}-new)
+" aptcache show apt
+ failaptnew
+
+ # Unsigned archive from the beginning must also be detected.
+ rm -rf rootdir/var/lib/apt/lists
+ msgtest 'Cold archive signed by' 'nobody'
+ aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass
+ testequal "$(cat ${PKGFILE}-new)
+" aptcache show apt
+ failaptnew
+}
+runtest2
+
+
DELETEFILE="InRelease"
runtest
DELETEFILE="Release.gpg"