CDM handles mixed output warnings.
[ Merge of http://go/wvgerrit/94483 ]
With OEMCrypto V16 comes a new potential error code from calls to
DecryptCENC(). WARNING_MIXED_OUTPUT_PROTECTION may be returned by
supporting devices if one of the output devices does not meet the
required HDCP level for the decryption key/license; however the output
is instead restricted (by OEMCrypto) to devices that are secure. This
warning is informative to the CDM; but no action can/should be taken
by the CDM.
In addition, if DecryptCENC() returns an error/warning, it is likely
that the same status code will be returned on subsequent calls to
decrypt within the same crypto session. To reduce the number of logs
the CDM produces within the same crypto session only changes in error
codes are logged.
Bug: 140825538
Change-Id: Iaf9da3f0c88889525f73f3153a5977c8416286bb
(cherry picked from commit d9c703ef9e)
Merged-In: Iaf9da3f0c88889525f73f3153a5977c8416286bb
This commit is contained in:
@@ -1476,10 +1476,29 @@ CdmResponseType CryptoSession::Decrypt(
|
||||
}
|
||||
|
||||
// Perform decrypt
|
||||
OEMCryptoResult sts =
|
||||
const OEMCryptoResult sts =
|
||||
DecryptMultipleSamples(oec_samples, params.cipher_mode, oec_pattern);
|
||||
|
||||
if (sts != OEMCrypto_SUCCESS && last_decrypt_error_ != sts) {
|
||||
// Decrypt errors and warnings are only logged when the error code
|
||||
// changes. This is in anticipation that if an error code is
|
||||
// returned, then the same error code is likely to be returned in
|
||||
// the next call. The calling application may make several more
|
||||
// decrypt requests before the error is handled by the app.
|
||||
last_decrypt_error_ = sts;
|
||||
if (sts == OEMCrypto_WARNING_MIXED_OUTPUT_PROTECTION) {
|
||||
LOGW(
|
||||
"OEMCrypto_DecryptCENC is warning of mixed HDCP output protection: "
|
||||
"oec_session_id = %u",
|
||||
oec_session_id_);
|
||||
} else {
|
||||
LOGE("OEMCrypto_DecryptCENC failed: status = %d", static_cast<int>(sts));
|
||||
}
|
||||
}
|
||||
|
||||
switch (sts) {
|
||||
case OEMCrypto_SUCCESS:
|
||||
case OEMCrypto_WARNING_MIXED_OUTPUT_PROTECTION:
|
||||
return NO_ERROR;
|
||||
case OEMCrypto_ERROR_INSUFFICIENT_RESOURCES:
|
||||
return INSUFFICIENT_CRYPTO_RESOURCES_5;
|
||||
|
||||
Reference in New Issue
Block a user