Clock consistency checks

[ Merge from http://go/wvgerrit/33440 ]

Introduce checks to guard against clock tampering.

Bug: 62037413

Test: WV unit, integration tests on angler
Test: Manual clock rollback test
Test: Playback testing (Netflix, Play movies) on sailfish
Test: GTS test on angler
Change-Id: I47938109adb5c0f5e9aefc58eb5dac156b9f16ef
This commit is contained in:
Rahul Frias
2017-09-11 00:00:57 -07:00
parent 8309922a89
commit 1f32bef75b
2 changed files with 28 additions and 9 deletions

View File

@@ -160,6 +160,9 @@ class PolicyEngine {
// expiry time changes.
void NotifyExpirationUpdate(int64_t current_time);
// Guard against clock rollbacks
int64_t GetCurrentTime();
// set_clock() is for testing only. It alters ownership of the
// passed-in pointer.
void set_clock(Clock* clock);
@@ -191,6 +194,9 @@ class PolicyEngine {
// calculate the time where renewal retries should occur.
int64_t next_renewal_time_;
// to assist in clock rollback checks
int64_t last_recorded_current_time_;
// Used to dispatch CDM events.
CdmSessionId session_id_;
WvCdmEventListener* event_listener_;