|
Packit Service |
4684c1 |
#!/bin/sh
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
# Copyright (C) 2016 Red Hat, Inc.
|
|
Packit Service |
4684c1 |
#
|
|
Packit Service |
4684c1 |
# This file is part of GnuTLS.
|
|
Packit Service |
4684c1 |
#
|
|
Packit Service |
4684c1 |
# GnuTLS is free software; you can redistribute it and/or modify it
|
|
Packit Service |
4684c1 |
# under the terms of the GNU General Public License as published by the
|
|
Packit Service |
4684c1 |
# Free Software Foundation; either version 3 of the License, or (at
|
|
Packit Service |
4684c1 |
# your option) any later version.
|
|
Packit Service |
4684c1 |
#
|
|
Packit Service |
4684c1 |
# GnuTLS is distributed in the hope that it will be useful, but
|
|
Packit Service |
4684c1 |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
4684c1 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
4684c1 |
# General Public License for more details.
|
|
Packit Service |
4684c1 |
#
|
|
Packit Service |
4684c1 |
# You should have received a copy of the GNU General Public License
|
|
Packit Service |
4684c1 |
# along with GnuTLS; if not, write to the Free Software Foundation,
|
|
Packit Service |
4684c1 |
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#set -e
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
# This checks whether OIDs > 2^32 are correctly decoded.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
srcdir="${srcdir:-.}"
|
|
Packit Service |
4684c1 |
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
|
|
Packit Service |
4684c1 |
OUTFILE="crl.$$.pem"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
if ! test -x "${CERTTOOL}"; then
|
|
Packit Service |
4684c1 |
exit 77
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
if ! test -z "${VALGRIND}"; then
|
|
Packit Service |
4684c1 |
VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=3"
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
. "${srcdir}/../scripts/common.sh"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
# crl-demo1.pem: version 2 CRL with a single extension
|
|
Packit Service |
4684c1 |
# crl-demo2.pem: version 2 CRL with two extensions (one critical)
|
|
Packit Service |
4684c1 |
# crl-demo3.pem: version 1 CRL with many revoked certificates
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
for i in "crl-demo1.pem" "crl-demo2.pem" "crl-demo3.pem";do
|
|
Packit Service |
4684c1 |
${VALGRIND} "${CERTTOOL}" --crl-info --infile "${srcdir}/data/$i" >$OUTFILE
|
|
Packit Service |
4684c1 |
if test $? != 0; then
|
|
Packit Service |
4684c1 |
echo "Could not read CRL $i"
|
|
Packit Service |
4684c1 |
exit 1
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
check_if_equal ${OUTFILE} "${srcdir}/data/$i" "warning:"
|
|
Packit Service |
4684c1 |
if test $? != 0; then
|
|
Packit Service |
4684c1 |
echo "Error in parsing cert with long OIDs"
|
|
Packit Service |
4684c1 |
exit 1
|
|
Packit Service |
4684c1 |
fi
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
done
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
rm -f "$OUTFILE"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
exit 0
|