summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2019-03-10 13:59:32 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2019-03-10 13:59:34 +0100
commitc04f0301990567ecc7c3c077a49f357d2f139eb8 (patch)
treeda80237cf2da064150fdb9d849e95c41723a01df
parent8aa4fc1a5a820ace22f1fbf09d020759b3bf6452 (diff)
downloadgnutls-c04f0301990567ecc7c3c077a49f357d2f139eb8.tar.gz
tests: verify that 'certtool -i --outder' does not output texttmp-test-certtool
A common regression in the past, was certtool outputting text while writing raw DER data. Ensure that the certificate-info option does not regress. Resolves: #627 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rwxr-xr-xtests/cert-tests/certtool14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/cert-tests/certtool b/tests/cert-tests/certtool
index 5f1276e60e..90e26049a9 100755
--- a/tests/cert-tests/certtool
+++ b/tests/cert-tests/certtool
@@ -132,6 +132,20 @@ if test "${id}" != "c4880390506a849cd2d8289fb8aea8c189e635aff1054faba58658a0f107
exit 1
fi
+# Test whether certtool --outder doesn't output the informational text data
+
+${VALGRIND} "${CERTTOOL}" -i --infile "${srcdir}/data/funny-spacing.pem" --outder --outfile ${TMPFILE1}
+if test $? != 0;then
+ echo "cert output to DER failed"
+ exit 1
+fi
+
+grep 'Version:' ${TMPFILE1}
+if test $? = 0;then
+ echo "found text info in DER certificate"
+ exit 1
+fi
+
rm -f ${TMPFILE1} ${TMPFILE2}
export TZ="UTC"