1998-02-26 17:56:31 +01:00
|
|
|
# definitions for the check scripts
|
|
|
|
|
|
|
|
#--------------------------------
|
|
|
|
#------ constants ---------------
|
|
|
|
#--------------------------------
|
|
|
|
|
|
|
|
# Note that usrpass1 is also used in Makefile.am
|
|
|
|
usrname1="one"
|
|
|
|
usrpass1="def"
|
|
|
|
usrname2="two"
|
|
|
|
usrpass2=""
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
usrname3="three"
|
|
|
|
usrpass3=""
|
1998-04-08 21:42:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
dsa_usrname2="0xCB879DE9"
|
|
|
|
|
|
|
|
dsa_keyrings="--keyring ./pubring.pkr --secret-keyring ./secring.skr"
|
|
|
|
|
|
|
|
|
1998-07-08 11:29:43 +02:00
|
|
|
plain_files="plain-1 plain-2 plain-3"
|
1998-07-14 19:10:28 +02:00
|
|
|
data_files="data-500 data-9000 data-32000 data-80000"
|
1998-02-26 17:56:31 +01:00
|
|
|
exp_files=""
|
|
|
|
|
1999-05-19 16:12:26 +02:00
|
|
|
# The testscripts expect the original language
|
|
|
|
LANG=
|
|
|
|
LANGUAGE=
|
1999-08-31 17:30:12 +02:00
|
|
|
LC_ALL=
|
2000-07-28 18:19:07 +02:00
|
|
|
LC_MESSAGES=
|
1998-02-26 17:56:31 +01:00
|
|
|
|
2006-03-06 22:28:25 +01:00
|
|
|
# Internal use.
|
|
|
|
defs_stop_on_error=no
|
|
|
|
defs_error_seen=no
|
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
#--------------------------------
|
|
|
|
#------ utility functions -------
|
|
|
|
#--------------------------------
|
|
|
|
|
|
|
|
fatal () {
|
|
|
|
echo "$pgmname: fatal:" $* >&2
|
2006-03-09 13:45:02 +01:00
|
|
|
echo "$pgmname: fatal:" $* >&5
|
1998-02-26 17:56:31 +01:00
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
error () {
|
|
|
|
echo "$pgmname:" $* >&2
|
2006-03-06 22:28:25 +01:00
|
|
|
defs_error_seen=yes
|
2006-03-09 13:45:02 +01:00
|
|
|
echo "$pgmname:" $* >&5
|
2006-03-06 22:28:25 +01:00
|
|
|
if [ x$defs_stop_on_error != xyes ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Call this at the start of a test and resume_error at the end to keep
|
|
|
|
# on running all subtests without immediately exiting on error.
|
|
|
|
suspend_error () {
|
|
|
|
defs_stop_on_error=yes
|
|
|
|
}
|
|
|
|
|
|
|
|
resume_error () {
|
|
|
|
if [ x$defs_error_seen = xyes ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
defs_stop_on_error=no
|
|
|
|
defs_error_seen=no
|
1998-02-26 17:56:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
info () {
|
|
|
|
echo "$pgmname:" $* >&2
|
2006-03-06 22:28:25 +01:00
|
|
|
if [ -n "${verbose+set}" ]; then
|
2006-03-09 13:45:02 +01:00
|
|
|
echo "$pgmname:" $* >&5
|
2006-03-06 22:28:25 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
linefeed () {
|
|
|
|
echo >&2
|
1998-02-26 17:56:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-08-04 10:45:27 +02:00
|
|
|
echo_n_init=no
|
|
|
|
echo_n () {
|
|
|
|
if test "$echo_n_init" = "no"; then
|
|
|
|
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
|
|
|
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
|
|
|
echo_n_n=
|
|
|
|
echo_n_c='
|
|
|
|
'
|
|
|
|
else
|
|
|
|
echo_n_n='-n'
|
|
|
|
echo_n_c=
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo_n_n=
|
|
|
|
echo_n_c='\c'
|
|
|
|
fi
|
|
|
|
echo_n_init=yes
|
|
|
|
fi
|
|
|
|
echo $echo_n_n "${1}$echo_n_c"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
#cleanup () {
|
|
|
|
# rm $cleanup_files 2>/dev/null || true
|
|
|
|
# echo "#empty" >./options
|
|
|
|
#}
|
|
|
|
|
|
|
|
|
|
|
|
#add_cleanup () {
|
|
|
|
# cleanup_files="$cleanup_files $*"
|
|
|
|
#}
|
|
|
|
|
* clearsig.test, conventional-mdc.test, conventional.test, defs.inc,
encrypt-dsa.test, encrypt.test, genkey1024.test, plain-1.asc,
plain-1-pgp.asc, plain-2.asc, plain-3.asc, pubring.asc, secring.asc,
sigs.test: Rework tests to work properly with a gpg binary that doesn't
have all ciphers and all pk algos. Basically, we test for the ciphers we
have, only test signing with non-160-bit hashes with RSA (we test all
hashes as hashes). Test all key lengths of AES.
2003-12-31 20:00:35 +01:00
|
|
|
have_pubkey_algo () {
|
|
|
|
if ../g10/gpg --homedir . --version | grep "Pubkey:.*$1" >/dev/null
|
|
|
|
then
|
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
have_cipher_algo () {
|
|
|
|
if ../g10/gpg --homedir . --version | grep "Cipher:.*$1" >/dev/null
|
|
|
|
then
|
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
fi
|
|
|
|
}
|
1998-02-26 17:56:31 +01:00
|
|
|
|
1998-10-25 20:00:01 +01:00
|
|
|
have_hash_algo () {
|
1999-05-06 14:26:10 +02:00
|
|
|
if ../g10/gpg --homedir . --version | grep "Hash:.*$1" >/dev/null
|
1998-11-25 12:55:58 +01:00
|
|
|
then
|
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
fi
|
1998-10-25 20:00:01 +01:00
|
|
|
}
|
|
|
|
|
1998-02-26 17:56:31 +01:00
|
|
|
set -e
|
1998-07-29 21:35:05 +02:00
|
|
|
pgmname=`basename $0`
|
1998-02-26 17:56:31 +01:00
|
|
|
#trap cleanup SIGHUP SIGINT SIGQUIT
|
|
|
|
|
1998-07-29 21:35:05 +02:00
|
|
|
[ -z "$srcdir" ] && fatal "not called from make"
|
1998-02-26 17:56:31 +01:00
|
|
|
|
2003-05-26 16:14:03 +02:00
|
|
|
# Make sure we have a valid option files even with VPATH builds.
|
|
|
|
if [ -f ./options ]; then
|
|
|
|
:
|
|
|
|
elif [ -f ./gpg.conf ]; then
|
|
|
|
:
|
|
|
|
elif [ -f $srcdir/options ]; then
|
|
|
|
cat $srcdir/options >gpg.conf
|
|
|
|
fi
|
|
|
|
|
2003-12-05 14:32:48 +01:00
|
|
|
GPG="../g10/gpg --no-permission-warning --homedir . "
|
2002-06-29 15:31:13 +02:00
|
|
|
|
2006-03-09 13:45:02 +01:00
|
|
|
exec 5>&2 2>${pgmname}.log
|
1998-02-26 17:56:31 +01:00
|
|
|
|
2002-06-29 15:31:13 +02:00
|
|
|
:
|
2003-05-26 16:14:03 +02:00
|
|
|
# end
|