thrimbor / thinkpad-uefi-sign

GNU General Public License v3.0
54 stars 12 forks source link

Fix compatibility with images that contain data before the FFSv2 volume #2

Closed thrimbor closed 4 years ago

thrimbor commented 4 years ago

Apparently there are ThinkPad UEFI images that follow a different layout, where the FFSv2 volume is shifted back and not located directly at the start of the image. These tools currently assume that the offsets in the TCPA block are relative to the start of the file, while they actually appear to be relative to the start of the FFSv2 volume, so they don't work for these types of images.

This attempts to fix this problem by searching for the first FFSv2 volume in the image, and treating all TCPA volume offsets as relative to it. This appears to fix the problem - the unaltered image from #1 now verifies correctly. I don't possess the hardware to test a signed image though.

Closes #1.

thrimbor commented 4 years ago

Confirmed working in #1, merging.