aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <JBottomley@Parallels.com>2013-09-30 19:25:37 -0700
committerJames Bottomley <JBottomley@Parallels.com>2014-12-19 16:42:37 -0800
commit592ec2188f7b9cf003fe7cb0835e93559f19156f (patch)
treea482ebd1ce85131f7778c6849c7033cb30d20d33
parentb963c5cb381527bca6d45593779f1f628cd8e7cc (diff)
downloadsbsigntools-592ec2188f7b9cf003fe7cb0835e93559f19156f.tar.gz
Fix for multi-sign
The new Tianocore multi-sign code fails now for images signed with sbsigntools. The reason is that we don't actually align the signature table, we just slap it straight after the binary data. Unfortunately, the new multi-signature code checks that our alignment offsets are correct and fails the signature for this reason. Fix by adding junk to the end of the image to align the signature section. Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--src/image.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/image.c b/src/image.c
index 10eba0e..519e288 100644
--- a/src/image.c
+++ b/src/image.c
@@ -385,7 +385,13 @@ static int image_find_regions(struct image *image)
/* record the size of non-signature data */
r = &image->checksum_regions[image->n_checksum_regions - 1];
- image->data_size = (r->data - (void *)image->buf) + r->size;
+ /*
+ * The new Tianocore multisign does a stricter check of the signatures
+ * in particular, the signature table must start at an aligned offset
+ * fix this by adding bytes to the end of the text section (which must
+ * be included in the hash)
+ */
+ image->data_size = align_up((r->data - (void *)image->buf) + r->size, 8);
return 0;
}