Blame tests/cert-tests/reject-invalid-time

Packit Service 991b93
#!/bin/sh
Packit Service 991b93
Packit Service 991b93
# Copyright (C) 2017 Red Hat, Inc.
Packit Service 991b93
#
Packit Service 991b93
# This file is part of GnuTLS.
Packit Service 991b93
#
Packit Service 991b93
# GnuTLS is free software; you can redistribute it and/or modify it
Packit Service 991b93
# under the terms of the GNU General Public License as published by the
Packit Service 991b93
# Free Software Foundation; either version 3 of the License, or (at
Packit Service 991b93
# your option) any later version.
Packit Service 991b93
#
Packit Service 991b93
# GnuTLS is distributed in the hope that it will be useful, but
Packit Service 991b93
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 991b93
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 991b93
# General Public License for more details.
Packit Service 991b93
#
Packit Service 991b93
# You should have received a copy of the GNU Lesser General Public License
Packit Service 991b93
# along with this program.  If not, see <https://www.gnu.org/licenses/>
Packit Service 991b93
Packit Service 991b93
#set -e
Packit Service 991b93
Packit Service 991b93
srcdir="${srcdir:-.}"
Packit Service 991b93
CERTTOOL="${CERTTOOL:-../../src/certtool${EXEEXT}}"
Packit Service 991b93
PKGCONFIG="${PKG_CONFIG:-$(which pkg-config)}"
Packit Service 991b93
DIFF="${DIFF:-diff -b -B}"
Packit Service 991b93
Packit Service 991b93
if ! test -x "${CERTTOOL}"; then
Packit Service 991b93
	exit 77
Packit Service 991b93
fi
Packit Service 991b93
Packit Service 991b93
if ! test -z "${VALGRIND}"; then
Packit Service 991b93
	VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
Packit Service 991b93
fi
Packit Service 991b93
Packit Service 991b93
${PKGCONFIG} --version >/dev/null || exit 77
Packit Service 991b93
Packit Service 991b93
${PKGCONFIG} --atleast-version=4.12 libtasn1 || exit 77
Packit Service 991b93
Packit Service 991b93
# Check whether certificates with invalid time fields are accepted
Packit Service 991b93
for file in openssl-invalid-time-format.pem;do
Packit Service 991b93
	${VALGRIND} "${CERTTOOL}" -i --infile "${srcdir}/data/$file"
Packit Service 991b93
	rc=$?
Packit Service 991b93
Packit Service 991b93
	if test "${rc}" = "0";then
Packit Service 991b93
		echo "file $file was accepted"
Packit Service 991b93
		exit 1
Packit Service 991b93
	fi
Packit Service 991b93
done
Packit Service 991b93
Packit Service 991b93
exit 0