MAX_ENTRIES increased to 128.
[gnutls.git] / tests / openpgp-certs / testcerts
blob6a90d14dea1c3e24ebae68011858cc49c1b1459a
1 #!/bin/sh
3 # Copyright (C) 2010-2012 Free Software Foundation, Inc.
5 # Author: Nikos Mavrogiannopoulos
7 # This file is part of GnuTLS.
9 # GnuTLS is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by the
11 # Free Software Foundation; either version 3 of the License, or (at
12 # your option) any later version.
14 # GnuTLS is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with GnuTLS; if not, write to the Free Software Foundation,
21 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 srcdir="${srcdir:-.}"
24 SERV="${SERV:-../../src/gnutls-serv} -q"
25 CLI="${CLI:-../../src/gnutls-cli}"
26 PORT="${PORT:-5557}"
27 DEBUG=""
29 if test "${WINDIR}" != "";then
30 exit 77
31 fi
33 . $srcdir/../scripts/common.sh
35 echo "Checking OpenPGP certificate verification"
37 launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
38 wait_server $PID
40 # give the server a chance to initialize
42 #gnutls currently only considers PGP certificates verified only if
43 #all user IDs in the certificate were signed.
45 #$CLI -p $PORT 127.0.0.1 --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
46 # fail "Connection to verified IP address should have succeeded! (error code $?)" $?
48 $CLI $DEBUG -p $PORT 127.0.0.2 --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
49 fail $PID "Connection to unrecognized IP address should have failed!"
51 $CLI $DEBUG -p $PORT localhost --priority NORMAL:+CTYPE-OPENPGP --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
52 fail $PID "Connection to unverified (but present) 'localhost' should have failed!"
54 kill $PID
55 wait
57 launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
58 wait_server $PID
60 echo | $CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
61 fail $PID "Connection to unverified IP address should have failed! (error code $?)" $?
63 $CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
64 fail $PID "Connection to unrecognized IP address should have failed!"
66 #see reason above
67 #$CLI -p $PORT localhost --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
68 # fail $PID "Connection to verified 'localhost' should have succeded! (error code $?)" $?
70 kill $PID
71 wait
73 launch_server $$ --priority NORMAL:+CTYPE-OPENPGP --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
74 wait_server $PID
76 # give the server a chance to initialize
77 echo | $CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null || \
78 fail $PID "Connection to signed PGP certificate should have succeeded! (error code $?)" $?
80 $CLI $DEBUG --priority NORMAL:+CTYPE-OPENPGP -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
81 fail $PID "Connection to unrecognized IP address should have failed!"
83 kill $PID
84 wait
86 exit 0