Source release 19.1.0

This commit is contained in:
Matt Feddersen
2024-03-28 19:21:54 -07:00
parent 28ec8548c6
commit b8bdfccebe
182 changed files with 10645 additions and 2040 deletions

View File

@@ -98,13 +98,6 @@
}, {
'type': 'executable',
}],
# TODO(b/139814713): For testing and internal use only.
['oemcrypto_adapter_type=="static_v15"', {
'defines': [
# This is used by the unit tests to use some v15 functions.
'TEST_OEMCRYPTO_V15',
],
}],
['oemcrypto_lib=="level3"', {
'sources': [
# The test impl of OEMCrypto_Level3FileSystem and its factory.

View File

@@ -14,6 +14,7 @@
'oemcrypto_dir': '../oemcrypto',
# Directory where widevine utilities live.
'util_dir': '../util',
'third_party_path%': '../third_party',
'metrics_target': 'cdm.gyp:metrics_proto',
'device_files_target': 'cdm.gyp:device_files',
# The path to the prebuilt CDM to test against. (iOS only)
@@ -82,13 +83,6 @@
}, {
'type': 'executable',
}],
# TODO(b/139814713): For testing and internal use only.
['oemcrypto_adapter_type=="static_v15"', {
'defines': [
# This is used by the unit tests to use some v15 functions.
'TEST_OEMCRYPTO_V15',
],
}],
['oemcrypto_lib=="level3"', {
'sources': [
# The test impl of OEMCrypto_Level3FileSystem and its factory.
@@ -146,6 +140,7 @@
'dependencies': [
'../third_party/googletest.gyp:gmock',
'../third_party/googletest.gyp:gtest',
'<(device_files_target)',
],
'conditions': [
['OS=="linux"', {

View File

@@ -100,6 +100,7 @@ class CDM_EXPORT Cdm : public ITimerClient {
kSystemStateLost = 109, // Recoverable
kOutputTooLarge = 110, // Recoverable
kNeedsServiceCertificate = 111, // Recoverable
kDeviceRevoked = 112,
// This covers errors that we do not expect (see logs for details):
kUnexpectedError = 99999,

View File

@@ -7,10 +7,10 @@
// Widevine CE CDM Version
#ifndef CDM_VERSION_MAJOR
# define CDM_VERSION_MAJOR 18
# define CDM_VERSION_MAJOR 19
#endif
#ifndef CDM_VERSION_MINOR
# define CDM_VERSION_MINOR 5
# define CDM_VERSION_MINOR 1
#endif
#ifndef CDM_VERSION_PATCH
# define CDM_VERSION_PATCH 0

View File

@@ -0,0 +1,90 @@
# Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
# source code may only be used and distributed under the Widevine License
# Agreement.
#
# Any top-level targets in this file (and their dependencies) will be built by
# the CE CDM's ./build.py build system. Refer to the distribution package's
# README for details.
{
'includes': [
'platform_properties.gypi',
],
'variables': {
# Directory where OEMCrypto header, test, and reference files lives.
'oemcrypto_dir': '../oemcrypto',
# Directory where widevine utilities live.
'util_dir': '../util',
'metrics_target': 'cdm.gyp:metrics_proto',
'device_files_target': 'cdm.gyp:device_files',
},
'targets': [{
'toolsets' : [ 'target' ],
'target_name': 'install_keybox_tool',
'sources': [
'../oemcrypto/test/install_keybox_tool.cpp',
],
'includes': [
'../oemcrypto/odk/src/kdo.gypi',
'../util/libssl_dependency.gypi',
],
'include_dirs': [
'../cdm/include',
'../core/include',
'../core/test',
'../metrics/include',
'../oemcrypto/test',
'../oemcrypto/include',
'../util/include',
'../util/test',
],
'dependencies': [
'cdm.gyp:widevine_ce_cdm_static',
'../oemcrypto/odk/src/odk.gyp:odk',
'../third_party/googletest.gyp:gmock',
'../third_party/googletest.gyp:gtest',
'<(metrics_target)',
'<(device_files_target)',
],
'defines': [
'UNIT_TEST',
'CDM_TESTS',
],
'msvs_settings': {
'VCLinkerTool': {
# Additionally, since they are loaded locally, suppress these
# warnings.
'AdditionalOptions': [
'/IGNORE:4049',
'/IGNORE:4217',
],
},
},
'conditions': [
['OS=="ios"', {
'type': 'loadable_module',
'mac_xctest_bundle': '1',
'defines': [
'GTEST_FILTER="<(gtest_filter)"',
],
'dependencies': [
'cdm_unittests.gyp:dummy_app',
],
'sources': [
'test/gtest_xctest_wrapper.mm',
],
'xcode_settings': {
'BUNDLE_LOADER': '$(TEST_HOST)',
'TEST_HOST': '<(PRODUCT_DIR)/dummy_app.app/dummy_app',
'WRAPPER_EXTENSION': 'xctest',
},
}, {
'type': 'executable',
}],
['oemcrypto_lib=="target"', {
'dependencies': [
'<(oemcrypto_gyp_path)',
],
}],
],
}],
}

View File

@@ -1499,7 +1499,9 @@ Cdm::Status CdmImpl::ConvertStatusCode(
case PRIVACY_MODE_ERROR_3:
LOGE("No service certificate installed; %s", message.c_str());
return kNeedsServiceCertificate;
case DEVICE_REVOKED:
LOGE("Device has been revoked; %s", message.c_str());
return kDeviceRevoked;
default:
LOGE("Unknown error; %s", message.c_str());
return kUnexpectedError;

View File

@@ -40,8 +40,8 @@ void Log(const char* file, const char* function, int line, LogPriority level,
}
const char* severities[] = {"ERROR", "WARN", "INFO", "DEBUG", "VERBOSE"};
if (level >=
static_cast<LogPriority>(sizeof(severities) / sizeof(*severities))) {
if (level < 0 || level >= static_cast<LogPriority>(sizeof(severities) /
sizeof(severities[0]))) {
std::string fatal_message(kFallbackLogMessage);
FormatString(&fatal_message,
"[FATAL:%s(%d):%s] Invalid log priority level: %d", file, line,

View File

@@ -278,4 +278,7 @@ bool Properties::AlwaysUseKeySetIds() { return true; }
// static
bool Properties::UseProviderIdInProvisioningRequest() { return true; }
// static
bool Properties::ForceL3() { return false; }
} // namespace wvcdm

View File

@@ -305,9 +305,9 @@ class CdmTest : public WvCdmTestBase, public Cdm::IEventListener {
std::string reply_body;
LicenseRequest lic_request;
lic_request.GetDrmMessage(http_response, reply_body);
*response = reply_body;
*response = std::move(reply_body);
} else {
*response = http_response;
*response = std::move(http_response);
}
LOGV("Reply body(hex): \n%s\n", b2a_hex(*response).c_str());
LOGV("Reply body(b64): \n%s\n", Base64SafeEncode(*response).c_str());
@@ -350,7 +350,7 @@ class CdmTest : public WvCdmTestBase, public Cdm::IEventListener {
std::map<std::string, std::string> fields;
if (UrlRequest::GetDebugHeaderFields(*response, &fields)) {
LOGD("Unexpected status code: code = %d", status_code);
for (auto field : fields) {
for (const auto& field : fields) {
LOGD("- %s: %s", field.first.c_str(), field.second.c_str());
}
}
@@ -1195,7 +1195,7 @@ TEST_F(CdmTest, Update_RevokedDrmCertError) {
signed_message.set_msg(error_msg);
signed_message.SerializeToString(&error_response);
Cdm::Status status = updateWithRetry(session_id, error_response);
EXPECT_EQ(Cdm::kUnexpectedError, status);
EXPECT_EQ(Cdm::kDeviceRevoked, status);
}
TEST_F(CdmTest, Update_UnexpectedUpdate) {