Test signature verification by adding my new ECC key with verification
enabled, which will strip all signatures, then adding my old RSA key,
then readding my ECC key. This should result in the ECC key having a
signature from my old RSA key.
autodns.key
A v4 DSA/Elg key.
noodles.key
- My v4 DSA/Elg key.
+ My v4 RSA key.
+noodles-ecc.key
+ My v4 ECC ED25519 key.
putro.key
A v4 key with a non revocation signature on the public key.
huggie-rev.key
--- /dev/null
+#!/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