Return ERROR_INSUFFICIENT_OUTPUT_PROTECTION when appropriate am: b76eccf
am: af42233
* commit 'af422336a6e47246ce35dc4d334bc3113a6f5f8b':
Return ERROR_INSUFFICIENT_OUTPUT_PROTECTION when appropriate
Change-Id: I52260ccd31a031cba37ae77a92b1ebd754e30576
This commit is contained in:
@@ -216,7 +216,8 @@ enum CdmResponseType {
|
|||||||
SESSION_FILE_HANDLE_INIT_ERROR,
|
SESSION_FILE_HANDLE_INIT_ERROR,
|
||||||
INCORRECT_CRYPTO_MODE,
|
INCORRECT_CRYPTO_MODE,
|
||||||
INVALID_PARAMETERS_ENG_5,
|
INVALID_PARAMETERS_ENG_5,
|
||||||
DECRYPT_ERROR
|
DECRYPT_ERROR,
|
||||||
|
INSUFFICIENT_OUTPUT_PROTECTION,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CdmKeyStatus {
|
enum CdmKeyStatus {
|
||||||
|
|||||||
@@ -715,6 +715,8 @@ CdmResponseType CryptoSession::Decrypt(const CdmDecryptionParameters& params) {
|
|||||||
case OEMCrypto_ERROR_DECRYPT_FAILED:
|
case OEMCrypto_ERROR_DECRYPT_FAILED:
|
||||||
case OEMCrypto_ERROR_UNKNOWN_FAILURE:
|
case OEMCrypto_ERROR_UNKNOWN_FAILURE:
|
||||||
return DECRYPT_ERROR;
|
return DECRYPT_ERROR;
|
||||||
|
case OEMCrypto_ERROR_INSUFFICIENT_HDCP:
|
||||||
|
return INSUFFICIENT_OUTPUT_PROTECTION;
|
||||||
default:
|
default:
|
||||||
return UNKNOWN_ERROR;
|
return UNKNOWN_ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -341,6 +341,9 @@ void PrintTo(const enum CdmResponseType& value, ::std::ostream* os) {
|
|||||||
break;
|
break;
|
||||||
case DECRYPT_ERROR: *os << "DECRYPT_ERROR";
|
case DECRYPT_ERROR: *os << "DECRYPT_ERROR";
|
||||||
break;
|
break;
|
||||||
|
case INSUFFICIENT_OUTPUT_PROTECTION:
|
||||||
|
*os << "INSUFFICIENT_OUTPUT_PROTECTION";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
*os << "Unknown CdmResponseType";
|
*os << "Unknown CdmResponseType";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -361,6 +361,8 @@ static android::status_t mapCdmResponseType(wvcdm::CdmResponseType res) {
|
|||||||
return android::ERROR_DRM_CANNOT_HANDLE;
|
return android::ERROR_DRM_CANNOT_HANDLE;
|
||||||
case wvcdm::DECRYPT_ERROR:
|
case wvcdm::DECRYPT_ERROR:
|
||||||
return android::ERROR_DRM_CANNOT_HANDLE;
|
return android::ERROR_DRM_CANNOT_HANDLE;
|
||||||
|
case wvcdm::INSUFFICIENT_OUTPUT_PROTECTION:
|
||||||
|
return android::ERROR_DRM_INSUFFICIENT_OUTPUT_PROTECTION;
|
||||||
case wvcdm::UNUSED_1:
|
case wvcdm::UNUSED_1:
|
||||||
case wvcdm::UNUSED_2:
|
case wvcdm::UNUSED_2:
|
||||||
case wvcdm::UNUSED_3:
|
case wvcdm::UNUSED_3:
|
||||||
|
|||||||
@@ -217,6 +217,11 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
|||||||
"Error decrypting data: unspecified error");
|
"Error decrypting data: unspecified error");
|
||||||
// This error is actionable by the app and should be passed up.
|
// This error is actionable by the app and should be passed up.
|
||||||
return mapCdmResponseType(res);
|
return mapCdmResponseType(res);
|
||||||
|
} else if (res == wvcdm::INSUFFICIENT_OUTPUT_PROTECTION) {
|
||||||
|
errorDetailMsg->setTo(
|
||||||
|
"Error decrypting data: insufficient output protection");
|
||||||
|
// This error is actionable by the app and should be passed up.
|
||||||
|
return mapCdmResponseType(res);
|
||||||
} else {
|
} else {
|
||||||
// Swallow the specifics of other errors to obscure decrypt internals.
|
// Swallow the specifics of other errors to obscure decrypt internals.
|
||||||
return kErrorCDMGeneric;
|
return kErrorCDMGeneric;
|
||||||
@@ -268,6 +273,11 @@ ssize_t WVCryptoPlugin::decrypt(bool secure, const uint8_t key[KEY_ID_SIZE],
|
|||||||
"Error decrypting data: unspecified error");
|
"Error decrypting data: unspecified error");
|
||||||
// This error is actionable by the app and should be passed up.
|
// This error is actionable by the app and should be passed up.
|
||||||
return mapCdmResponseType(res);
|
return mapCdmResponseType(res);
|
||||||
|
} else if (res == wvcdm::INSUFFICIENT_OUTPUT_PROTECTION) {
|
||||||
|
errorDetailMsg->setTo(
|
||||||
|
"Error decrypting data: insufficient output protection");
|
||||||
|
// This error is actionable by the app and should be passed up.
|
||||||
|
return mapCdmResponseType(res);
|
||||||
} else {
|
} else {
|
||||||
// Swallow the specifics of other errors to obscure decrypt internals.
|
// Swallow the specifics of other errors to obscure decrypt internals.
|
||||||
return kErrorCDMGeneric;
|
return kErrorCDMGeneric;
|
||||||
|
|||||||
Reference in New Issue
Block a user