sbsigntools/tests/sign-verify-detached.sh
James Bottomley 6c2b07fa1c Tests: Add intermediate certificate tests to the sign-verify cases
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2020-06-05 18:34:55 -07:00

17 lines
710 B
Bash
Executable file

#!/bin/bash -e
sig="test.sig"
"$sbsign" --cert "$cert" --key "$key" --detached --output $sig "$image" || exit 1
"$sbverify" --cert "$cert" --detached $sig "$image" || exit 1
"$sbverify" --cert "$intcert" --detached $sig "$image" || exit 1
# should fail because no intermediate
"$sbverify" --cert "$cacert" --detached $sig "$image" && exit 1
# now make sure everything succeeds with the intermediate added
"$sbsign" --cert "$cert" --key "$key" --addcert "$intcert" --detached --output $sig "$image" || exit 1
"$sbverify" --cert "$cert" --detached $sig "$image" || exit 1
"$sbverify" --cert "$intcert" --detached $sig "$image" || exit 1
"$sbverify" --cert "$cacert" --detached $sig "$image" || exit 1
exit 0