2006-08-21 22:20:23 +02:00
|
|
|
#!/bin/sh
|
2007-10-25 11:06:21 +02:00
|
|
|
# Copyright 1998,1999,2000,2001,2002,2003,2004,2005,2006,
|
|
|
|
# 2007 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.
|
2006-08-21 22:20:23 +02:00
|
|
|
|
|
|
|
. $srcdir/defs.inc || exit 3
|
|
|
|
|
2010-10-14 18:34:31 +02:00
|
|
|
# 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
|
2011-02-10 20:16:06 +01:00
|
|
|
rmdir private-keys-v1.d
|
2010-10-14 18:34:31 +02:00
|
|
|
fi
|
|
|
|
for i in pubring.gpg pubring.gpg~ trustdb.gpg trustdb.gpg~ ; do
|
2016-01-22 12:06:06 +01:00
|
|
|
[ -f "$i" ] && rm "$i"
|
2010-10-14 18:34:31 +02:00
|
|
|
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.
|
2014-10-30 09:55:51 +01:00
|
|
|
# The "|--debug-quick-random" is a hack to start gpg-agent with
|
|
|
|
# that option on the command line.
|
2010-10-14 18:34:31 +02:00
|
|
|
info "Starting the agent"
|
|
|
|
$MKTDATA 600 >random_seed
|
2014-10-30 09:55:51 +01:00
|
|
|
if $GPG_CONNECT_AGENT -v \
|
|
|
|
--agent-program="${GPG_AGENT}|--debug-quick-random" /bye; then
|
2010-10-14 18:34:31 +02:00
|
|
|
:
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
2016-01-22 12:10:57 +01:00
|
|
|
$GPG --dearmor < $srcdir/plain-largeo.asc > ./plain-large
|
2010-10-14 18:34:31 +02:00
|
|
|
|
|
|
|
info "Storing private keys"
|
|
|
|
for i in 50B2D4FA4122C212611048BC5FC31BD44393626E \
|
|
|
|
7E201E28B6FEB2927B321F443205F4724EBE637E \
|
|
|
|
13FDB8809B17C5547779F9D205C45F47CE0217CE \
|
|
|
|
343D8AF79796EE107D645A2787A9D9252F924E6F \
|
|
|
|
8B5ABF3EF9EB8D96B91A0B8C2C4401C91C834C34 \
|
|
|
|
0D6F6AD4C4C803B25470F9104E9F4E6A4CA64255 \
|
|
|
|
FD692BD59D6640A84C8422573D469F84F3B98E53 \
|
|
|
|
76F7E2B35832976B50A27A282D9B87E44577EB66 \
|
2015-12-02 20:51:52 +01:00
|
|
|
A0747D5F9425E6664F4FFBEED20FBCA79FDED2BD \
|
|
|
|
00FE67F28A52A8AA08FFAED20AF832DA916D1985 \
|
|
|
|
1DF48228FEFF3EC2481B106E0ACA8C465C662CC5 \
|
|
|
|
A2832820DC9F40751BDCD375BB0945BA33EC6B4C \
|
|
|
|
ADE710D74409777B7729A7653373D820F67892E0 \
|
|
|
|
CEFC51AF91F68A2904FBFF62C4F075A4785B803F; do
|
2010-10-14 18:34:31 +02:00
|
|
|
$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"
|
2016-05-03 11:26:06 +02:00
|
|
|
$GPG --version | awk '{print " > " $0}'
|
2006-08-21 22:20:23 +02:00
|
|
|
|
2010-10-14 18:34:31 +02:00
|
|
|
#fixme: check that the output is as expected
|