]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: verify that 'certtool -i --outder' does not output text
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 10 Mar 2019 12:59:32 +0000 (13:59 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sun, 10 Mar 2019 12:59:34 +0000 (13:59 +0100)
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>
tests/cert-tests/certtool

index 5f1276e60e0381365ddd2ff1cf89281e543d8b41..90e26049a99cee57895d264d97eb7bf24be9eb46 100755 (executable)
@@ -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"