Set rental clock if not already set in ODK_ParseLicense

PiperOrigin-RevId: 535020833
Merged from https://widevine-internal-review.googlesource.com/175851

Change-Id: Idc5e2123e56346b9d7c036683c184057f49ea58a
This commit is contained in:
Vicky Min
2023-05-24 16:26:48 -07:00
committed by Robert Shih
parent d5afa3fd99
commit 8f6dbdb94e
2 changed files with 8 additions and 1 deletions

View File

@@ -97,7 +97,8 @@ typedef struct {
*
* @param time_of_license_request_signed: Time that the license request was
* signed, based on OEMCrypto's system clock. This value shall be stored
* and reloaded with usage entry as time_of_license_received.
* and reloaded with usage entry as time_of_license_received. This is
* also used to track the start of the rental clock time.
* @param time_of_first_decrypt: Time of the first decrypt or call select key,
* based on OEMCrypto's system clock. This is 0 if the license has not
* been used to decrypt any data. This value shall be stored and reloaded

View File

@@ -374,6 +374,12 @@ OEMCryptoResult ODK_ParseLicense(
nonce_values->nonce = license_response.core_message.nonce_values.nonce;
nonce_values->session_id =
license_response.core_message.nonce_values.session_id;
/* Start the rental clock if not already started for reloading an offline
* license without a nonce. */
if (!parsed_license->nonce_required &&
clock_values->time_of_license_request_signed == 0) {
clock_values->time_of_license_request_signed = system_time_seconds;
}
}
bool license_load =
(parsed_license->renewal_delay_base == OEMCrypto_License_Load);