From e5543ea5a236426dd33e74e427e8485a030a2540 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 Dec 2013 16:43:50 +0100 Subject: [PATCH] fix apt-key net-update test to use the buildin webserver --- cmdline/apt-key.in | 2 +- .../exploid-keyring-with-dupe-keys.pub | Bin 3986 -> 0 bytes .../exploid-keyring-with-dupe-subkeys.pub | Bin 2016 -> 0 bytes .../keyrings/test-archive-keyring.pub | Bin 0 -> 979 bytes .../keyrings/test-archive-keyring.sec | Bin 0 -> 1355 bytes .../keyrings/test-master-keyring.pub | Bin 0 -> 1199 bytes .../keyrings/test-master-keyring.sec | Bin 0 -> 2501 bytes test/integration/test-apt-key-net-update | 133 ++++-------------- 8 files changed, 25 insertions(+), 110 deletions(-) delete mode 100644 test/integration/exploid-keyring-with-dupe-keys.pub delete mode 100644 test/integration/exploid-keyring-with-dupe-subkeys.pub create mode 100644 test/integration/keyrings/test-archive-keyring.pub create mode 100644 test/integration/keyrings/test-archive-keyring.sec create mode 100644 test/integration/keyrings/test-master-keyring.pub create mode 100644 test/integration/keyrings/test-master-keyring.sec diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in index c7d3ce8b5..463e4b4b4 100644 --- a/cmdline/apt-key.in +++ b/cmdline/apt-key.in @@ -130,7 +130,7 @@ net_update() { if [ ! -d ${APT_DIR}/var/lib/apt/keyrings ]; then mkdir -p ${APT_DIR}/var/lib/apt/keyrings fi - keyring=${APT_DIR}/var/lib/apt/keyrings/$(basename $ARCHIVE_KEYRING) + keyring=${APT_DIR}/var/lib/apt/keyrings/$(basename $ARCHIVE_KEYRING_URI) old_mtime=0 if [ -e $keyring ]; then old_mtime=$(stat -c %Y $keyring) diff --git a/test/integration/exploid-keyring-with-dupe-keys.pub b/test/integration/exploid-keyring-with-dupe-keys.pub deleted file mode 100644 index 642952a403cb33ab2e1a07aa7e98dd1c944f5927..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3986 zcmai$WmHt{7J#Q{hK>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5;h>V5iZtNB{u%<4yKHmvUR6Z!rHHYqn9JmlHbQp{mu(Y?TM1PG*UiiG2-U+-MRgKIxHa zkN{8I{whr2ThHW{t-MR_WvOV>O4ma3p3F?OZ~1-xI8|(yp9W3c5X98!b!Ajo8Q`k= zFvpus<`CB!`3rJIv8Mr_1)}5%WODYsHKbKgj;)x(W=lm*1i?JNzNSI`D}B(HqP>6J zyWZkTmbzTlbxPVvNZS4BNiL4&zqNStgP3EAMUGTewe<|tT4aq?E zeC5GH7d7jWv0A-Zn%+NO#%5Xp88;7Iw@n>pEGLw7< zP3km1d3_qpihz~OT#Oqx4T_PEylWv3X~$&6|1}^JR4ju{1#3L_c?{xz{FnwLJG0PX z0zEb5jfkqgQmvwCY~18sdIa6^cS5anx`e`{ z8}BWJYYU*K%-*WMo|B0maC(mfbaU|J+zeM>T%1>f18E? diff --git a/test/integration/keyrings/test-archive-keyring.pub b/test/integration/keyrings/test-archive-keyring.pub new file mode 100644 index 0000000000000000000000000000000000000000..d8d9d472be204166e2790533c78d3645f6394e6c GIT binary patch literal 979 zcmV;^11$WQjRaD&4i^Cg0MLhnE=bm^cCa5^&o<=ilbNGC&%+mr6bJ9~uj%F%o6TkL zz7lWgZ`rTaH97adWJx#p953@_74w<8{q`Y|`XG)69dO9asT^B4huj`kPKGe@8`IJ4 zH;gctwDq|oNScckvorvsjCigErv4k}WVPo}4&vTON_#bnIE`ljRR9qI00Fc*RAqB? zAVGC>Z*5_8X=5Nka${&|c4Z(_X=iR}Zf77%WqBYxW^{0EVRLk4azJHxVQp}1WiDfH zZ9a&%1QP)W03iheQnL;h0viJb3ke7Z0|gZd2?z@X76JnS00JHX0vCV)3JDPX(%Xgh zjD@4SMg#v%Tu9Tj3(8;d@s$ov`C6ef&;3Fhky*Bqr`meD$LzY2(;2A`0k~Qt00%lD zfBjk$&=m-W!OuAes#PDf_d8fG>eul^GvFxK=27CmbXv9 zh+qm#Qah%+Ary0|Dd}Og$EOr2u87Ex>U#hQbkm}V0UQJn0SEvF1p-pD4^sdN2@o_D zECO7CpPriA2mKh5-Cjvs>dPp5FeNY9w9PP(5;(uX01T8_tl7PfDrqkkhTKa<4Ae>S zbISZy#{loMle3|Z4+}@^%=z$AapWB}UeiWuI=9X(VwbV1wx;H@c62vo`CkV6xpSjiT=)qM3WF-sGl(kgv)li3ubkP)z3TR7%v0k|6Rr%AOTv)Sz@ z6~O`>n`yX>1X8mO7XbtSzR^E&daCW-$LhPSV41@NT*RWQF`Rwyp7*oCLT%WjII_Yg z`VT5=Sk`9#q>x_dZm%8QF;wDfexHA#)SBH@mMVXs_(aK@A-%nql9eT01*KI0f?Uj7y$?X z2?YXDvkn&m8w>yn2@w6#+lBUwg`zJZF62^!FKZM_Q`p}n!$8ybY*j$9E>b}lpJBe$-=6=JvmJ_ZW^!8&~y!hArK ze%a1B{io57Ir7E!ORyF(TJaHL2m6~zG_WWUaa+hpD=8`I7pC;wA<|@!C?fUrEd{!D BzxV(E literal 0 HcmV?d00001 diff --git a/test/integration/keyrings/test-archive-keyring.sec b/test/integration/keyrings/test-archive-keyring.sec new file mode 100644 index 0000000000000000000000000000000000000000..aece750e804abd57de9dfdceaa2462e88b213b81 GIT binary patch literal 1355 zcmV-R1+@B=0oVjmvkn&l1OU*7gDyzct9Gy-UC%b;>yw$IJI})xiWCR$^RMaV7Msmw z@V*jn>2KMu)ipWyz+_1`_#7|uWfk+8y8ZSck@_Hx2OV(8&8Zw)IEUOGR!)X6@*C69 z?Kg}tn6&k|BS@Ny6|*z|ql|d21*ZNR=VZ0#Q4ZqXNJ@J(i#UyE0961H0RRC21N{+x z1eJ-~q!)QFuw_*A00inH#!znV_!2J`}^RKz@s ze8b8j@2VvZ?AbXx`t0yu6aRx19HPOPY$9$f>aEy>_fkNoej_U}R@fv;Yhqi;-Xy3Q z7X|R?Rnjok)@}x)ZqdE-6O6AoasQ8FlUB0tMROOOmq9#RlCfSylnw= zPn#t6pPU(Ao)-iOm6|_>Y=M<1Deed)-Xo~<@=-!YVE^LL0s!%5@bg+FwX*l9U1zt0 z6q5<-+<*laf;GmPE%i7EhDEv-FU1Lf@yi*)9UQvk_E~5FeqCgTA^vo5iK)d5enkQR z;89Xq?q4b(6!m?P<96**Mx_T!c;nD=E2r zU3bCdT6Oz*kMCchqY$(@RAqB?AVGC>Z*5_8X=5Nka${&|c4Z(_X=iR}Zf77%WqBYx zW^{0EVRLk4azJHxVQp}1WiDfHZ9a&%1QP)W03iheQnL;h0viJb3ke7Z0|gZd2?z@X z76JnS00JHX0vCV)3JDPX(%XghjD@4SMg#v%Tu9Tj3(8;d@s$ov`C6ef&;3Fhky*Bq zr`meD$LzY2(;2A`0k~Qt00%lDfBjk$&=m-W!OuAes#PDf_d8fG>eul^GvFxK=27Cm zbXv9h+qm#Qah%+Ary0|Dd}Og$EOr2u87Ex>U#hQbkm}p z0oMdlvkn&l1OUF#KXQ7i?cT@gyRBfE!vtK!qN_2Seej<5v%x}b*rYhJ!YBFAvy5(4Ww}BG$FwfI<)WGt)oJ!TII*=Qk<)BnoP!u!Uyy=d}@Zd3&AF{fri5cXE7JgBaF`2qlz3v8|~!equM z&K?<(rBP?Ejco6u>#J$q=!Hmas`VKo{}q9%%j1sO_x%mXZZI+7Ug;ucW;+8FxEbdS zPYs@=QHY-e7y$?X2?YXDvkn&m8w>yn2@w6#+lBUwg`zJZF62^!FKZM_Q`p}n!$8ybY*j$9E>b}lpJBe$-=6=Jvm zJ_ZW^!8&~y!hArKe%a1B{io57Ir7E!ORyF(TJaHL2m6~zG_WWUaa+hpD=8`I7pC;w NA<|@!C?fUrEd|5}f?WUr literal 0 HcmV?d00001 diff --git a/test/integration/keyrings/test-master-keyring.pub b/test/integration/keyrings/test-master-keyring.pub new file mode 100644 index 0000000000000000000000000000000000000000..33aa16796cf259bb1ed686e5c2e989ff49c37a73 GIT binary patch literal 1199 zcmV;g1W@~#0SyFFs}B(Y2ms}sU+fz$Y?#|_(|?Q>Pg^53fK9q6)F;LY74CRa8{>K{ zLVR@VSMQs;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q=f(20N8wib0T|j-$u0AXmue$K2OR+?w(=brxjXipUD*yFcX;4hmV(m^8UJxjuI>wzHrzIpK)`9|RZy2mlEM0#d6F5ds?w z0162ZG!-lYT!EjSTAv62zB?l=UoACw*4+R8jE+)}wQ+r&9`8JaR4dt#B{J~JLnaJv zMo(hAo3;r#b{1R#y9)~bnm!ehe=1QYtVR&Zz8B7UP)SeDn@>PAhPAy9+ld6{CJ+@nxEW3hT!;X&lG=o?nLUn8b`yG)ApLB~?*o5} ztU%fL4O}l1h9G)9?r8&lc~a0nM%qmXDu)gt+SrLr8&CHkye_xsR81*VmjvY>OErbY zzuS6CCVC77u@Z9LWIW^uA4J(2*(Po)9s&05$iECcf=YJX9)4G@?|zy5j1Y47{ez%B P+qWjL6Rf(kglBleV#}QC literal 0 HcmV?d00001 diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update index e0869402e..4b38cd9b5 100755 --- a/test/integration/test-apt-key-net-update +++ b/test/integration/test-apt-key-net-update @@ -9,120 +9,35 @@ configarchitecture "i386" changetowebserver # setup env -mkdir -p aptarchive/ubuntu/project var/lib/apt/keyrings -echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/ubuntu-archive-keyring.gpg";' >> ./aptconfig.conf -echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf - -# signed thing -echo "meep" > aptarchive/ubuntu/project/ubuntu-archive-keyring.gpg - -# test against the "real" webserver -aptkey --fakeroot net-update - -exit 1 - -# 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" - -# FIXME: instead of copying this use apt-key and the buildin apt webserver -# to do a real test - -# COPYIED from apt-key.in -------------- - -# gpg needs a trustdb to function, but it can't be invalid (not even empty) -# so we create a temporary directory to store our fresh readable trustdb in -TRUSTDBDIR="$(mktemp -d)" -CURRENTTRAP="${CURRENTTRAP} rm -rf '${TRUSTDBDIR}';" -trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM -chmod 700 "$TRUSTDBDIR" -# We also don't use a secret keyring, of course, but gpg panics and -# implodes if there isn't one available - and writeable for imports -SECRETKEYRING="${TRUSTDBDIR}/secring.gpg" -touch $SECRETKEYRING -GPG_CMD="$GPG_CMD --secret-keyring $SECRETKEYRING" -GPG_CMD="$GPG_CMD --trustdb-name ${TRUSTDBDIR}/trustdb.gpg" -#----------------------------------------- END COPY +mkdir -p var/lib/apt/keyrings +mkdir -p usr/share/keyrings -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 +# install the fake master keyring +install -m0644 keys/test-master-keyring.pub usr/share/keyrings +echo "APT::Key::MasterKeyring \"${TMPWORKINGDIRECTORY}/usr/share/keyrings/test-master-keyring.pub\";" >> ./aptconfig.conf +# setup archive-keyring +mkdir -p aptarchive/ubuntu/project +install -m0644 keys/test-archive-keyring.pub aptarchive/ubuntu/project/ +echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/test-archive-keyring.pub";' >> ./aptconfig.conf +echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf -# 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 +# test against the "real" webserver +testequal 'Checking for new archive signing keys now +gpg: key F68C85A3: public key "Test Automatic Archive Signing Key " imported +gpg: Total number processed: 1 +gpg: imported: 1 (RSA: 1)' aptkey --fakeroot net-update -testequal './etc/apt/trusted.gpg ---------------------- -pub 1024D/437D05B5 2004-09-12 -uid Ubuntu Archive Automatic Signing Key -sub 2048g/79164387 2004-09-12 -pub 1024D/FBB75451 2004-12-30 -uid Ubuntu CD Image Automatic Signing Key +# now try a different one +# setup archive-keyring +mkdir -p aptarchive/ubuntu/project +install -m0644 keys/marvinparanoid.pub aptarchive/ubuntu/project/ +echo 'APT::Key::ArchiveKeyringURI "http://localhost:8080/ubuntu/project/marvinparanoid.pub";' >> ./aptconfig.conf +echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf -pub 4096R/C0B21F32 2012-05-11 -uid Ubuntu Archive Automatic Signing Key (2012) +# test against the "real" webserver +testequal "Checking for new archive signing keys now +Key 'E8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update -pub 4096R/EFE21092 2012-05-11 -uid Ubuntu CD Image Automatic Signing Key (2012) -' $GPG --list-keys -- 2.45.2