diff --git a/tests/Makefile.am b/tests/Makefile.am index 8c16178..29adb2c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -37,7 +37,12 @@ $(test_cert): $(test_key) Makefile TESTS = sign-verify.sh \ sign-verify-detached.sh \ - sign-attach-verify.sh + sign-attach-verify.sh \ + sign-missing-image.sh \ + sign-missing-cert.sh \ + sign-missing-key.sh \ + verify-missing-image.sh \ + verify-missing-cert.sh EXTRA_DIST = $(test_lds) test.S $(TESTS) $(check_SCRIPTS) CLEANFILES = $(test_key) $(test_cert) $(test_image) diff --git a/tests/sign-missing-cert.sh b/tests/sign-missing-cert.sh new file mode 100755 index 0000000..42fc548 --- /dev/null +++ b/tests/sign-missing-cert.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +. "$srcdir/common.sh" + +signed="test.signed" + +set +e +"$sbsign" --cert "missing-cert" --key "$key" --output "$signed" "$image" +rc=$? +set -e + +test $rc -eq 1 diff --git a/tests/sign-missing-image.sh b/tests/sign-missing-image.sh new file mode 100755 index 0000000..e685ca1 --- /dev/null +++ b/tests/sign-missing-image.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +. "$srcdir/common.sh" + +signed="test.signed" + +set +e +"$sbsign" --cert "$cert" --key "$key" --output "$signed" "missing-image" +rc=$? +set -e + +test $rc -eq 1 diff --git a/tests/sign-missing-key.sh b/tests/sign-missing-key.sh new file mode 100755 index 0000000..d9dceb5 --- /dev/null +++ b/tests/sign-missing-key.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +. "$srcdir/common.sh" + +signed="test.signed" + +set +e +"$sbsign" --cert "$cert" --key "missing-key" --output "$signed" "$image" +rc=$? +set -e + +test $rc -eq 1 diff --git a/tests/verify-missing-cert.sh b/tests/verify-missing-cert.sh new file mode 100755 index 0000000..cb4fcab --- /dev/null +++ b/tests/verify-missing-cert.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +. "$srcdir/common.sh" + +signed="test.signed" + +"$sbsign" --cert "$cert" --key "$key" --output "$signed" "$image" + +set +e +"$sbverify" --cert "missing-cert" "$signed" +rc=$? +set -e + +test $rc -eq 1 diff --git a/tests/verify-missing-image.sh b/tests/verify-missing-image.sh new file mode 100755 index 0000000..cf0652c --- /dev/null +++ b/tests/verify-missing-image.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e + +. "$srcdir/common.sh" + +signed="test.signed" + +set +e +"$sbverify" "missing-image" +rc=$? +set -e + +test $rc -eq 1