Fallback to L3 if provisioning lost

Merge from Widevine repo of http://go/wvgerrit/142349

If a provisioning request is sent, but no response is loaded, we
should fall back to L3. This covers the case where the OTA request is
malformed and the provisioning server ignores it.

This might happen if the device has a bad KM key.

Test: manual testing
Bug: 210823889
Bug: 210807585
Change-Id: I951241539ace97b668868d5abf8a9811d874fb28
This commit is contained in:
Fred Gylys-Colwell
2021-12-23 00:28:41 +00:00
parent 31faf51933
commit df0cfa2daa
2 changed files with 12 additions and 0 deletions

View File

@@ -3135,6 +3135,12 @@ CdmResponseType CryptoSession::LoadOtaProvisioning(
WithOecWriteLock("LoadOtaProvisioning",
[&] { needs_keybox_provisioning_ = false; });
}
CdmResponseType result = GetSystemIdInternal(&system_id_);
if (result == NO_ERROR) {
LOGD("New system id is %d", system_id_);
} else {
LOGE("Failed to fetch system ID");
}
return MapOEMCryptoResult(status, UNKNOWN_ERROR, "LoadOtaProvisioning");
}

View File

@@ -97,6 +97,12 @@ OtaKeyboxProvisioner::OtaKeyboxProvisioner(
}
OtaKeyboxProvisioner::~OtaKeyboxProvisioner() {
// If we sent a request, and did not get a response, and we still need to
// provision, then there was an error and we should trigger fallback.
if (request_generated_ && (!response_received_) && (!IsProvisioned())) {
LOGE("OTA Provisioning not processed. Falling back to L3");
fallback_policy_->TriggerFallback();
}
crypto_session_.reset();
fallback_policy_ = nullptr;
}