Check whether key block and preamble fit in padding.
Check whether key block and preamble fit in padding.

Also add --pad as a valid option to --repack and --verify, so that
kernels with larger-than-normal padding can be verified.

BUG=chromium-os:13720
TEST=see bug 13720

Using the supplied kernel images from the bug,

vbutil_kernel --verify 007 --debug
vbutil_kernel --verify 008 --debug

These should now fail with an error that the key block extends past the padding.

Next, supply a large enough padding size that the key block and
preamble fit.  For example:

vbutil_kernel --verify 007 --pad 0x900000 --debug
vbutil_kernel --verify 008 --pad 0x900000 --debug

These should now make it past the padding check, and fail on a
subsequent test (for example, no kernel blob found).

Change-Id: I7ec32b4def29970e302bf922b96d3e206d97fe82
Reviewed-on: http://gerrit.chromium.org/gerrit/810
Reviewed-by: Gaurav Shah <2987db6a10bcfe664554a372d01e80df7fd325a3@chromium.org>
Tested-by: Randall Spangler <62698fdbb84d1779579ee80c3f39fac22017e5bc@chromium.org>

ionave/seismograph,geekboxzone/mmallow_external_vboot_reference,marineam/seismograph,geekboxzone/mmallow_external_vboot_reference,ccaapton/vboot_reference,ionave/seismograph,acorn-marvell/vboot_reference,coreboot/vboot,acorn-marvell/vboot_reference,coreboot/vboot,marineam/seismograph,ccaapton/vboot_reference,geekboxzone/mmallow_external_vboot_reference,geekboxzone/mmallow_external_vboot_reference,geekboxzone/mmallow_external_vboot_reference,acorn-marvell/vboot_reference,ccaapton/vboot_reference,coreboot/vboot,marineam/seismograph,marineam/seismograph,ionave/seismograph,coreboot/vboot,ccaapton/vboot_reference,coreboot/vboot,acorn-marvell/vboot_reference