Address offline playback with rollbacked time
Merge from http://go/wvgerrit/47640 Test: unit/integration tests Bug: b/62058202 The usage table keeps track of license duration by using the current system time. However, if a user were to rollback the time, they can effectively continue offline playback indefinitely. This changes the way we compute time by computing offsets by which the user rollbacked the time and adding it to the current time. This change also includes a test to verify protection against rollback for usage entries that is only run when the user is root. Change-Id: I97c430e1443747b0f9759ae5390b8f5d06bdebf1
This commit is contained in:
@@ -332,9 +332,14 @@ class Session {
|
||||
// Verify the values in the PST report. The signature should have been
|
||||
// verified in GenerateReport, above.
|
||||
void VerifyPST(const Test_PST_Report& report);
|
||||
// Generate and Verify the Usage Report. If any time is greater than 10
|
||||
// minutes, it is assumed to be an absolute time, and time_since will be
|
||||
// computed relative to now.
|
||||
// Verify the Usage Report. If any time is greater than 10 minutes, it is
|
||||
// assumed to be an absolute time, and time_since will be computed relative to
|
||||
// now.
|
||||
void VerifyReport(Test_PST_Report report,
|
||||
int64_t time_license_received = 0,
|
||||
int64_t time_first_decrypt = 0,
|
||||
int64_t time_last_decrypt = 0);
|
||||
// Same as above, but generates the report with the given status.
|
||||
void GenerateVerifyReport(const std::string& pst,
|
||||
OEMCrypto_Usage_Entry_Status status,
|
||||
int64_t time_license_received = 0,
|
||||
|
||||
Reference in New Issue
Block a user