Report Insufficient Resources for Crypto
This merges the following changes from the Widevine CDM repository: bef58bc Add new error codes Adds new error codes to OEMCryptoCENC.h and rearranges it to more closely match the documentation. 5fcfbca Handle OEMCrypto_ERROR_INSUFFICIENT_RESOURCES on Decrypt Changes the CDM to support the new errors from the previous change. d59c09d Report Insufficient Crypto Resources Changes the DrmEngine to support the new errors from the previous change. 1085a21 Respond to Too Many Keys or Sessions Errors Allows errors around having too many keys or sessions to result in a unique error in the CDM. Bug: 9695816 Change-Id: I826bc655109fa57e4f75de7158d7f392053666b1
This commit is contained in:
@@ -153,7 +153,13 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
ALOGE("Decrypt error result in session %s during unencrypted block: %d",
|
||||
mSessionId.c_str(), res);
|
||||
errorDetailMsg->setTo("Error decrypting data.");
|
||||
return kErrorCDMGeneric;
|
||||
if (res == wvcdm::INSUFFICIENT_CRYPTO_RESOURCES) {
|
||||
// This error is actionable by the app and should be passed up.
|
||||
return mapCdmResponseType(res);
|
||||
} else {
|
||||
// Swallow the specifics of other errors to obscure decrypt internals.
|
||||
return kErrorCDMGeneric;
|
||||
}
|
||||
}
|
||||
|
||||
offset += subSample.mNumBytesOfClearData;
|
||||
@@ -175,7 +181,13 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
||||
ALOGE("Decrypt error result in session %s during encrypted block: %d",
|
||||
mSessionId.c_str(), res);
|
||||
errorDetailMsg->setTo("Error decrypting data.");
|
||||
return kErrorCDMGeneric;
|
||||
if (res == wvcdm::INSUFFICIENT_CRYPTO_RESOURCES) {
|
||||
// This error is actionable by the app and should be passed up.
|
||||
return mapCdmResponseType(res);
|
||||
} else {
|
||||
// Swallow the specifics of other errors to obscure decrypt internals.
|
||||
return kErrorCDMGeneric;
|
||||
}
|
||||
}
|
||||
|
||||
offset += subSample.mNumBytesOfEncryptedData;
|
||||
|
||||
Reference in New Issue
Block a user