diff options
author | Sen Jiang <senj@google.com> | 2017-06-28 17:13:19 -0700 |
---|---|---|
committer | Sen Jiang <senj@google.com> | 2017-10-24 15:11:43 -0700 |
commit | 8e768e9359d01008b286db1f6c54a6c3972a56b9 (patch) | |
tree | 0cae4fb21b0769cca98fb3f511a53a609e8fe3b6 /common/error_code_utils.cc | |
parent | 9ae5f7f85f10997e8a3af2e2afa27891c05fbac7 (diff) |
Add maximum timestamp to the payload.
Added a new field max_timestamp in the protobuf, from now on
update_engine will reject any payload without this field.
If the OS build timestamp is newer than the max_timestamp, the payload
will also be rejected to prevent downgrade.
Bug: 36232423
Test: update_engine_unittests
Merged-In: Ib20f5f35aaf41165013bada02bc8720917358237
Change-Id: Ib20f5f35aaf41165013bada02bc8720917358237
(cherry picked from commit 5011df680621eb477cad8b34f03fba5b542cc2f9)
Diffstat (limited to 'common/error_code_utils.cc')
-rw-r--r-- | common/error_code_utils.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/error_code_utils.cc b/common/error_code_utils.cc index ad4aeeb0..0a015eb2 100644 --- a/common/error_code_utils.cc +++ b/common/error_code_utils.cc @@ -144,6 +144,8 @@ string ErrorCodeToString(ErrorCode code) { return "ErrorCode::kUserCanceled"; case ErrorCode::kNonCriticalUpdateInOOBE: return "ErrorCode::kNonCriticalUpdateInOOBE"; + case ErrorCode::kPayloadTimestampError: + return "ErrorCode::kPayloadTimestampError"; // Don't add a default case to let the compiler warn about newly added // error codes which should be added here. } |