diff --git a/lib/hx509/test_nist_cert.in b/lib/hx509/test_nist_cert.in index 3a7c84afd..7a8d8812e 100644 --- a/lib/hx509/test_nist_cert.in +++ b/lib/hx509/test_nist_cert.in @@ -36,14 +36,27 @@ srcdir="@srcdir@" objdir="@objdir@" -nistdir=/sources/pki/nist/PKITS_data +nistdir=${objdir}/PKITS_data +nistzip=${srcdir}/data/PKITS_data.zip -test -d "$nistdir" || exit 77 +# nistzip is not distributed part of the distribution +test -f "$nistzip" || exit 77 stat="--statistic-file=${objdir}/statfile" hxtool="${TESTS_ENVIRONMENT} ./hxtool ${stat}" +if ${hxtool} info | grep 'rsa: hcrypto null RSA' > /dev/null ; then + exit 77 +fi +if ${hxtool} info | grep 'rand: not available' > /dev/null ; then + exit 77 +fi + +if [ ! -d "$nistdir" ] ; then + ( mkdir "$nistdir" && cd "$nistdir" && unzip "$nistzip" ) || { rm -rf "$nistdir" ; exit 1; } +fi + if ${hxtool} validate DIR:$nistdir/certs > /dev/null; then : else