Correct GetDecryptHashSupport signature
[ Merge of http://go/wvgerrit/89906 ] The change allows the GetDecryptHashSupport method to return an error. Bug: 144851430 Test: WV android unit/integration tests Change-Id: Ib3b95788adb21b5ed0daee51ad338f9674b04c3c
This commit is contained in:
@@ -1812,26 +1812,27 @@ bool CryptoSession::GetBuildInformation(SecurityLevel security_level,
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t CryptoSession::IsDecryptHashSupported(SecurityLevel security_level) {
|
||||
bool CryptoSession::GetDecryptHashSupport(SecurityLevel security_level,
|
||||
uint32_t* decrypt_hash_support) {
|
||||
LOGV("Checking if decrypt hash is supported");
|
||||
RETURN_IF_UNINITIALIZED(false);
|
||||
RETURN_IF_NULL(decrypt_hash_support, false);
|
||||
|
||||
uint32_t secure_decrypt_support;
|
||||
WithOecReadLock("IsDecryptHashSupported", [&] {
|
||||
secure_decrypt_support = OEMCrypto_SupportsDecryptHash(security_level);
|
||||
WithOecReadLock("GetDecryptHashSupport", [&] {
|
||||
*decrypt_hash_support = OEMCrypto_SupportsDecryptHash(security_level);
|
||||
});
|
||||
switch (secure_decrypt_support) {
|
||||
switch (*decrypt_hash_support) {
|
||||
case OEMCrypto_Hash_Not_Supported:
|
||||
case OEMCrypto_CRC_Clear_Buffer:
|
||||
case OEMCrypto_Partner_Defined_Hash:
|
||||
break;
|
||||
default:
|
||||
LOGE("OEMCrypto_SupportsDecryptHash failed: result = %d",
|
||||
static_cast<int>(secure_decrypt_support));
|
||||
secure_decrypt_support = OEMCrypto_Hash_Not_Supported;
|
||||
break;
|
||||
// Not flagging an error since it is only used in test
|
||||
LOGW("OEMCrypto_SupportsDecryptHash unrecognized result = %d",
|
||||
static_cast<int>(*decrypt_hash_support));
|
||||
return false;
|
||||
}
|
||||
return secure_decrypt_support;
|
||||
return true;
|
||||
}
|
||||
|
||||
CdmResponseType CryptoSession::SetDecryptHash(uint32_t frame_number,
|
||||
|
||||
Reference in New Issue
Block a user