make-signature-test 453 Bytes
Newer Older
1 2 3
#! /bin/sh

conv () {
4
    echo "$1" sexp-conv -s transport | tee test.in
5 6 7 8 9 10 11 12
}

die () {
    echo "Test failed:" "$@"
    exit 1
}

echo foo | ../tools/spki-make-signature "$srcdir/key-1" \
13
         | sexp-conv -s transport > test.in
14 15 16 17 18 19 20 21 22

echo foo | ../tools/spki-check-signature "`cat test.in`" \
     || die "Valid signature failed"

if echo fooo | ../tools/spki-check-signature "`cat test.in`" ; then
    die "Invalid signature accepted as valid"
fi

exit 0