summaryrefslogtreecommitdiffstats
path: root/tests/cert-tests/cert-critical.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:33:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 07:33:12 +0000
commit36082a2fe36ecd800d784ae44c14f1f18c66a7e9 (patch)
tree6c68e0c0097987aff85a01dabddd34b862309a7c /tests/cert-tests/cert-critical.sh
parentInitial commit. (diff)
downloadgnutls28-upstream.tar.xz
gnutls28-upstream.zip
Adding upstream version 3.7.9.upstream/3.7.9upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/cert-tests/cert-critical.sh')
-rwxr-xr-xtests/cert-tests/cert-critical.sh69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/cert-tests/cert-critical.sh b/tests/cert-tests/cert-critical.sh
new file mode 100755
index 0000000..5734c3f
--- /dev/null
+++ b/tests/cert-tests/cert-critical.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# Copyright (C) 2014 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=.}
+: ${CERTTOOL=../../src/certtool${EXEEXT}}
+: ${DIFF=diff -b -B}
+
+if ! test -x "${CERTTOOL}"; then
+ exit 77
+fi
+
+if ! test -z "${VALGRIND}"; then
+ VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND}"
+fi
+
+export TZ="UTC"
+
+. ${srcdir}/../scripts/common.sh
+
+skip_if_no_datefudge
+
+datefudge "2017-2-28" \
+${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-root.pem
+rc=$?
+
+if test "${rc}" != "1"; then
+ echo "There was an issue verifying the chain"
+ exit 1
+fi
+
+datefudge "2017-2-28" \
+${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-endcert.pem
+rc=$?
+
+if test "${rc}" != "1"; then
+ echo "There was an issue verifying the chain"
+ exit 1
+fi
+
+datefudge "2017-2-28" \
+${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-intermediate.pem
+rc=$?
+
+if test "${rc}" != "1"; then
+ echo "There was an issue verifying the chain"
+ exit 1
+fi
+
+
+exit 0