1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-24 10:39:57 +01:00
gnupg/tests/openpgp/version.test

108 lines
3.8 KiB
Plaintext
Raw Normal View History

#!/bin/sh
# 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.
. $srcdir/defs.inc || exit 3
2010-10-14 16:34:31 +00: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
rmdir private-keys-v1.d
2010-10-14 16:34:31 +00:00
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.
# The "|--debug-quick-random" is a hack to start gpg-agent with
# that option on the command line.
2010-10-14 16:34:31 +00:00
info "Starting the agent"
$MKTDATA 600 >random_seed
if $GPG_CONNECT_AGENT -v \
--agent-program="${GPG_AGENT}|--debug-quick-random" /bye; then
2010-10-14 16:34:31 +00: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
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
2010-10-14 16:34:31 +00:00
#fixme: check that the output is as expected