From: Nikos Mavrogiannopoulos Date: Thu, 13 Aug 2015 09:48:15 +0000 (+0200) Subject: tests: verify CRL appending effectiveness X-Git-Tag: gnutls_3_5_0~739 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25ef007738bd7d29ea7596d3e05cdb37dd37b012;p=thirdparty%2Fgnutls.git tests: verify CRL appending effectiveness --- diff --git a/tests/cert-tests/crl b/tests/cert-tests/crl index 9afd62b2fb..e5c095d763 100755 --- a/tests/cert-tests/crl +++ b/tests/cert-tests/crl @@ -27,6 +27,7 @@ if ! test -z "${VALGRIND}"; then VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=15" fi OUTFILE=out-crl.tmp +OUTFILE2=out2-crl.tmp TMPFILE=tmp.tmpl echo "crl_next_update = 43" >$TMPFILE @@ -49,7 +50,33 @@ if test "$?" != "0"; then exit 1 fi +# check appending a certificate + +${VALGRIND} "${CERTTOOL}" --generate-crl --load-ca-privkey "${srcdir}/template-test.key" --load-ca-certificate \ + "${srcdir}/template-test.pem" --load-crl "${OUTFILE}" --load-certificate "${srcdir}/cert-ecc256.pem" --template \ + "${TMPFILE}" -d 9 >${OUTFILE2} 2>&1 +rc=$? + +# We're done. +if test "${rc}" != "0"; then + echo "CRL appending failed" + exit ${rc} +fi + +grep "Revoked certificates (153)" "${OUTFILE2}" >/dev/null 2>&1 +if test "$?" != "0"; then + echo "CRL appending didn't succeed as expected" + exit 1 +fi + +grep "Serial Number (hex): 07" "${OUTFILE2}" >/dev/null 2>&1 +if test "$?" != "0"; then + echo "CRL appending didn't succeed as expected (2)" + exit 1 +fi + rm -f "${OUTFILE}" +rm -f "${OUTFILE2}" rm -f "${TMPFILE}" exit 0