diff options
author | Simon Josefsson <simon@josefsson.org> | 2010-03-15 11:24:45 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2010-03-15 11:24:45 +0100 |
commit | add5f1bc3847a713b6e210df2d0780a7da4518ad (patch) | |
tree | 2da6446e4ec9234fe3ede7208e7776849c95eff1 | |
parent | ef37eaf0de16b2c298ce0f03eebd5f8e051b299c (diff) | |
download | gnutls-add5f1bc3847a713b6e210df2d0780a7da4518ad.tar.gz |
Backport tests/openpgp-certs fixes.
-rw-r--r-- | tests/openpgp-certs/Makefile.am | 22 | ||||
-rwxr-xr-x | tests/openpgp-certs/testselfsigs | 49 |
2 files changed, 50 insertions, 21 deletions
diff --git a/tests/openpgp-certs/Makefile.am b/tests/openpgp-certs/Makefile.am index 76fbf3a82b..eed927007e 100644 --- a/tests/openpgp-certs/Makefile.am +++ b/tests/openpgp-certs/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -# Copyright (C) 2007, 2008 Free Software Foundation +# Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc. # # This file is part of GNUTLS. # @@ -17,19 +17,19 @@ # along with this file; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -if ENABLE_OPENPGP - EXTRA_DIST = ca-public.gpg srv-public-all-signed.gpg srv-secret.gpg \ ca-secret.gpg srv-public.gpg srv-public-127.0.0.1-signed.gpg \ - srv-public-localhost-signed.gpg selfsigs/alice-mallory-badsig18.pub \ - selfsigs/alice-mallory-irrelevantsig.pub selfsigs/alice-mallory-nosig18.pub \ - selfsigs/alice.pub + srv-public-localhost-signed.gpg \ + selfsigs/alice-mallory-badsig18.pub \ + selfsigs/alice-mallory-irrelevantsig.pub \ + selfsigs/alice-mallory-nosig18.pub selfsigs/alice.pub + +dist_check_SCRIPTS = testselfsigs testcerts +if ENABLE_OPENPGP # The selftest is disabled until we can make it work under Wine and -# under Debian buildds (problem with 127.0.0.2?). Just extra-dist it -# for now. -EXTRA_DIST += testcerts testselfsigs -dist_check_SCRIPTS = testselfsigs #testcerts +# under Debian buildds (problem with 127.0.0.2?). TESTS = testselfsigs #testcerts - endif + +TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) diff --git a/tests/openpgp-certs/testselfsigs b/tests/openpgp-certs/testselfsigs index 51acd86ef4..e6609dc1de 100755 --- a/tests/openpgp-certs/testselfsigs +++ b/tests/openpgp-certs/testselfsigs @@ -1,7 +1,30 @@ -#!/bin/bash +#!/bin/sh + +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# Author: Nikos Mavrogiannopoulos +# +# This file is part of GNUTLS. +# +# GNUTLS is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# GNUTLS is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNUTLS; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +set -e srcdir="${srcdir:-.}" -CERTTOOL="${certtool:-../../src/certtool} -q" +CERTTOOL="${CERTTOOL:-../../src/certtool$EXEEXT}" + unset RETCODE fail() { @@ -11,14 +34,20 @@ fail() { echo "Checking OpenPGP certificate self verification" -( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice.pub | grep -e "^Self Signature verification: ok" ) >/dev/null || - fail "Self sig Verification should have succeeded!" +($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice.pub \ + | grep "^Self Signature verification: ok" > /dev/null) || \ + fail "Self sig Verification should have succeeded!" + +($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice-mallory-badsig18.pub \ + | grep "^Self Signature verification: failed" > /dev/null) || \ + fail "Self sig Verification should have failed!" + +($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice-mallory-irrelevantsig.pub \ + | grep "^Self Signature verification: failed" >/dev/null) || \ + fail "Self sig Verification should have failed!" -( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice-mallory-badsig18.pub | grep -e "^Self Signature verification: failed" ) >/dev/null || - fail "Self sig Verification should have failed!" -( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice-mallory-irrelevantsig.pub | grep -e "^Self Signature verification: failed" ) >/dev/null || - fail "Self sig Verification should have failed!" -( $CERTTOOL --pgp-certificate-info <$srcdir/selfsigs/alice-mallory-nosig18.pub | grep -e "^Self Signature verification: failed" ) >/dev/null || - fail "Self sig Verification should have failed!" +($CERTTOOL --pgp-certificate-info < $srcdir/selfsigs/alice-mallory-nosig18.pub \ + | grep "^Self Signature verification: failed" >/dev/null) || \ + fail "Self sig Verification should have failed!" exit ${RETCODE:-0} |