summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2012-03-03 11:44:06 +0100
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-03-03 11:44:06 +0100
commit43c1ca5d1eb8101e3a52d19a2175c14817e6dd14 (patch)
tree320b88809603a253c1a84bd4200a49a600d3609b /test
parent440d3d654a5f85e8b5c0472e91f425fbac9541b8 (diff)
testcase for CVE-2012-0214
Diffstat (limited to 'test')
-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"