summaryrefslogtreecommitdiff
path: root/tests/nist-pkits/gnutls_test_entry
blob: a35d02643bb4f428eea1d6ee67ece1c8a84babc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

TITLE="$1"
EECERT="$2"
RESULT="$3"

./build-chain certs "${EECERT}" > chain.pem
certtool -e < chain.pem > output.txt

rm -f chain.pem

if grep 'Verification output:' output.txt > /dev/null; then
	if grep 'Verification output' output.txt | grep -v 'Verification output: Verified.' > /dev/null; then
		if test "${RESULT}" = "0"; then
			echo "<font color=red>Unexpected reject</font>"
		else
			echo "<font color=green>Reject</font>"
		fi
	else
		if test "${RESULT}" = "1"; then
			echo "<font color=red>Unexpected success</font>"
		else
			echo "<font color=green>Success</font>"
		fi
	fi
fi

rm -f output.txt