2 # Copyright (C) 2004 Free Software Foundation, Inc. -*- sh -*-
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.
8 # This file is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 ReadMe.txt pkits.ldif pkits.schema
17 gpgsm.conf gpg-agent.conf trustlist.txt policies.txt pubring.kbx
21 [ -z "$srcdir" ] && srcdir
=.
22 [ -z "$GPGSM" ] && GPGSM
=..
/..
/sm
/gpgsm
24 #if [ -f $srcdir/README ] \
25 # && grep tests/pkits/README README >/dev/null 2>&1; then
28 # # During make distclean the Makefile has already been removed,
29 # # so we need this extra test.
30 # if ! grep gnupg-test-pkits-directory testdir.stamp >/dev/null 2>&1; then
31 # echo "inittests: please cd to the tests/pkits directory first" >&2
36 if [ "$1" = "--clean" ]; then
37 if [ -d private-keys-v1.d
]; then
38 rm private-keys-v1.d
/* 2>/dev
/null || true
39 rmdir private-keys-v1.d
41 rm ${clean_files} testdir.stamp
2>/dev
/null || true
42 for i
in certs certpairs crls pkcs12 smime
; do
44 rm $i/* 2>/dev
/null || true
51 if [ "$GNUPGHOME" != "`/bin/pwd`" ]; then
52 echo "inittests: please set GNUPGHOME to the tests/pkits directory" >&2
56 if [ -n "$GPG_AGENT_INFO" ]; then
57 echo "inittests: please unset GPG_AGENT_INFO" >&2
61 if test -f PKITS_data.
tar.bz2
; then
62 if ! bunzip2
-c PKITS_data.
tar.bz2 |
tar xf
- ; then
63 echo "inittests: failed to untar the test data" >&2
68 # A stamp file used with --clean
69 echo gnupg-test-pkits-directory
> testdir.stamp
72 # Create the configuration scripts
73 cat > gpgsm.conf
<<EOF
79 agent-program ../../agent/gpg-agent
80 no-common-certs-import
83 # The set of NIST test policies which should be used if anyPolicy is
85 cat > policies.txt
<<EOF
86 2.16.840.1.101.3.2.1.48.1
87 2.16.840.1.101.3.2.1.48.2
88 2.16.840.1.101.3.2.1.48.3
89 2.16.840.1.101.3.2.1.48.4
90 2.16.840.1.101.3.2.1.48.5
91 2.16.840.1.101.3.2.1.48.6
94 # Fixme: we need to write a dummy pinentry program
95 cat > gpg-agent.conf
<<EOF
99 # Mark the root CA trusted
100 cat > trustlist.txt
<<EOF
101 # /CN=Trust Anchor/O=Test Certificates/C=US
102 66:8A:47:56:A2:DC:88:FF:DA:B8:95:E1:3C:63:37:55:5F:0A:F7:BF S
105 # Define the standard policies as NIST test-policy-1
106 #cat >policies.txt <<EOF
107 #2.16.840.1.101.3.2.1.48.1