summaryrefslogtreecommitdiff
path: root/tests/cert-tests/pem-decoding
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cert-tests/pem-decoding')
-rwxr-xr-xtests/cert-tests/pem-decoding42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/cert-tests/pem-decoding b/tests/cert-tests/pem-decoding
index 0222ae72af..7419656d02 100755
--- a/tests/cert-tests/pem-decoding
+++ b/tests/cert-tests/pem-decoding
@@ -179,6 +179,48 @@ if test "${rc}" != "0"; then
exit ${rc}
fi
+#check if --no-text works as expected
+${VALGRIND} "${CERTTOOL}" --certificate-info --infile "${srcdir}/data/cert-ecc256.pem" --no-text >${TMPFILE}
+rc=$?
+
+if test "${rc}" != "0"; then
+ echo "--no-text -k --certificate-info failed 1"
+ exit ${rc}
+fi
+
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+ echo "--no-text -k --certificate-info failed 2"
+ exit 1
+fi
+
+#check if --no-text works as expected
+${VALGRIND} "${CERTTOOL}" --certificate-pubkey --infile "${srcdir}/data/cert-ecc256.pem" --no-text >${TMPFILE}
+rc=$?
+
+if test "${rc}" != "0"; then
+ echo "--no-text cert pubkey failed 1"
+ exit ${rc}
+fi
+
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+ echo "--no-text cert pubkey failed 2"
+ exit 1
+fi
+
+#check if --no-text works as expected
+${VALGRIND} "${CERTTOOL}" --pubkey-info --infile "${srcdir}/data/cert-ecc256.pem" --no-text >${TMPFILE}
+rc=$?
+
+if test "${rc}" != "0"; then
+ echo "--no-text pubkey info failed 1"
+ exit ${rc}
+fi
+
+if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$\|^[A-Za-z0-9/+=]\+$\|^-----END [A-Z0-9 ]\+-----$' ${TMPFILE} ; then
+ echo "--no-text pubkey info failed 2"
+ exit 1
+fi
+
rm -f ${TMPFILE} ${TMPFILE1} ${TMPFILE2}
exit 0