summaryrefslogtreecommitdiff
path: root/scripts/update_payload/checker.py
diff options
context:
space:
mode:
authorAmin Hassani <ahassani@chromium.org>2018-12-12 23:15:30 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-12-15 12:39:13 -0800
commit72b80edb1ef2db08564929549eb8d7a1e0b24542 (patch)
tree56c720f34528c0169a11a51c1fb9f2af92469547 /scripts/update_payload/checker.py
parent8ea1957b8bd6b58ffd7d04d2f0d2d6ff6823c368 (diff)
update_payload: Fix problem with signature size on unsigned payloads
If the payload is unsigned (e.g. for test image), then the checker.sigs_file would not exist. So check for that variable before using it. BUG=chromium:794404 BUG=chromium:914705 TEST=manually signing the payload ran update_payload_check with signed and unsigned image TEST=unittests Change-Id: I871137eadef00d012ee926d12fd4eee36a454487 Reviewed-on: https://chromium-review.googlesource.com/1375023 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
Diffstat (limited to 'scripts/update_payload/checker.py')
-rw-r--r--scripts/update_payload/checker.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/update_payload/checker.py b/scripts/update_payload/checker.py
index 7a319f76..15f11ae6 100644
--- a/scripts/update_payload/checker.py
+++ b/scripts/update_payload/checker.py
@@ -1397,7 +1397,8 @@ class PayloadChecker(object):
used_payload_size = self.payload.data_offset + total_blob_size
# Major versions 2 and higher have a signature at the end, so it should be
# considered in the total size of the image.
- if self.major_version >= common.BRILLO_MAJOR_PAYLOAD_VERSION:
+ if (self.major_version >= common.BRILLO_MAJOR_PAYLOAD_VERSION and
+ self.sigs_size):
used_payload_size += self.sigs_size
if used_payload_size != payload_file_size: