1
# Definitions for the OpenPGP test scripts -*- sh -*-
2
# Copyright 1998,1999,2000,2001,2002,2003,2004,2005,2006,
3
# 2007 Free Software Foundation, Inc.
4
# This file is free software; as a special exception the author gives
5
# unlimited permission to copy and/or distribute it, with or without
6
# modifications, as long as this notice is preserved. This file is
7
# distributed in the hope that it will be useful, but WITHOUT ANY
8
# WARRANTY, to the extent permitted by law; without even the implied
9
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
#--------------------------------
12
#------ constants ---------------
13
#--------------------------------
15
# Note that usrpass1 is also used in Makefile.am
25
# we use the sub key because we do not yet have the logic to
26
# to derive the first encryption key from a keyblock (I guess)
27
dsa_usrname2="0xCB879DE9"
29
dsa_keyrings="--keyring ./pubring.pkr --secret-keyring ./secring.skr"
32
plain_files="plain-1 plain-2 plain-3"
33
data_files="data-500 data-9000 data-32000 data-80000"
36
# The testscripts expect the original language
46
#--------------------------------
47
#------ utility functions -------
48
#--------------------------------
51
echo "$pgmname: fatal:" $* >&2
52
echo "$pgmname: fatal:" $* >&5
57
echo "$pgmname:" $* >&2
59
echo "$pgmname:" $* >&5
60
if [ x$defs_stop_on_error != xyes ]; then
65
# Call this at the start of a test and resume_error at the end to keep
66
# on running all subtests without immediately exiting on error.
68
defs_stop_on_error=yes
72
if [ x$defs_error_seen = xyes ]; then
80
echo "$pgmname:" $* >&2
81
if [ -n "${verbose+set}" ]; then
82
echo "$pgmname:" $* >&5
93
if test "$echo_n_init" = "no"; then
94
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
95
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
109
echo $echo_n_n "${1}$echo_n_c"
114
# rm $cleanup_files 2>/dev/null || true
115
# echo "#empty" >./gpg.conf
120
# cleanup_files="$cleanup_files $*"
123
have_pubkey_algo () {
124
if ../../g10/gpg2 --homedir . --version | grep "Pubkey:.*$1" >/dev/null
132
have_cipher_algo () {
133
if ../../g10/gpg2 --homedir . --version | grep "Cipher:.*$1" >/dev/null
142
if ../../g10/gpg2 --homedir . --version | grep "Hash:.*$1" >/dev/null
150
all_cipher_algos () {
151
../../g10/gpg2 --homedir . --version | grep "Cipher" | sed 's/^Cipher: //; s/,//g'
155
../../g10/gpg2 --homedir . --version | grep "Hash" | sed 's/^Hash: //; s/,//g'
160
pgmname=`basename $0`
161
#trap cleanup SIGHUP SIGINT SIGQUIT
163
[ -z "$srcdir" ] && fatal "not called from make"
165
# Make sure we have a valid option files even with VPATH builds.
166
if [ -f ./gpg.conf ]; then
168
elif [ -f $srcdir/gpg.conf.tmpl ]; then
169
cat $srcdir/gpg.conf.tmpl >gpg.conf
172
GPG="../../g10/gpg2 --no-permission-warning --homedir . "
174
exec 5>&2 2>${pgmname}.log