X-Git-Url: https://the.earth.li/gitweb/?p=onak.git;a=blobdiff_plain;f=t%2Fall-037-check-sigs.t;fp=t%2Fall-037-check-sigs.t;h=ed02c23a710fdf05963b6621c358ce1b680a55fe;hp=0000000000000000000000000000000000000000;hb=8519141e5ee46dcac44221de39c76d0def5a0088;hpb=529a576854aacb2d829f70dc940a4fd8b706b0f5 diff --git a/t/all-037-check-sigs.t b/t/all-037-check-sigs.t new file mode 100755 index 0000000..ed02c23 --- /dev/null +++ b/t/all-037-check-sigs.t @@ -0,0 +1,31 @@ +#!/bin/sh +# Check that signatures are only added when they can be verified + +set -e + +cd ${WORKDIR} +cp $1 check-sigs.ini + +trap cleanup exit +cleanup () { + rm check-sigs.ini +} +echo verify_signatures=true >> check-sigs.ini + +${BUILDDIR}/onak -b -c check-sigs.ini add < ${TESTSDIR}/../keys/noodles-ecc.key || true +if ${BUILDDIR}/onak -c $1 vindex 0x9026108FB942BEA4 2>&1 | \ + grep -q '0x94FA372B2DA8B985'; then + echo "* Did not correctly strip unknown signatures" + exit 1 +fi + +${BUILDDIR}/onak -b -c check-sigs.ini add < ${TESTSDIR}/../keys/noodles.key || true + +${BUILDDIR}/onak -b -c check-sigs.ini add < ${TESTSDIR}/../keys/noodles-ecc.key || true +if ! ${BUILDDIR}/onak -c $1 vindex 0x9026108FB942BEA4 2>&1 | \ + grep -q '0x94FA372B2DA8B985'; then + echo "* Did not correctly verify new signature" + exit 1 +fi + +exit 0