diff --git a/libwvdrmengine/cdm/core/src/crypto_session.cpp b/libwvdrmengine/cdm/core/src/crypto_session.cpp index 21ad78a7..43509f23 100644 --- a/libwvdrmengine/cdm/core/src/crypto_session.cpp +++ b/libwvdrmengine/cdm/core/src/crypto_session.cpp @@ -65,6 +65,10 @@ constexpr int kMaxTerminateCountDown = 5; const std::string kStringNotAvailable = "NA"; +// TODO(b/174412779): Remove when b/170704368 is fixed. +// This is a Qualcomm specific error code +const int kRsaSsaPssSignatureLengthError = 10085; + // Constants relating to OEMCrypto resource rating tiers. These tables are // ordered by resource rating tier from lowest to highest. These should be // updated whenever the supported range of resource rating tiers changes. @@ -127,7 +131,7 @@ void AdvanceDestBuffer(OEMCrypto_DestBufferDesc* dest_buffer, size_t bytes) { return; } LOGE("Unrecognized OEMCryptoBufferType %u - doing nothing", - dest_buffer->type); + static_cast(dest_buffer->type)); } bool GetGenericSigningAlgorithm(CdmSigningAlgorithm algorithm, @@ -926,6 +930,14 @@ CdmResponseType CryptoSession::PrepareAndSignLicenseRequest( }); if (OEMCrypto_ERROR_SHORT_BUFFER != sts) { + // TODO(b/174412779): Remove when b/170704368 is fixed. + // Temporary workaround. If this error is returned the only way to + // recover is for the app to reprovision. + if (static_cast(sts) == kRsaSsaPssSignatureLengthError) { + LOGE("OEMCrypto PrepareAndSignLicenseRequest result = %d", + static_cast(sts)); + return NEED_PROVISIONING; + } return MapOEMCryptoResult(sts, GENERATE_SIGNATURE_ERROR, "PrepareAndSignLicenseRequest"); } @@ -953,6 +965,14 @@ CdmResponseType CryptoSession::PrepareAndSignLicenseRequest( core_message->resize(core_message_length); return NO_ERROR; } + // TODO(b/174412779): Remove when b/170704368 is fixed. + // Temporary workaround. If this error is returned the only way to + // recover is for the app to reprovision. + if (static_cast(sts) == kRsaSsaPssSignatureLengthError) { + LOGE("OEMCrypto PrepareAndSignLicenseRequest result = %d", + static_cast(sts)); + return NEED_PROVISIONING; + } return MapOEMCryptoResult(sts, GENERATE_SIGNATURE_ERROR, "PrepareAndSignLicenseRequest"); }