summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/cert-tests/data/openpgp-invalid4.pub1
-rwxr-xr-xtests/cert-tests/openpgp-cert-parser43
2 files changed, 9 insertions, 35 deletions
diff --git a/tests/cert-tests/data/openpgp-invalid4.pub b/tests/cert-tests/data/openpgp-invalid4.pub
new file mode 100644
index 0000000000..5bd7dea14b
--- /dev/null
+++ b/tests/cert-tests/data/openpgp-invalid4.pub
@@ -0,0 +1 @@
+¶ \ No newline at end of file
diff --git a/tests/cert-tests/openpgp-cert-parser b/tests/cert-tests/openpgp-cert-parser
index 3d96848d45..d5c30f23fd 100755
--- a/tests/cert-tests/openpgp-cert-parser
+++ b/tests/cert-tests/openpgp-cert-parser
@@ -40,40 +40,13 @@ fail() {
echo "Checking OpenPGP certificate parsing"
-${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/truncated.pub" 2>&1
-rc=$?
-if test $rc != 1;then
- fail "Parsing should have errored"
-fi
-
-${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/attribute-leak-1.pub" 2>&1
-rc=$?
-if test $rc != 1;then
- fail "Parsing should have errored"
-fi
-
-${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/subpkt-leak.pub" 2>&1
-rc=$?
-if test $rc != 1;then
- fail "Parsing should have errored"
-fi
-
-${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/openpgp-invalid1.pub" 2>&1
-rc=$?
-if test $rc != 1;then
- fail "Parsing should have errored"
-fi
-
-${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/openpgp-invalid2.pub" 2>&1
-rc=$?
-if test $rc != 1;then
- fail "Parsing should have errored"
-fi
-
-${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/openpgp-invalid3.pub" 2>&1
-rc=$?
-if test $rc != 1;then
- fail "Parsing should have errored"
-fi
+for i in "truncated.pub" "attribute-leak-1.pub" "subpkt-leak.pub" "openpgp-invalid1.pub" \
+ "openpgp-invalid2.pub" "openpgp-invalid3.pub" "openpgp-invalid4.pub";do
+ ${VALGRIND} "${CERTTOOL}" --inraw --pgp-certificate-info --infile "${srcdir}/data/${i}"
+ rc=$?
+ if test $rc != 1;then
+ fail "$i: Parsing should have errored ($rc)"
+ fi
+done
exit ${RETCODE:-0}