3 # Copyright (C) 2010 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.
24 SERV="${SERV:-../../src/gnutls-serv} -q"
25 CLI="${CLI:-../../src/gnutls-cli}"
30 if test "${WINDIR}" != "";then
35 echo "Failure: $1" >&2
36 RETCODE=${RETCODE:-${2:-1}}
39 echo "Checking OpenPGP certificate verification"
41 $SERV -p $PORT --pgpcertfile $srcdir/srv-public-127.0.0.1-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
42 trap "kill $PID" 1 15 2
44 # give the server a chance to initialize
47 #gnutls currently only considers PGP certificates verified only if
48 #all user IDs in the certificate were signed.
50 #$CLI -p $PORT 127.0.0.1 --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
51 # fail "Connection to verified IP address should have succeeded! (error code $?)" $?
53 $CLI $DEBUG -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
54 fail "Connection to unrecognized IP address should have failed!"
56 $CLI $DEBUG -p $PORT localhost --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
57 fail "Connection to unverified (but present) 'localhost' should have failed!"
62 $SERV -p $PORT --pgpcertfile $srcdir/srv-public-localhost-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
63 trap "kill $PID" 1 15 2
65 # give the server a chance to initialize
68 echo | $CLI $DEBUG -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
69 fail "Connection to unverified IP address should have failed! (error code $?)" $?
71 $CLI $DEBUG -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null 2>&1 && \
72 fail "Connection to unrecognized IP address should have failed!"
75 #$CLI -p $PORT localhost --pgpkeyring ca-public.gpg </dev/null >/dev/null || \
76 # fail "Connection to verified 'localhost' should have succeded! (error code $?)" $?
81 $SERV -p $PORT --pgpcertfile $srcdir/srv-public-all-signed.gpg --pgpkeyfile $srcdir/srv-secret.gpg >/dev/null 2>&1 & PID=$!
82 trap "kill $PID" 1 15 2
84 # give the server a chance to initialize
86 echo | $CLI $DEBUG -p $PORT 127.0.0.1 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null || \
87 fail "Connection to signed PGP certificate should have succeeded! (error code $?)" $?
89 $CLI $DEBUG -p $PORT 127.0.0.2 --pgpkeyring $srcdir/ca-public.gpg </dev/null >/dev/null && \
90 fail "Connection to unrecognized IP address should have failed!"