Adjust time for unit tests
Merge from Widevine repo of http://go/wvgerrit/96843 This CL modifies the system time used by the reference OEMCrypto so that it recovers from a clock rollback. When the clock rolls back, it now adjusts the current time and continues forward. This is needed when running unit tests on some platforms that reset the clock at the beginning of a test. Bug: 152649427 Test: unit tests on buildbot. (No production code on Android) Change-Id: I7edcdc0cd4e5938c9a54e745d3a0e008f9eb13ed
This commit is contained in:
@@ -104,8 +104,7 @@ class CryptoEngine {
|
||||
}
|
||||
|
||||
// The OEMCrypto system time. Prevents time rollback.
|
||||
// TODO(b/145836634): Combine RollbackCorrectedOfflineTime with OnlineTime().
|
||||
int64_t SystemTime() { return RollbackCorrectedOfflineTime(); }
|
||||
int64_t SystemTime();
|
||||
|
||||
// Verify that this nonce does not collide with another nonce in any session.
|
||||
virtual bool NonceCollision(uint32_t nonce);
|
||||
@@ -224,11 +223,8 @@ class CryptoEngine {
|
||||
}
|
||||
|
||||
protected:
|
||||
// System clock, measuring time in seconds.
|
||||
int64_t OnlineTime();
|
||||
|
||||
// System clock with antirollback protection, measuring time in seconds.
|
||||
int64_t RollbackCorrectedOfflineTime();
|
||||
// System clock, measuring time in seconds, including anti-rollback offset.
|
||||
int64_t MonotonicTime();
|
||||
|
||||
bool LoadOfflineTimeInfo(const std::string& file_path);
|
||||
bool SaveOfflineTimeInfo(const std::string& file_path);
|
||||
|
||||
Reference in New Issue
Block a user