Assume Keybox provisioning type if OTA Keybox is supported.

[ Cherry pick of http://ag/15854889 ]

[ Merge of http://go/wvgerrit/133943 and http://go/wvgerrit/134043 ]

Certain OEMCrypto implementations will not report their provisioning
method if the keybox is invalid.  If the OEMCrypto implementation
supports OTA keybox provisioning and does not report its provisioning
method, then keybox provisioning is assumed.

Bug: 187646550
Test: unit/integration/GtsMediaTestCases
Change-Id: Ie7753546e53fc73fd59803958e88edf416ee5336
This commit is contained in:
Rahul Frias
2021-09-17 09:37:12 -07:00
committed by Alex Dale
parent 7397f77343
commit e13c051129
2 changed files with 9 additions and 2 deletions

View File

@@ -301,6 +301,11 @@ CdmResponseType CryptoSession::GetProvisioningMethod(
break;
case OEMCrypto_ProvisioningError:
default:
if (static_cast<int>(method) == 0 && needs_keybox_provisioning_) {
LOGW("Overriding provisioning method, assuming keybox");
type = kClientTokenKeybox;
break;
}
LOGE("OEMCrypto_GetProvisioningMethod failed: method = %d",
static_cast<int>(method));
metrics_->oemcrypto_provisioning_method_.SetError(method);

View File

@@ -162,6 +162,8 @@ CdmResponseType OtaKeyboxProvisioner::GetProvisioningRequest(
static_cast<int>(result));
client_id->Clear();
}
LOGI("OTA request generated");
LOGV("ota_request_data = %s", b2a_hex(ota_request_data).c_str());
OtaRequest* ota_request = prov_request.mutable_android_ota_keybox_request();
ota_request->set_ota_request(ota_request_data);
@@ -255,8 +257,8 @@ CdmResponseType OtaKeyboxProvisioner::HandleProvisioningResponse(
const CdmResponseType result = crypto_session_->LoadOtaProvisioning(
kProductionKeybox, ota_response_data);
if (result == NO_ERROR) {
LOGV("OTA response successfully processed: ota_response_data = %s",
b2a_hex(ota_response_data).c_str());
LOGI("OTA response successfully processed");
LOGV("ota_response_data = %s", b2a_hex(ota_response_data).c_str());
fallback_policy_->MarkProvisioned();
response_received_ = true;
} else {