diff options
author | Gilad Arnold <garnold@chromium.org> | 2013-05-04 00:24:58 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-05-07 00:03:15 -0700 |
commit | 9640537ac1b6abfae866424a11e6869228fb7cac (patch) | |
tree | 8223bad816120a0f9a9a2182e9aefd1b8deca776 /scripts/update_payload/checker.py | |
parent | 382df5ce2f4b67bf0998b01c6fedcdb5c35ebef9 (diff) |
paycheck: use base64 encoding for SHA256 hashes throughout
Turns out we were using base64 when adding SHA256 data to a payload
report, but intermittently using hex encoding in error messages. This is
now fixed.
BUG=None
TEST=No mention of hex encoding in the code
TEST=gpylinted correctly
TEST=Passes unit tests
Change-Id: Id2dc2fcd154d4647cc1a076579dde7a789c09e40
Reviewed-on: https://gerrit.chromium.org/gerrit/50104
Reviewed-by: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Diffstat (limited to 'scripts/update_payload/checker.py')
-rw-r--r-- | scripts/update_payload/checker.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/update_payload/checker.py b/scripts/update_payload/checker.py index e1b08a16..13a05181 100644 --- a/scripts/update_payload/checker.py +++ b/scripts/update_payload/checker.py @@ -437,8 +437,8 @@ class PayloadChecker(object): signed_hash = signed_data[len(common.SIG_ASN1_HEADER):] if signed_hash != actual_hash: raise PayloadError('%s: signed hash (%s) different from actual (%s)' % - (sig_name, signed_hash.encode('hex'), - actual_hash.encode('hex'))) + (sig_name, common.FormatSha256(signed_hash), + common.FormatSha256(actual_hash))) @staticmethod def _CheckBlocksFitLength(length, num_blocks, block_size, length_name, @@ -837,8 +837,8 @@ class PayloadChecker(object): if op.data_sha256_hash != actual_hash.digest(): raise PayloadError( '%s: data_sha256_hash (%s) does not match actual hash (%s)' % - (op_name, op.data_sha256_hash.encode('hex'), - actual_hash.hexdigest())) + (op_name, common.FormatSha256(op.data_sha256_hash), + common.FormatSha256(actual_hash.digest()))) elif data_offset is not None: if allow_signature_in_extents: blob_hash_counts['signature'] += 1 |