image: add functions to add and remove signatures
Rather than setting ->sigbuf directly, add two functions to handle image signature addition and removal: image_add_signature(image, sig, sigsize); image_remove_signature(image); And warn when a signature is to be overwritten. Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
This commit is contained in:
parent
36e79114d2
commit
d27647ba69
7 changed files with 56 additions and 12 deletions
|
@ -45,7 +45,9 @@ TESTS = sign-verify.sh \
|
|||
verify-missing-image.sh \
|
||||
verify-missing-cert.sh \
|
||||
sign-invalidattach-verify.sh \
|
||||
cert-table-header.sh
|
||||
cert-table-header.sh \
|
||||
resign-warning.sh \
|
||||
reattach-warning.sh
|
||||
|
||||
EXTRA_DIST = $(test_lds) test.S $(TESTS) $(check_SCRIPTS)
|
||||
CLEANFILES = $(test_key) $(test_cert) $(test_image)
|
||||
|
|
12
tests/reattach-warning.sh
Executable file
12
tests/reattach-warning.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
. "$srcdir/common.sh"
|
||||
|
||||
signed="test.signed"
|
||||
sig="test.sig"
|
||||
|
||||
"$sbsign" --cert "$cert" --key "$key" --detached --output "$sig" "$image"
|
||||
cp "$image" "$signed"
|
||||
"$sbattach" --attach "$sig" "$signed"
|
||||
"$sbattach" --attach "$sig" "$signed" 2>&1 |
|
||||
grep '^warning: overwriting'
|
9
tests/resign-warning.sh
Executable file
9
tests/resign-warning.sh
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
. "$srcdir/common.sh"
|
||||
|
||||
signed="test.signed"
|
||||
|
||||
"$sbsign" --cert "$cert" --key "$key" --output "$signed" "$image"
|
||||
"$sbsign" --cert "$cert" --key "$key" --output "$signed" "$signed" 2>&1 |
|
||||
grep '^warning: overwriting'
|
Loading…
Add table
Add a link
Reference in a new issue