diff options
author | Werner Koch <wk@gnupg.org> | 2010-10-14 18:34:31 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-10-14 18:34:31 +0200 |
commit | 764e88d4df29204be6ea2206cf753c56ec0f5b5f (patch) | |
tree | d38aa151706b32ce1ddbec2e7f012d317618072a /tests | |
parent | Some tweaks to the agent startup. (diff) | |
download | gnupg2-764e88d4df29204be6ea2206cf753c56ec0f5b5f.tar.xz gnupg2-764e88d4df29204be6ea2206cf753c56ec0f5b5f.zip |
All tests work are again working
Diffstat (limited to 'tests')
25 files changed, 380 insertions, 110 deletions
diff --git a/tests/openpgp/ChangeLog b/tests/openpgp/ChangeLog index 69869209a..46da4fe33 100644 --- a/tests/openpgp/ChangeLog +++ b/tests/openpgp/ChangeLog @@ -1,3 +1,24 @@ +2010-10-14 Werner Koch <wk@g10code.com> + + * genkey1024.test: Use the new no-protection option. + + * decrypt-dsa.test: Do not specify an extra keyring. The keyring + has been loaded into pubring.gpg. + * sigs-dsa.test: Ditto. + * encrypt-dsa.test: Ditto. + * signencrypt-dsa.test: Ditto. + + * decrypt.test: Remove passphrase stuff. + * sigs.test: Ditto. + + * privkeys/: New. + + * Makefile.am: Move most stuff to ... + * version.test: Prepare data files etc. + * finish.test: New. + * defs.inc: Set all envvars. + (usrname1, usrname2, username3): Use full mail address. + 2010-06-07 Werner Koch <wk@g10code.com> * Makefile.am (TESTS_ENVIRONMENT): New. Start all scripts under diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am index ba1a65529..9ea2237b9 100644 --- a/tests/openpgp/Makefile.am +++ b/tests/openpgp/Makefile.am @@ -1,4 +1,6 @@ -# Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. +# Makefile.am - For tests/openpgp +# Copyright (C) 1998, 1999, 2000, 2001, 2003, +# 2010 Free Software Foundation, Inc. # # This file is part of GnuPG. # @@ -16,15 +18,15 @@ # along with this program; if not, see <http://www.gnu.org/licenses/>. # Process this file with automake to create Makefile.in -GPG_IMPORT = ../../g10/gpg2 --homedir $(abs_builddir) \ - --quiet --yes --no-permission-warning --import # Programs required before we can run these tests. required_pgms = ../../g10/gpg2 ../../agent/gpg-agent \ - ../../tools/gpg-connect-agent + ../../tools/gpg-connect-agent ../../tools/mk-tdata TESTS_ENVIRONMENT = GNUPGHOME=$(abs_builddir) GPG_AGENT_INFO= LC_ALL=C +# Note: version.test needs to be the first test to run and finish.test +# the last one TESTS = version.test mds.test \ decrypt.test decrypt-dsa.test \ sigs.test sigs-dsa.test \ @@ -36,7 +38,7 @@ TESTS = version.test mds.test \ armdetachm.test detachm.test genkey1024.test \ conventional.test conventional-mdc.test \ multisig.test verify.test armor.test \ - import.test + import.test finish.test TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \ @@ -46,73 +48,34 @@ TEST_FILES = pubring.asc secring.asc plain-1o.asc plain-2o.asc plain-3o.asc \ bug537-test.data.asc bug894-test.asc \ bug1223-good.asc bug1223-bogus.asc -DATA_FILES = data-500 data-9000 data-32000 data-80000 plain-large +data_files = data-500 data-9000 data-32000 data-80000 plain-large + +priv_keys = privkeys/50B2D4FA4122C212611048BC5FC31BD44393626E.asc \ + privkeys/7E201E28B6FEB2927B321F443205F4724EBE637E.asc \ + privkeys/13FDB8809B17C5547779F9D205C45F47CE0217CE.asc \ + privkeys/343D8AF79796EE107D645A2787A9D9252F924E6F.asc \ + privkeys/8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34.asc \ + privkeys/0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255.asc \ + privkeys/FD692BD59D6640A84C8422573D469F84F3B98E53.asc \ + privkeys/76F7E2B35832976B50A27A282D9B87E44577EB66.asc \ + privkeys/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD.asc + EXTRA_DIST = defs.inc $(TESTS) $(TEST_FILES) \ - mkdemodirs signdemokey + mkdemodirs signdemokey $(priv_keys) -CLEANFILES = prepared.stamp x y yy z out err $(DATA_FILES) \ +CLEANFILES = prepared.stamp x y yy z out err $(data_files) \ plain-1 plain-2 plain-3 trustdb.gpg *.lock .\#lk* \ *.test.log gpg_dearmor gpg.conf gpg-agent.conf S.gpg-agent \ - pubring.gpg secring.gpg pubring.pkr secring.skr + pubring.gpg secring.gpg pubring.pkr secring.skr \ + gnupg-test.stop DISTCLEANFILES = pubring.gpg~ random_seed - -all-local: prepared.stamp - -distclean-local: - $(srcdir)/mkdemodirs --clean - -prepared.stamp: ./pubring.gpg ./secring.gpg ./plain-1 ./plain-2 ./plain-3 \ - ./pubring.pkr ./secring.skr ./gpg_dearmor $(DATA_FILES) - $(GPG_IMPORT) $(srcdir)/pubdemo.asc - echo timestamp >./prepared.stamp - # We need to depend on a couple of programs so that the tests don't # start before all programs are built. -./gpg_dearmor: $(required_pgms) - echo '#!/bin/sh' >./gpg_dearmor - echo "../../g10/gpg2 --no-options --no-greeting \ - --no-secmem-warning --batch --dearmor" >>./gpg_dearmor - chmod 755 ./gpg_dearmor - -./pubring.gpg: $(srcdir)/pubring.asc $(srcdir)/pubdemo.asc ./gpg_dearmor - ./gpg_dearmor > ./pubring.gpg < $(srcdir)/pubring.asc - -./secring.gpg: $(srcdir)/secring.asc ./gpg_dearmor - ./gpg_dearmor > ./secring.gpg < $(srcdir)/secring.asc +all-local: $(required_pgms) -./pubring.pkr: $(srcdir)/pubring.pkr.asc ./gpg_dearmor - ./gpg_dearmor > ./pubring.pkr < $(srcdir)/pubring.pkr.asc - -./secring.skr: $(srcdir)/secring.skr.asc ./gpg_dearmor - ./gpg_dearmor > ./secring.skr < $(srcdir)/secring.skr.asc - -./plain-1: $(srcdir)/plain-1o.asc ./gpg_dearmor - ./gpg_dearmor > ./plain-1 < $(srcdir)/plain-1o.asc - -./plain-2: $(srcdir)/plain-2o.asc ./gpg_dearmor - ./gpg_dearmor > ./plain-2 < $(srcdir)/plain-2o.asc - -./plain-3: $(srcdir)/plain-3o.asc ./gpg_dearmor - ./gpg_dearmor > ./plain-3 < $(srcdir)/plain-3o.asc - - -data-500: - ../../tools/mk-tdata 500 >data-500 -data-9000: - ../../tools/mk-tdata 9000 >data-9000 -data-32000: - ../../tools/mk-tdata 32000 >data-32000 -data-80000: - ../../tools/mk-tdata 80000 >data-80000 -plain-large: - cat $(srcdir)/../../doc/HACKING \ - $(srcdir)/../../doc/DETAILS \ - $(srcdir)/../../doc/gpg.texi >plain-large - -# To speed up key generation we create a dummy random seed file -random_seed: - ../../tools/mk-tdata 600 +distclean-local: + $(srcdir)/mkdemodirs --clean diff --git a/tests/openpgp/decrypt-dsa.test b/tests/openpgp/decrypt-dsa.test index 7220f8a22..ba83fea07 100755 --- a/tests/openpgp/decrypt-dsa.test +++ b/tests/openpgp/decrypt-dsa.test @@ -12,7 +12,7 @@ #info Checking decryption of supplied DSA encrypted file for i in "plain-1" ; do - $GPG $dsa_keyrings -o y --yes $srcdir/$i-pgp.asc + $GPG -o y --yes $srcdir/$i-pgp.asc cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/decrypt.test b/tests/openpgp/decrypt.test index 7b68b25ec..370dc964b 100755 --- a/tests/openpgp/decrypt.test +++ b/tests/openpgp/decrypt.test @@ -12,7 +12,7 @@ #info Checking decryption of supplied files for i in $plain_files ; do - echo "$usrpass1" | $GPG --passphrase-fd 0 -o y --yes $srcdir/$i.asc + $GPG -o y --yes $srcdir/$i.asc cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/defs.inc b/tests/openpgp/defs.inc index 1158fb0cd..bc0d76e10 100755 --- a/tests/openpgp/defs.inc +++ b/tests/openpgp/defs.inc @@ -12,22 +12,21 @@ #------ constants --------------- #-------------------------------- -# Note that usrpass1 is also used in Makefile.am -usrname1="one" +usrname1="one@example.com" usrpass1="def" -usrname2="two" +usrname2="two@example.com" usrpass2="" -usrname3="three" +usrname3="three@example.com" usrpass3="" dsa_usrname1="pgp5" -# we use the sub key because we do not yet have the logic to -# to derive the first encryption key from a keyblock (I guess) +# we use the sub key because we do not yet have the logic to to derive +# the first encryption key from a keyblock (I guess) (Well of course +# we have this by now and the notation below will lookup the primary +# first and the search for the encryption subkey.) dsa_usrname2="0xCB879DE9" -dsa_keyrings="--keyring ./pubring.pkr --secret-keyring ./secring.skr" - plain_files="plain-1 plain-2 plain-3" data_files="data-500 data-9000 data-32000 data-80000" @@ -50,6 +49,7 @@ defs_error_seen=no fatal () { echo "$pgmname: fatal:" $* >&2 echo "$pgmname: fatal:" $* >&5 + echo stop >gnupg-test.stop exit 1; } @@ -121,7 +121,7 @@ echo_n () { #} have_pubkey_algo () { - if ../../g10/gpg2 --homedir . --version | grep "Pubkey:.*$1" >/dev/null + if $GPG --version | grep "Pubkey:.*$1" >/dev/null then true else @@ -130,7 +130,7 @@ have_pubkey_algo () { } have_cipher_algo () { - if ../../g10/gpg2 --homedir . --version | grep "Cipher:.*$1" >/dev/null + if $GPG --version | grep "Cipher:.*$1" >/dev/null then true else @@ -139,7 +139,7 @@ have_cipher_algo () { } have_hash_algo () { - if ../../g10/gpg2 --homedir . --version | grep "Hash:.*$1" >/dev/null + if $GPG --version | grep "Hash:.*$1" >/dev/null then true else @@ -148,11 +148,13 @@ have_hash_algo () { } all_cipher_algos () { - ../../g10/gpg2 --homedir . --with-colons --list-config ciphername | sed 's/^cfg:ciphername://; s/;/ /g' + $GPG --with-colons --list-config ciphername \ + | sed 's/^cfg:ciphername://; s/;/ /g' } all_hash_algos () { - ../../g10/gpg2 --homedir . --with-colons --list-config digestname | sed 's/^cfg:digestname://; s/;/ /g' + $GPG --with-colons --list-config digestname \ + | sed 's/^cfg:digestname://; s/;/ /g' } set -e @@ -161,6 +163,16 @@ pgmname=`basename $0` [ -z "$srcdir" ] && fatal "not called from make" +# +if [ -f gnupg-test.stop ]; then + if [ $pgmname = "version.test" ]; then + rm gnupg-test.stop + else + # Skip the rest of the tests. + exit 77 + fi +fi + # Always work in the current directory. We set GNUPGHOME only if it # has not been set already. Usually it is set through the Makefile's # TESTS_ENVIRONMENT macro. @@ -172,21 +184,32 @@ elif [ "$GNUPGHOME" != `/bin/pwd` ]; then exit 1 fi +# We don't use GPG_AGENT_INFO anymore - better reset it. +unset GPG_AGENT_INFO + +# (--no-permission-warning makes only sense on the commandline) +GPG="../../g10/gpg2 --no-permission-warning " +# (We may not use a relative name for gpg-agent.) +GPG_AGENT="$(cd ../../agent && /bin/pwd)/gpg-agent" +GPG_CONNECT_AGENT="../../tools/gpg-connect-agent" +GPGCONF="../../tools/gpgconf" +GPG_PRESET_PASSPHRASE="../../agent/gpg-preset-passphrase" +MKTDATA="../../tools/mk-tdata" + # Make sure we have a valid option files even with VPATH builds. for f in gpg.conf gpg-agent.conf ; do if [ -f ./$f ]; then : elif [ -f $srcdir/$f.tmpl ]; then cat $srcdir/$f.tmpl >$f + if [ "$f" = "gpg.conf" ]; then + echo "agent-program $GPG_AGENT" >>gpg.conf + fi fi done -# (--no-permission-warning makes only sense on the commandline) -GPG="../../g10/gpg2 --no-permission-warning " - echo "Test: $pgmname" > ${pgmname}.log echo "GNUPGHOME=$GNUPGHOME" >> ${pgmname}.log -echo "GPG_AGENT_INFO=$GPG_AGENT_INFO" >> ${pgmname}.log exec 5>&2 2>>${pgmname}.log : diff --git a/tests/openpgp/encrypt-dsa.test b/tests/openpgp/encrypt-dsa.test index 01fe33aa8..ed474d0ed 100755 --- a/tests/openpgp/encrypt-dsa.test +++ b/tests/openpgp/encrypt-dsa.test @@ -12,17 +12,17 @@ #info Checking encryption for i in $plain_files $data_files ; do - $GPG $dsa_keyrings --always-trust -e -o x --yes -r "$dsa_usrname2" $i - $GPG $dsa_keyrings -o y --yes x + $GPG --always-trust -e -o x --yes -r "$dsa_usrname2" $i + $GPG -o y --yes x cmp $i y || error "$i: mismatch" done for ca in `all_cipher_algos` ; do echo_n "$ca " for i in $plain_files $data_files ; do - $GPG $dsa_keyrings --always-trust --cipher-algo $ca -e \ + $GPG --always-trust --cipher-algo $ca -e \ -o x --yes -r "$dsa_usrname2" $i - $GPG $dsa_keyrings -o y --yes x + $GPG -o y --yes x cmp $i y || error "$i: mismatch" done done diff --git a/tests/openpgp/finish.test b/tests/openpgp/finish.test new file mode 100755 index 000000000..fced57036 --- /dev/null +++ b/tests/openpgp/finish.test @@ -0,0 +1,17 @@ +#!/bin/sh +# Copyright 2010 Free Software Foundation, Inc. +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. This file is +# distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY, to the extent permitted by law; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +. $srcdir/defs.inc || exit 3 + +if $GPG_AGENT --quiet; then + $GPG_CONNECT_AGENT killagent /bye >/dev/null +fi + +exit 0 + diff --git a/tests/openpgp/genkey1024.test b/tests/openpgp/genkey1024.test index 1d716d86d..99a0d5d72 100755 --- a/tests/openpgp/genkey1024.test +++ b/tests/openpgp/genkey1024.test @@ -10,10 +10,7 @@ . $srcdir/defs.inc || exit 3 -# FIXME: Skip this test for now -exit 77 - -$GPG --quiet --batch --debug-quick-random --gen-key <<EOF +$GPG --quiet --batch --gen-key <<EOF Key-Type: DSA Key-Length: 1024 Subkey-Type: ELG @@ -22,12 +19,13 @@ Name-Real: Harry H. Name-Comment: test key Name-Email: hh@@ddorf.de Expire-Date: 1 -Passphrase: abc +%no-protection +%transient-key %commit EOF if have_pubkey_algo "RSA"; then -$GPG --quiet --batch --debug-quick-random --gen-key <<EOF +$GPG --quiet --batch --gen-key <<EOF Key-Type: RSA Key-Length: 1024 Key-Usage: sign,encrypt @@ -35,7 +33,8 @@ Name-Real: Harry A. Name-Comment: RSA test key Name-Email: hh@@ddorf.de Expire-Date: 2 -Passphrase: abc +%no-protection +%transient-key %commit EOF fi diff --git a/tests/openpgp/gpg-agent.conf.tmpl b/tests/openpgp/gpg-agent.conf.tmpl index 3833e0a8f..3de8fd151 100644 --- a/tests/openpgp/gpg-agent.conf.tmpl +++ b/tests/openpgp/gpg-agent.conf.tmpl @@ -1,3 +1,7 @@ use-standard-socket - +allow-preset-passphrase +no-grab +log-file socket:///home/wk/b/gnupg/tests/openpgp/S.log +debug 1024 +verbose diff --git a/tests/openpgp/mkdemodirs b/tests/openpgp/mkdemodirs index 7e6ec2c10..a381681b0 100755 --- a/tests/openpgp/mkdemodirs +++ b/tests/openpgp/mkdemodirs @@ -4,7 +4,7 @@ set -e # We need to use --no-options so that a gpg.conf from an older version # of gpg is not used. -GPG="../g10/gpg2 --no-options --batch --quiet +GPG="../../g10/gpg2 --no-options --batch --quiet --no-secmem-warning --allow-secret-key-import" NAMES='Alpha Bravo Charlie Delta Echo Foxtrot Golf Hotel India diff --git a/tests/openpgp/multisig.test b/tests/openpgp/multisig.test index 908b57842..9ad8676fd 100755 --- a/tests/openpgp/multisig.test +++ b/tests/openpgp/multisig.test @@ -132,7 +132,7 @@ cnksIEkgY2FuJ3QgZG8gdGhhdAo= for i in sig_sl_valid ; do - eval "(IFS=; echo \"\$$i\")" | ./gpg_dearmor >x + eval "(IFS=; echo \"\$$i\")" | $GPG --dearmor >x $GPG --verify x 2>/dev/null || error "valid is invalid ($i)" linefeed done @@ -145,7 +145,7 @@ done for i in sig_1ls1ls_valid sig_ls_valid \ sig_1lsls_invalid sig_lsls_invalid \ sig_lss_invalid sig_slsl_invalid ; do - eval "(IFS=; echo \"\$$i\")" | ./gpg_dearmor >x + eval "(IFS=; echo \"\$$i\")" | $GPG --dearmor >x $GPG --verify <x 2>/dev/null && error "invalid is valid ($i)" linefeed done diff --git a/tests/openpgp/privkeys/0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255.asc b/tests/openpgp/privkeys/0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255.asc new file mode 100644 index 000000000..ddf0fb975 --- /dev/null +++ b/tests/openpgp/privkeys/0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255.asc @@ -0,0 +1,12 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDExOnByaXZhdGUta2V5KDM6ZWxnKDE6cDk3OgD/BWuU2w+pPFZltSIytQ3wyNMV +HbFSG5PDdx29GCJU9RP+rWXX4jcKmilUHH9e4CSDmwcHzTNzqlmDrnZgVXd0uhNx +5LuuJ1vmTbewdraFkYJ5OjoB3Eg7LneCII8M/0UpKDE6ZzE6AikoMTp5OTY6Toef +zlcVKiPuobKfXHDhIUQPTfGic2Az47wkMoYHo9j9ZE7AWaliMdPz4jLyLfqqoU9m +H8g+vJhyAc7UnAF2Sk5466FDypdPm5F9PTW3cqqIwJM4WgkSlM8J2hxH4YtlKSgx +OngyOTob6nEVc0W4M+ZyrqMvp26DaKRnuFwcsDLsN11JLykpKQ== +=Ghie +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/13FDB8809B17C5547779F9D205C45F47CE0217CE.asc b/tests/openpgp/privkeys/13FDB8809B17C5547779F9D205C45F47CE0217CE.asc new file mode 100644 index 000000000..0c15f8cce --- /dev/null +++ b/tests/openpgp/privkeys/13FDB8809B17C5547779F9D205C45F47CE0217CE.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDExOnByaXZhdGUta2V5KDM6cnNhKDE6bjEyOToAqFJWduzk11/m0Ac/K/mab0kz +zr3UUor1bkxh4vcxJHOTZF3a9Y6t1WUpwlOXeCNkY98tRYUg6A40wFgkKz/4jdOa +iDtHW2bOqrvJmJ/wH/5zdmDpthu53JEgXUKP/+j2dfrvYTZYxy2m11DA68QK9iPS +BmksglFMQE2IJatwEAEpKDE6ZTI6AQEpKDE6ZDEyODoAvKABRIX7dtUOm2y6VyGs +ESE5D4YI1AhL0EWodt84EPEUvC1o61UuYbAe28JIHwjIKDLgDiedZ6hTBV3K5cI1 +aFHL421hDE0qtD+mVZhcRGnR2RHhr9gX6qX+4P8mV0w1nhdShwUhlFO1GuwQ2/dW +KwYdXGbDW7P58LIiudGWuSkoMTpwNjU6AMM8WAY5lr1ZdSqr39rNqntLZqoXVO4N +ibd5Tw3o/3JMVJ/xEqMykrude87nlPCAJMPlX9gjP1B57UmRxN8mGNkpKDE6cTY1 +OgDctZRfAPGvQ4vUwxG4uso9nbCtFlGYZTQgMPHfMFflUyxH9Y0zA8ujyKKYFPYX +t7Pe6Y+qqu6BG0mPqvIXe3dpKSgxOnU2NDop+y32myNaSakGsQ732PgarqitgefN +3h9Kec4kS/j85t1esYEbC9XlFluVcIUDaQHdKFpijCl6eC2oFXOkPRwJKSkp +=nyLM +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/343D8AF79796EE107D645A2787A9D9252F924E6F.asc b/tests/openpgp/privkeys/343D8AF79796EE107D645A2787A9D9252F924E6F.asc new file mode 100644 index 000000000..c674b653e --- /dev/null +++ b/tests/openpgp/privkeys/343D8AF79796EE107D645A2787A9D9252F924E6F.asc @@ -0,0 +1,17 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDExOnByaXZhdGUta2V5KDM6ZHNhKDE6cDEyOToArHGqWD0rP0Nn/c3nYELTD4m1 +gqR7f2+l1ZUMdHcweYwn/fVjaJKmbR+9GzeHWP398FWYs5mCU1DIfrZLF0nJnAJ6 +WRnN9TL+oub1BqqLvCmDSngRuZZ2gUX8DVmD8xTsPnDnG74QDUnvtnpDIAs32sg5 +dnusstrriXD8xXgt0g8pKDE6cTIxOgC449htJbbp5rkJHvBDs4YxEIkk5ykoMTpn +MTI4Ol+ITxpSMOT5R67Bu4XWoYU7nVeYURpb6LJ8LK2CV7ygECwFdRFdukiGFB+a +TP8nF6xtuXalaBuerkKp4QXVKqOIkp7MWN2TAOOg9eERHPT//whryf49meNYMPLv +KAe60udHY76Glm+Zso+24WnEwXX2od1PHVV3CItWRb7YmhgGKSgxOnkxMjg6AgXt +40h2lpiIHTjbu6fiCBzbr5j2eQX3cNoydkRphJ66bqD+DsPW/Ag0WBCQxgRaLgMr +db64fQT+fyjbTBLbC8ytt5hpCbm/q5x3TTXDAUNjoB3CnA/tQItBy7qqq/A0d3FZ +grr6AixK58uZ4wauy8LRZCph67UZ8akcgwJkmVkpKDE6eDIwOn/Y1rjZASGMK9IG +b1y/ZDKT0zkTKSkp +=muRa +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/50B2D4FA4122C212611048BC5FC31BD44393626E.asc b/tests/openpgp/privkeys/50B2D4FA4122C212611048BC5FC31BD44393626E.asc new file mode 100644 index 000000000..6233524f0 --- /dev/null +++ b/tests/openpgp/privkeys/50B2D4FA4122C212611048BC5FC31BD44393626E.asc @@ -0,0 +1,21 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDIxOnByb3RlY3RlZC1wcml2YXRlLWtleSgzOmRzYSgxOnAxMjk6AL8pJ97q5V8O +ADcGsak0uFXFP/K3BcykEjykR1OJjSNaditv9i7zC0J5n0YC7H9kD+1537ul2Jsd +d9fk/MN+BRNnCsglrns5SlbAjzvwDNnE2ydW/Ug/q58bIRIowTg9RA7mF4qHABvS +BDAXACtLe/ih5isSWOEnv2Sm3fX0kQATKSgxOnEyMToA+hTknylYwYGT/PEVQ4Jl +LPoWmqUpKDE6ZzEyOToAmfUdfU53m3Kgrg4QAzkb7AfPdIGPgUyidk1azUi3Tcko +egzm6VDYWARaYFUg9MpIOb+NBc9gCnPkOnGmgZhtMJoSjrN8TfYATOhcOYYBkT3R +eGr/BwQ34lwekfK0AD+f6FhpHexh6BDnaZYxH691330o7RXSMtFxySAEDtnaOUUp +KDE6eTEyODp8cyy2nYt0QI5Tf+t/d4WBeib2yNWVtZH/j7XpDqHLZDgVAYkazCA6 +ZF7BvLddBEqVAh1X5tqua4AXX9L4SGYb7B0LRV72alhYiWWHez126KjVgwRTUxtE +J4EnHmYJRReLlXosPIRhXSz7HFAqalPXJ0DvC9kzTQnnjPOylyMPTSkoOTpwcm90 +ZWN0ZWQyNTpvcGVucGdwLXMyazMtc2hhMS1hZXMtY2JjKCg0OnNoYTE4OnBnEA/u +YyreNzo0OTMzNjMyKTE2OtXuvrOxsl1/bOm+6zBEQZ0pODA6XEPa+d4D7F2jof/+ +sJvtf22PzAgN/qZ93eIKlJaHxQFQeOyLrghCAUyZLIBzR8dlNBG+uWhg7DBJMVnR +MhH24nqzdivp+SxlMO0XdnkmkBspKDEyOnByb3RlY3RlZC1hdDE1OjIwMTAxMDE0 +VDEyMDgxMSkpKQ== +=ZfqD +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/76F7E2B35832976B50A27A282D9B87E44577EB66.asc b/tests/openpgp/privkeys/76F7E2B35832976B50A27A282D9B87E44577EB66.asc new file mode 100644 index 000000000..79699a208 --- /dev/null +++ b/tests/openpgp/privkeys/76F7E2B35832976B50A27A282D9B87E44577EB66.asc @@ -0,0 +1,21 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDIxOnByb3RlY3RlZC1wcml2YXRlLWtleSgzOmRzYSgxOnAxMjk6ALZlsUNfTCYk +jzIsNhB0iJl4C4cuZ/IeypdosZQxm1aIC+f+E2ly3BqGbMqbmheKcdS9SQs5DSzy +s6W7XmeHDhrNzfStM/UuwiSfnM5E2cV2BgLpErKE56Kb/rf7/Ia12dObj2VV9oKr +CwSYEISRdp5YMar6J7Vvz0nz1Pqf8mq7KSgxOnEyMToAoQkjVeVGG+B/SzJ6+yif +dHWQVkcpKDE6ZzEyODoVw8i11+Plhxj9mnredV5SqI1hsLGZnPSzz2IcFP0XFDu3 +HtUEG9FxZVFRQYWNCUKTP7cv5DYvmhlhc4oG0PhwFmZFLwPPlSAFZ3jfqfkh4RiM +i01yqQGE6uOgML5ZWeQqb39Ngqf/ltWlcgNKpwVjMniMV5kfRzoupccZ+XI2oyko +MTp5MTI4OlVm585daoJeQG/Pg7LdDkVuNBDT/63LysOfw5NqI+LjUXJScSLos76r +IFLT0WOdmP74+RxFxdb31I3GYQlFjsy40e3nAi8QfaM0Q4n2WzPNkUENu7CyNccr +fn6U9sYTLr3EI/bqIRp/KwoptFcmETUL62TxKcr4abrayK+Yr/lqKSg5OnByb3Rl +Y3RlZDI1Om9wZW5wZ3AtczJrMy1zaGExLWFlcy1jYmMoKDQ6c2hhMTg6ndF2xFqT +19k3OjUyNDI4ODApMTY6QB3EeZz7Zs2uIRmjRj/ocyk4MDoN3zs2+IgNNxe0pZQ9 +XzwAAgAA0MhK4ypYOdDc2fvfvCsjrhQyUW5ZQVVxFmf7hgY6YZzAlldXF9bD9DMC +JtcJmap6Xk5D7VClxR97yHK+ASkoMTI6cHJvdGVjdGVkLWF0MTU6MjAxMDEwMTRU +MTU0MzUyKSkp +=8r3/ +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/7E201E28B6FEB2927B321F443205F4724EBE637E.asc b/tests/openpgp/privkeys/7E201E28B6FEB2927B321F443205F4724EBE637E.asc new file mode 100644 index 000000000..7ec044856 --- /dev/null +++ b/tests/openpgp/privkeys/7E201E28B6FEB2927B321F443205F4724EBE637E.asc @@ -0,0 +1,18 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDIxOnByb3RlY3RlZC1wcml2YXRlLWtleSgzOmVsZygxOnAxMjk6AOgCS1p47zcd +ec0UvVC0phewalHUU6f7mulWr0j0ZY1RU0IOP18HAeT7INcwPcUaUvC9KYenXmYb +vO1i7sNNUCOsKUamwg+oSNMcbM3AwNwxlggTyJS1N6WzIX7MjRLUlUqtbLRhPDGl +Cltt6yeAjS0pZT646TANaBDiRIgk94ADKSgxOmcxOgUpKDE6eTEyODpGh2X1Sy+4 +Ip/RtMJDPZOY+Y6sWUN7OiM2BkdUmCLOmaOVfgrsEevKdSBBj0oVWN81U02i7jQz +hhAI3tZMFJmP/hlF7AlS5HSaLj2+t1nHAKKy70QhskINR41CCv9sHAc5gN1WrY5N +DpeI12GmqsWMPQVPUHsTTe0QsT6XbHzvCykoOTpwcm90ZWN0ZWQyNTpvcGVucGdw +LXMyazMtc2hhMS1hZXMtY2JjKCg0OnNoYTE4Or78V63MKf6HNzo0OTMzNjMyKTE2 +OkxDOAnTGrRgVCyb5u0UbCYpOTY6tghO175Vpfia/wJGrOUT0hgS3Es/EaEHv+bn +jYBeErvROJrKtUboxoGox/Qa2xxpFFhFWtR3IX6rjmqS1a5RhwEmYxFb/IzVESuZ +Kf00wS+lmJuR14ACnuAOfVF6OQP5KSgxMjpwcm90ZWN0ZWQtYXQxNToyMDEwMTAx +NFQxMjA4MTIpKSk= +=a0Os +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34.asc b/tests/openpgp/privkeys/8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34.asc new file mode 100644 index 000000000..370e8624e --- /dev/null +++ b/tests/openpgp/privkeys/8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34.asc @@ -0,0 +1,14 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDExOnByaXZhdGUta2V5KDM6ZWxnKDE6cDEyOToAzNix+drHTYCMxS8NiUZNpVTG +nWfzMjxCqVyZYt9CEm7A4JcfSbgRUppqKunwreuDmmNGFc1W+lT1oLfvJaDi/oQ/ +oubgIcq0EZ5gOUydaj961PV3ltNmaaUSZsJ6jRxaa0FB1cgx6EVB88gR6JB4mAM4 +KV+Ct/f9QzPv2TMS8qspKDE6ZzE6BikoMTp5MTI4OjdzptnsiJ124yTW5ewhvUVp +mDGuT9CuA3ggW65bjOhfravX5rfHMCXLPXMNXFgpA012vghVwun/ekkj7/rxapZm +lE28YpSDj8Pwn/lkqNAjy466My+wUeoCgg7mEg/75is2ogKzx1L52nay7BGmfS41 +5m7BBjWHsiUA6KRtFXt1KSgxOngzMTppFcbO0lgUP4k3sTNfSIfwBCt8YwBTmPk5 +a7hTI4y2KSkp +=miH9 +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD.asc b/tests/openpgp/privkeys/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD.asc new file mode 100644 index 000000000..616c69768 --- /dev/null +++ b/tests/openpgp/privkeys/A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD.asc @@ -0,0 +1,20 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDIxOnByb3RlY3RlZC1wcml2YXRlLWtleSgzOmVsZygxOnAxMjk6AJyN1x9X9Lsj +fX2Z8O9s7BzMO9OoOxFtvZw+FA0BuDs0WVYkq1GuZ9/XiO0K30zvtZnlb7NMvBfz +7xbLeYx+vKzy5xkq18+LE5dU+HKKdRQZKrrwgCsDy8tJRO447QsiLTksCDqPMaE3 +2OCRBF5nKrG5vih7/cmEhf2CuAn+2yM3KSgxOmcxOgcpKDE6eTEyODoZ5eYysaLn +AwPeqQ9vNvUyrCxUEmrvl4svG7zkkg3ZcgAbDpDQUmnijt3gEBCoAzO3c41TU5wJ +aUNBEPGPWfKcTlmBEGJWjK50QQuA2diGncxIS5SDs+QVaf434a6/KFVQcCmV7K8/ +T2S8/nuGJ/rIlFL5XovW6A/S9mYEjh2pDykoOTpwcm90ZWN0ZWQyNTpvcGVucGdw +LXMyazMtc2hhMS1hZXMtY2JjKCg0OnNoYTE4OkuRjUFO6YIJNzo0NjYwMjI0KTE2 +Or7L9Ekww4C0lZz3g61PzJEpMTkyOk7ezAcv7simMXQw+afvqUlhdoyVM4QQuhj8 +KzqjNP3IC2fSHoFECWxGfC1fNcuqzRnzs98TqAy5BDnNXSW+e+CpenWtLpID/dvb +azkeATfhMf/2KMd2Mahi6rnQ6IBnxhq1d5jLhYg00Ba1HbojEYOkCPKQlFV01bQw +mUsyQ7sMr42JvdFTI4lDmQlHfqoexpFpLCDv4eUKjvG/K7xs0uLiF4vyMLVH5H/k +6EF9HEP9sUF+aTDJXrrfHOUG1LR6/CkoMTI6cHJvdGVjdGVkLWF0MTU6MjAxMDEw +MTRUMTUzNTM4KSkp +=soiR +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/privkeys/FD692BD59D6640A84C8422573D469F84F3B98E53.asc b/tests/openpgp/privkeys/FD692BD59D6640A84C8422573D469F84F3B98E53.asc new file mode 100644 index 000000000..7b25b7a2b --- /dev/null +++ b/tests/openpgp/privkeys/FD692BD59D6640A84C8422573D469F84F3B98E53.asc @@ -0,0 +1,15 @@ +-----BEGIN PGP ARMORED FILE----- +Version: GnuPG v1.4.8 (GNU/Linux) +Comment: Use "gpg --dearmor" for unpacking + +KDExOnByaXZhdGUta2V5KDM6ZHNhKDE6cDk3OgDbbxWAbWsheUJprK6VryMTpwDi +YwMfL+92nrHqSfPqlpMWgDTia8qnpRSXbyEmSppp/6/Ygp+N3n32Kznq7PjHXiuW +LlZGvZMtzmvaMA17y0GY6oLBxS7rhASXIKa9hEUpKDE6cTIxOgD/igRZcqjTHbCv +I/mTtAPK5yJhqykoMTpnOTc6ALV10OZ7mJkWRMRYeGu1T3uwS7YYORJAHwd1fwKh +Fys7P8HZaWIXqp8EqFxk8VUEiEo3ONN9jtIRgBmTbNywKbx6WfBItoYTPEoU0UGo +oM1c/5rfmylyqwdIbMNXDhW4oykoMTp5OTc6AJNnAP6skpHlhVAmecLZT9eRzVoO +q1ivUIntK2Mh47qsL74q6BBwz2sviPU2Y3pDlbb6Ed0qJAXvdCT24hlfoGoXzkoD +InkPJTJeL0gCnwmQPjvXFFd71Cvg5LaL4lIQLSkoMTp4MjA6cZuCxaj7sT+FZqTO +y2lNfMjaQMgpKSk= +=s5nv +-----END PGP ARMORED FILE----- diff --git a/tests/openpgp/seat.test b/tests/openpgp/seat.test index 28e69256c..8a5f39904 100755 --- a/tests/openpgp/seat.test +++ b/tests/openpgp/seat.test @@ -12,7 +12,7 @@ for i in $plain_files ; do echo "$usrpass1" | $GPG --passphrase-fd 0 --always-trust -seat \ - -r two -o x --yes $i + -r two@example.com -o x --yes $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/signencrypt-dsa.test b/tests/openpgp/signencrypt-dsa.test index 77ded1213..94730998a 100755 --- a/tests/openpgp/signencrypt-dsa.test +++ b/tests/openpgp/signencrypt-dsa.test @@ -12,17 +12,17 @@ #info Checking signing and encryption for DSA for i in $plain_files $data_files ; do - $GPG $dsa_keyrings --always-trust -se -o x --yes \ + $GPG --always-trust -se -o x --yes \ -u "$dsa_usrname1" -r "$dsa_usrname2" $i - $GPG $dsa_keyrings -o y --yes x + $GPG -o y --yes x cmp $i y || error "$i: mismatch" done for da in ripemd160 sha1; do for i in $plain_files; do - $GPG $dsa_keyrings --always-trust -se -o x --yes --digest-algo $da \ + $GPG --always-trust -se -o x --yes --digest-algo $da \ -u "$dsa_usrname1" -r "$dsa_usrname2" $i - $GPG $dsa_keyrings -o y --yes x + $GPG -o y --yes x cmp $i y || error "$i: mismatch" # process only the first one break diff --git a/tests/openpgp/sigs-dsa.test b/tests/openpgp/sigs-dsa.test index 8b3b14f14..e4f812a2d 100755 --- a/tests/openpgp/sigs-dsa.test +++ b/tests/openpgp/sigs-dsa.test @@ -12,16 +12,15 @@ #info Checking DSA signatures (default digest algo) for i in $plain_files $data_files; do - $GPG $dsa_keyrings -s -o x --yes -u $dsa_usrname1 $i - $GPG $dsa_keyrings -o y --yes x + $GPG -s -o x --yes -u $dsa_usrname1 $i + $GPG -o y --yes x cmp $i y || error "$i: mismatch" done for da in ripemd160 sha1; do for i in $plain_files; do - $GPG $dsa_keyrings --digest-algo $da \ - -s -o x --yes -u $dsa_usrname1 $i - $GPG $dsa_keyrings -o y --yes x + $GPG --digest-algo $da -s -o x --yes -u $dsa_usrname1 $i + $GPG -o y --yes x cmp $i y || error "$i: mismatch" # process only the first one break diff --git a/tests/openpgp/sigs.test b/tests/openpgp/sigs.test index 86b0cdc7b..28ce9f1b1 100755 --- a/tests/openpgp/sigs.test +++ b/tests/openpgp/sigs.test @@ -11,7 +11,7 @@ . $srcdir/defs.inc || exit 3 for i in $plain_files $data_files; do - echo "$usrpass1" | $GPG --passphrase-fd 0 -s -o x --yes $i + $GPG -s -o x --yes $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/version.test b/tests/openpgp/version.test index 34733e27d..ed0f6c449 100755 --- a/tests/openpgp/version.test +++ b/tests/openpgp/version.test @@ -10,8 +10,97 @@ . $srcdir/defs.inc || exit 3 -# print the GPG version +# This is the first test run by "make check". First kill a possible +# gpg-agent process from a previous test run. +if $GPG_AGENT --quiet; then + echo "$pgmname: killing leftover gpg-agent process" >&2 + $GPG_CONNECT_AGENT killagent /bye >/dev/null + sleep 2 +fi + + +info "Deleting old files" +if [ -f Makefile -a -f $srcdir/decrypt-dsa.test ]; then + : +else + fatal "not running in the test directory" + exit 1 +fi +if [ -d private-keys-v1.d ]; then + rm private-keys-v1.d/* 2>/dev/null || true + rmdir private-keys-v1.d +fi +for i in pubring.gpg pubring.gpg~ trustdb.gpg trustdb.gpg~ ; do + [ -d "$i" ] && rm "$i" +done + +# Now start the agent right away, so that there is only one place +# where starting the agent may fail. To speed up key generation we +# create a faked random seed file. Note that we need to set the +# agent-program so that gpg-connect-agent is able to start the agent +# we are currently testing and not an already installed one. +info "Starting the agent" +$MKTDATA 600 >random_seed +if $GPG_CONNECT_AGENT -v --agent-program="$GPG_AGENT" /bye; then + : +else + error "starting the gpg-agent failed" + exit 1 +fi + + +info "Creating sample data files" +for i in 500 9000 32000 80000; do + $MKTDATA $i >data-$i +done +cat $srcdir/../../doc/HACKING \ + $srcdir/../../doc/DETAILS \ + $srcdir/../../doc/gpg.texi >plain-large + +info "Unpacking samples" +$GPG --dearmor < $srcdir/plain-1o.asc > ./plain-1 +$GPG --dearmor < $srcdir/plain-2o.asc > ./plain-2 +$GPG --dearmor < $srcdir/plain-3o.asc > ./plain-3 + +info "Storing private keys" +for i in 50B2D4FA4122C212611048BC5FC31BD44393626E \ + 7E201E28B6FEB2927B321F443205F4724EBE637E \ + 13FDB8809B17C5547779F9D205C45F47CE0217CE \ + 343D8AF79796EE107D645A2787A9D9252F924E6F \ + 8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34 \ + 0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255 \ + FD692BD59D6640A84C8422573D469F84F3B98E53 \ + 76F7E2B35832976B50A27A282D9B87E44577EB66 \ + A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD ; do + $GPG --dearmor < $srcdir/privkeys/$i.asc > private-keys-v1.d/$i.key +done + +info "Importing public demo and test keys" +$GPG --yes --import $srcdir/pubdemo.asc $srcdir/pubring.asc +$GPG --dearmor < $srcdir/pubring.pkr.asc | $GPG --yes --import + + +info "Preset passphrases" +# one@example.com +$GPG_PRESET_PASSPHRASE --preset -P def 50B2D4FA4122C212611048BC5FC31BD44393626E +$GPG_PRESET_PASSPHRASE --preset -P def 7E201E28B6FEB2927B321F443205F4724EBE637E +# alpha@example.net +$GPG_PRESET_PASSPHRASE --preset -P abc 76F7E2B35832976B50A27A282D9B87E44577EB66 +$GPG_PRESET_PASSPHRASE --preset -P abc A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD + + +# Note: secring.asc and secring.skr.asc are the original secrings for +# our test files. We don't support this as storage format anymore but +# keep the files here for reference. The actual keys have been +# extracted and put in gpg-agent's format unter privkeys/. Because +# the current gpg's import feature does not support storing of +# unprotected keys in the new gpg-agent format, we had to resort to +# some trickery to convert them. + + +info "Printing the GPG version" $GPG --version -#fixme: check that the output is correct +#fixme: check that the output is as expected + |