Address CDM compilation warnings for android

[ Merge of http://go/wvgerrit/169230 ]

Bug: 275675184
Test: Compile and GtsMediaTestCases
Change-Id: I3dc01f383a1fae07c126782e8d3561ab724316a8
This commit is contained in:
Rahul Frias
2023-03-29 02:29:40 -07:00
parent 68e1eac8ec
commit adf03c92f4
6 changed files with 29 additions and 18 deletions

View File

@@ -214,11 +214,12 @@ OEMCryptoResult ContentKeySession::GenericVerify(const std::string& message,
}
OEMCryptoResult ContentKeySession::LoadKeysAsLicenseType(
const std::string& message, const std::string& signature,
const std::string& mac_key_iv, const std::string& mac_key,
const std::vector<CryptoKey>& keys,
const std::string& provider_session_token,
const std::string& srm_requirement, OEMCrypto_LicenseType license_type) {
const std::string& /* message */, const std::string& /* signature */,
const std::string& /* mac_key_iv */, const std::string& /* mac_key */,
const std::vector<CryptoKey>& /* keys */,
const std::string& /* provider_session_token */,
const std::string& /* srm_requirement */,
OEMCrypto_LicenseType /* license_type */) {
// TODO(b/252670759): remove all of this.
// const uint8_t* msg = reinterpret_cast<const uint8_t*>(message.data());
// cached_key_id_.clear();

View File

@@ -1074,18 +1074,20 @@ CdmResponseType CryptoSession::PrepareAndSignLicenseRequest(
"PrepareAndSignLicenseRequest");
}
CdmResponseType CryptoSession::UseSecondaryKey(bool dual_key) {
#ifdef HAS_DUAL_KEY
CdmResponseType CryptoSession::UseSecondaryKey(bool dual_key) {
OEMCryptoResult sts;
WithOecSessionLock("UseSecondaryKey", [&] {
sts = OEMCrypto_UseSecondaryKey(oec_session_id_, dual_key);
});
return MapOEMCryptoResult(sts, LOAD_KEY_ERROR, "UseSecondaryKey");
#else
return CdmResponseType(NO_ERROR);
#endif
}
#else
CdmResponseType CryptoSession::UseSecondaryKey(bool /* dual_key */) {
return CdmResponseType(NO_ERROR);
}
#endif
CdmResponseType CryptoSession::LoadLicense(const std::string& signed_message,
const std::string& core_message,

View File

@@ -234,7 +234,8 @@ CdmResponseType ServiceCertificate::EncryptRsaOaep(
}
CdmResponseType ServiceCertificate::EncryptClientId(
CryptoSession* crypto_session, const ClientIdentification* clear_client_id,
CryptoSession* /* crypto_session */,
const ClientIdentification* clear_client_id,
EncryptedClientIdentification* encrypted_client_id) const {
encrypted_client_id->set_provider_id(provider_id_);
encrypted_client_id->set_service_certificate_serial_number(serial_number_);

View File

@@ -8,6 +8,8 @@
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -406,11 +408,13 @@ class AndroidFile : public File {
return;
}
LOGD(
"Stat: path = %s, st_dev = %lu, st_ino = %lu, st_mode = 0%o (%s), "
"st_uid = %u, st_gid = %u, st_size = %ld, st_atime = %s, "
"st_mtime = %s, st_ctime = %s",
file_path(), st.st_dev, st.st_ino, st.st_mode,
StatModeToString(st.st_mode).c_str(), st.st_uid, st.st_gid, st.st_size,
"Stat: path = %s, st_dev = %" PRIu64 ", st_ino = %" PRIu64
", st_mode = 0%o (%s), st_uid = %u, st_gid = %u, st_size = %" PRId64
", st_atime = %s, st_mtime = %s, st_ctime = %s",
file_path(), static_cast<uint64_t>(st.st_dev),
static_cast<uint64_t>(st.st_ino), st.st_mode,
StatModeToString(st.st_mode).c_str(), st.st_uid, st.st_gid,
static_cast<int64_t>(st.st_size),
PosixTimeToString(st.st_atime).c_str(),
PosixTimeToString(st.st_mtime).c_str(),
PosixTimeToString(st.st_ctime).c_str());

View File

@@ -83,15 +83,16 @@ ScopedAStatus WidevineRemotelyProvisionedComponent::getHardwareInfo(
}
ScopedAStatus WidevineRemotelyProvisionedComponent::generateEcdsaP256KeyPair(
bool testMode, MacedPublicKey* macedPublicKey, bytevec* privateKeyHandle) {
bool /* testMode */, MacedPublicKey* /* macedPublicKey */,
bytevec* /* privateKeyHandle */) {
return Status("Invalid operation.");
}
ScopedAStatus WidevineRemotelyProvisionedComponent::generateCertificateRequest(
bool testMode, const vector<MacedPublicKey>& keysToSign,
const bytevec& endpointEncCertChain, const bytevec& challenge,
const bytevec& endpointEncCertChain, const bytevec& /* challenge */,
DeviceInfo* deviceInfo, ProtectedData* protectedData,
bytevec* keysToSignMac) {
bytevec* /* keysToSignMac */) {
if (!keysToSign.empty()) {
return Status("Invalid operation: Keys to sign must be empty.");
}

View File

@@ -63,6 +63,8 @@ void Log(const char* file, const char* function, int line, LogPriority level,
android_LogPriority prio = ANDROID_LOG_VERBOSE;
switch (level) {
case CDM_LOG_SILENT:
return;
case CDM_LOG_ERROR:
prio = ANDROID_LOG_ERROR;
break;