Add query to CDM to get provisioning model

Bug: b/133855570
Tests: Android tests/CE CDM tests/Linux tests
Merge of http://go/wvgerrit/80163

Adds a query option to QueryStatus to get the provisioning model of the
OEMCrypto.

Change-Id: I1896984be6294a5ada9a97b63e6d9080297e92b0
This commit is contained in:
Srujan Gaddam
2019-05-29 15:55:44 -07:00
parent a178eed57d
commit dcf3f21289
3 changed files with 47 additions and 3 deletions

View File

@@ -672,6 +672,33 @@ CdmResponseType CdmEngine::QueryStatus(SecurityLevel security_level,
*query_response =
std::to_string(crypto_session->IsDecryptHashSupported(security_level));
return NO_ERROR;
} else if (query_token == QUERY_KEY_PROVISIONING_MODEL) {
CdmClientTokenType token_type = kClientTokenUninitialized;
status = crypto_session->GetProvisioningMethod(security_level, &token_type);
if (status != NO_ERROR) {
LOGW("CdmEngine::QueryStatus: GetProvisioningMethod failed: %d", status);
return status;
}
switch (token_type) {
case kClientTokenDrmCert:
*query_response = QUERY_VALUE_DRM_CERTIFICATE;
break;
case kClientTokenKeybox:
*query_response = QUERY_VALUE_KEYBOX;
break;
case kClientTokenOemCert:
*query_response = QUERY_VALUE_OEM_CERTIFICATE;
break;
case kClientTokenUninitialized:
default:
LOGW(
"CdmEngine::QueryStatus: GetProvisioningMethod returns invalid "
"token type: %d",
token_type);
return GET_PROVISIONING_METHOD_ERROR;
break;
}
return NO_ERROR;
}
M_TIME(status = crypto_session->Open(security_level),