blob: 01d9cb0ac2e048b7526f24e00bd90c94e543c442 [file] [log] [blame]
Nikos Mavrogiannopoulosfda8ab92016-04-04 16:09:48 +02001#!/bin/sh
2
3# Copyright (C) 2016 Free Software Foundation, Inc.
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
Nikos Mavrogiannopoulos36b0a982016-04-05 15:50:00 +020018srcdir="${srcdir:-.}"
19
Nikos Mavrogiannopoulosfda8ab92016-04-04 16:09:48 +020020if ! test -z "${VALGRIND}";then
21VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7 --leak-check=no"
22fi
23
24ASN1DECODING="${ASN1DECODING:-../src/asn1Decoding$EXEEXT}"
25ASN1PKIX="${ASN1PKIX:-pkix.asn}"
26
27# This tests an invalid input which caused an infinite recursion
28# to certain libtasn1 versions.
29
Nikos Mavrogiannopoulos36b0a982016-04-05 15:50:00 +020030for i in "${srcdir}/invalid-x509/"*.der;do
Nikos Mavrogiannopoulos9ec2c562016-04-05 16:09:29 +020031$VALGRIND $ASN1DECODING "$ASN1PKIX" "$i" PKIX1.Certificate >/dev/null 2>&1
Nikos Mavrogiannopoulosb0d58b22016-04-08 14:03:28 +020032ret=$?
33if test $ret != 1;then
34 echo "Decoding failed for $i"
Nikos Mavrogiannopoulosfda8ab92016-04-04 16:09:48 +020035 exit 1
36fi
Nikos Mavrogiannopoulos36b0a982016-04-05 15:50:00 +020037echo "$(basename $i): ok"
38done
Nikos Mavrogiannopoulosfda8ab92016-04-04 16:09:48 +020039
40exit 0