aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2019-01-09 16:04:01 -0800
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2019-01-09 16:04:01 -0800
commit98d3ce77b4960785c5180277989542bfb90a9666 (patch)
treef770423ab3ac034d77d9293b9e908d2b1e5218db
parent73a13fb7e3264d8d9be7c7aa713016ce810ebe71 (diff)
downloadsbsigntools-98d3ce77b4960785c5180277989542bfb90a9666.tar.gz
src/image.c: remove alignment of regions
The old code forced region size to be aligned to the PECOFF file alignment parameter, which is correct according to the spec. However, the major UEFI platforms do not align up when checking the signature, so if the PECOFF binary being signed already contains a signature, realigning the sections will make the existing signature invalid. Fix this by relaxing the rule about aligning up (also eliminates complaints about some pecoff sections being misaligned). Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--src/image.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c
index 3e655cc..745191f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -388,8 +388,7 @@ static int image_find_regions(struct image *image)
regions = image->checksum_regions;
regions[n].data = buf + file_offset;
- regions[n].size = align_up(file_size,
- image->file_alignment);
+ regions[n].size = file_size;
regions[n].name = talloc_strndup(image->checksum_regions,
image->scnhdr[i].s_name, 8);
bytes += regions[n].size;