mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-02 13:14:51 +00:00
util: signer: fix nonzero offset binary image signing bug
When signer code was ported and enhanced to work with binaries (in
addition to hex), a bug was introduced, where the signed image is
considered to always to be based at the bottom of the flash. In fact
the image could be anywhere in the flash, the actual address derived
from the input elf file should be used.
BRANCH=none
BUG=chrome-os-partner:43025
TEST=verified that when enabled, RW image is signed properly
(build/cr50/RW/ec.RW.flat starts with a signature).
Change-Id: I194bd02f932529165adcbebf4bcbd9020fc261dc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311314
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
baed1d8672
commit
b09d5ece2f
@@ -324,7 +324,7 @@ void Image::generate(const std::string& filename, bool hex_output) const {
|
||||
if (hex_output)
|
||||
toIntelHex(fout);
|
||||
else // TODO: we don't expect write to fail, can be made more robust.
|
||||
fwrite(mem_, 1, high_ - base_, fout);
|
||||
fwrite(mem_ + base_, 1, high_ - base_, fout);
|
||||
fclose(fout);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user