diff options
author | Ivan Hu <ivan.hu@canonical.com> | 2012-06-19 11:19:48 +0800 |
---|---|---|
committer | Jeremy Kerr <jeremy.kerr@canonical.com> | 2012-06-19 17:11:25 +0800 |
commit | 4d892eb7237b6cca58b0181947588f4381e398bc (patch) | |
tree | 5e07c4e80ead1de94f9e4ec251ba02ef02dc5c95 | |
parent | e80a975ff9637f19f82f558eb6d68491b983dc79 (diff) | |
download | sbsigntools-4d892eb7237b6cca58b0181947588f4381e398bc.tar.gz |
tests: Add a test to check invalid PKCS7 signature attaching
Add a test for the invalid PKCS7 signature attaching. This test
generates 1K of zero bytes as an invalid signature to attach.
Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rwxr-xr-x | tests/sign-invalidattach-verify.sh | 15 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 29adb2c..c1bccd4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -42,7 +42,8 @@ TESTS = sign-verify.sh \ sign-missing-cert.sh \ sign-missing-key.sh \ verify-missing-image.sh \ - verify-missing-cert.sh + verify-missing-cert.sh \ + sign-invalidattach-verify.sh EXTRA_DIST = $(test_lds) test.S $(TESTS) $(check_SCRIPTS) CLEANFILES = $(test_key) $(test_cert) $(test_image) diff --git a/tests/sign-invalidattach-verify.sh b/tests/sign-invalidattach-verify.sh new file mode 100755 index 0000000..981ac66 --- /dev/null +++ b/tests/sign-invalidattach-verify.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e + +. "$srcdir/common.sh" + +invsig="test.invsig" +dd if=/dev/zero of="$invsig" bs=1 count=1k +tmp_image=test.pecoff +cp "$image" "$tmp_image" + +set +e +"$sbattach" --attach "$invsig" "$tmp_image" +rc=$? +set -e + +test $rc -eq 1 |