diff options
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/exploid-keyring-with-dupe-keys.pub | bin | 0 -> 3986 bytes | |||
-rw-r--r-- | test/integration/exploid-keyring-with-dupe-subkeys.pub | bin | 0 -> 2016 bytes | |||
-rwxr-xr-x | test/integration/test-apt-key-net-update | 95 | ||||
-rwxr-xr-x | test/integration/test-bug-666772-multiarch-arch-all-build-deps | 118 |
4 files changed, 213 insertions, 0 deletions
diff --git a/test/integration/exploid-keyring-with-dupe-keys.pub b/test/integration/exploid-keyring-with-dupe-keys.pub Binary files differnew file mode 100644 index 000000000..642952a40 --- /dev/null +++ b/test/integration/exploid-keyring-with-dupe-keys.pub diff --git a/test/integration/exploid-keyring-with-dupe-subkeys.pub b/test/integration/exploid-keyring-with-dupe-subkeys.pub Binary files differnew file mode 100644 index 000000000..02d4e6ee8 --- /dev/null +++ b/test/integration/exploid-keyring-with-dupe-subkeys.pub diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update new file mode 100755 index 000000000..d5205836f --- /dev/null +++ b/test/integration/test-apt-key-net-update @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +# mock +requires_root() { + return 0 +} + +# extract net_update() and import it +func=$( sed -n -e '/^add_keys_with_verify_against_master_keyring/,/^}/p' ${BUILDDIRECTORY}/apt-key ) +eval "$func" + +mkdir -p ./etc/apt +TRUSTEDFILE=./etc/apt/trusted.gpg +mkdir -p ./var/lib/apt/keyrings +TMP_KEYRING=./var/lib/apt/keyrings/maybe-import-keyring.gpg +GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring" +GPG="$GPG_CMD --keyring $TRUSTEDFILE" +MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg + + +msgtest "add_keys_with_verify_against_master_keyring" +if [ ! -e $MASTER_KEYRING ]; then + echo -n "No $MASTER_KEYRING found" + msgskip + exit 0 +fi + +# test bad keyring and ensure its not added (LP: #857472) +ADD_KEYRING=./keys/exploid-keyring-with-dupe-keys.pub +if add_keys_with_verify_against_master_keyring $ADD_KEYRING $MASTER_KEYRING; then + msgfail +else + msgpass +fi + +# ensure the keyring is still empty +gpg_out=$($GPG --list-keys) +msgtest "Test if keyring is empty" +if [ -n "" ]; then + msgfail +else + msgpass +fi + + +# test another possible attack vector using subkeys (LP: #1013128) +msgtest "add_keys_with_verify_against_master_keyring with subkey attack" +ADD_KEYRING=./keys/exploid-keyring-with-dupe-subkeys.pub +if add_keys_with_verify_against_master_keyring $ADD_KEYRING $MASTER_KEYRING; then + msgfail +else + msgpass +fi + +# ensure the keyring is still empty +gpg_out=$($GPG --list-keys) +msgtest "Test if keyring is empty" +if [ -n "" ]; then + msgfail +else + msgpass +fi + + +# test good keyring and ensure we get no errors +ADD_KEYRING=/usr/share/keyrings/ubuntu-archive-keyring.gpg +if add_keys_with_verify_against_master_keyring $ADD_KEYRING $MASTER_KEYRING; then + msgpass +else + msgfail +fi + +testequal './etc/apt/trusted.gpg +--------------------- +pub 1024D/437D05B5 2004-09-12 +uid Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com> +sub 2048g/79164387 2004-09-12 + +pub 1024D/FBB75451 2004-12-30 +uid Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com> + +pub 4096R/C0B21F32 2012-05-11 +uid Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com> + +pub 4096R/EFE21092 2012-05-11 +uid Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com> +' $GPG --list-keys + diff --git a/test/integration/test-bug-666772-multiarch-arch-all-build-deps b/test/integration/test-bug-666772-multiarch-arch-all-build-deps new file mode 100755 index 000000000..cfae1fef3 --- /dev/null +++ b/test/integration/test-bug-666772-multiarch-arch-all-build-deps @@ -0,0 +1,118 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'armhf' + +insertinstalledpackage 'build-essential' 'all' '11.5' + +insertpackage 'unstable' 'doxygen' 'all' '1.0' 'Depends: language-support, language-tool' +insertpackage 'unstable' 'libc6' 'amd64,armhf' '1.0' 'Multi-Arch: same' +insertpackage 'unstable' 'libc6-dev' 'amd64,armhf' '1.0' 'Depends: libc6 +Multi-Arch: same' +insertpackage 'unstable' 'language-support' 'amd64,armhf' '1.0' 'Multi-Arch: foreign' +insertpackage 'unstable' 'language-tool' 'amd64,armhf' '1.0' + +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6 libc6-dev +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [amd64]) +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf language-support (1.0 unstable [amd64]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6:armhf libc6-dev:armhf +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [amd64]) +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6:armhf (1.0 unstable [armhf]) +Inst libc6-dev:armhf (1.0 unstable [armhf]) +Conf language-support (1.0 unstable [amd64]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6:armhf (1.0 unstable [armhf]) +Conf libc6-dev:armhf (1.0 unstable [armhf])' aptget build-dep apt -s -a armhf + +configarchitecture 'armhf' 'amd64' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6 libc6-dev +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [armhf]) +Inst language-tool (1.0 unstable [armhf]) +Inst doxygen (1.0 unstable [all]) +Inst libc6 (1.0 unstable [armhf]) +Inst libc6-dev (1.0 unstable [armhf]) +Conf language-support (1.0 unstable [armhf]) +Conf language-tool (1.0 unstable [armhf]) +Conf doxygen (1.0 unstable [all]) +Conf libc6 (1.0 unstable [armhf]) +Conf libc6-dev (1.0 unstable [armhf])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6:amd64 libc6-dev:amd64 +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [armhf]) +Inst language-tool (1.0 unstable [armhf]) +Inst doxygen (1.0 unstable [all]) +Inst libc6:amd64 (1.0 unstable [amd64]) +Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Conf language-support (1.0 unstable [armhf]) +Conf language-tool (1.0 unstable [armhf]) +Conf doxygen (1.0 unstable [all]) +Conf libc6:amd64 (1.0 unstable [amd64]) +Conf libc6-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 + +configarchitecture 'amd64' 'armhf' + +insertinstalledpackage 'language-support' 'armhf' '0.5' 'Multi-Arch: foreign' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-tool libc6 libc6-dev +0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded. +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-tool libc6:armhf libc6-dev:armhf +0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded. +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6:armhf (1.0 unstable [armhf]) +Inst libc6-dev:armhf (1.0 unstable [armhf]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6:armhf (1.0 unstable [armhf]) +Conf libc6-dev:armhf (1.0 unstable [armhf])' aptget build-dep apt -s -a armhf |