Add rollback-prevention time methods to ref

Merge from master branch of Widevine repo of http://go/wvgerrit/66077
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/64562

Bug: b/78357351

b/62058202 addressed issues with the Level 3 OEMCrypto in guarding
against rollback. This change does something similar for the ref, so
that OEMCrypto vendors have rollback-prevention code they can refer to.

Test: linux/ce cdm unit tests
Test: tested as part of http://go/ag/5501993

Change-Id: I76128c5def2615ecbdbe94e3af1fec4a025be8c1
This commit is contained in:
Srujan Gaddam
2018-11-12 14:19:56 -08:00
committed by Fred Gylys-Colwell
parent b7e4b56934
commit 0ee5214b92
7 changed files with 135 additions and 14 deletions

View File

@@ -483,10 +483,10 @@ OEMCryptoResult SessionContext::CheckNonceOrEntry(
return OEMCrypto_SUCCESS;
}
void SessionContext::StartTimer() { timer_start_ = time(NULL); }
void SessionContext::StartTimer() { timer_start_ = ce_->OnlineTime(); }
uint32_t SessionContext::CurrentTimer() {
time_t now = time(NULL);
time_t now = ce_->OnlineTime();
return now - timer_start_;
}