summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-unauth
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-09-16 20:23:43 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-09-16 20:39:13 +0200
commitca7fd76c2f30c100dcf1c12e717ce397cccd690b (patch)
tree70a49859068972ec03c8c70d581135ee4e1a9c7f /test/integration/test-apt-update-unauth
parent13fe505ceed4cee05667c05cf07896386310ebbc (diff)
SECURITY UPDATE for CVE-2014-{0488,0487,0489}
incorrect invalidating of unauthenticated data (CVE-2014-0488) incorect verification of 304 reply (CVE-2014-0487) incorrect verification of Acquire::Gzip indexes (CVE-2014-0489)
Diffstat (limited to 'test/integration/test-apt-update-unauth')
-rwxr-xr-xtest/integration/test-apt-update-unauth48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/integration/test-apt-update-unauth b/test/integration/test-apt-update-unauth
new file mode 100755
index 000000000..13487603c
--- /dev/null
+++ b/test/integration/test-apt-update-unauth
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Ensure that when going from unauthenticated to authenticated all
+# files are checked again
+#
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture "i386"
+
+insertpackage 'unstable' 'foo' 'all' '1.0'
+insertsource 'unstable' 'foo' 'all' '1.0'
+
+setupaptarchive
+changetowebserver
+
+runtest() {
+ # start unauthenticated
+ find rootdir/var/lib/apt/lists/ -type f | xargs rm -f
+ rm -f aptarchive/dists/unstable/*Release*
+ aptget update -qq
+
+ # become authenticated
+ generatereleasefiles
+ signreleasefiles
+
+ # and ensure we do download the data again
+ msgtest "Check that the data is check when going to authenticated"
+ if aptget update |grep -q Hit; then
+ msgfail
+ else
+ msgpass
+ fi
+}
+
+for COMPRESSEDINDEXES in 'false' 'true'; do
+ echo "Acquire::GzipIndexes \"$COMPRESSEDINDEXES\";" > rootdir/etc/apt/apt.conf.d/compressindexes
+ if $COMPRESSEDINDEXES; then
+ msgmsg 'Run tests with GzipIndexes enabled'
+ else
+ msgmsg 'Run tests with GzipIndexes disabled'
+ fi
+
+ runtest
+done