Source release 15.2.0

This commit is contained in:
John W. Bruce
2019-06-28 16:02:52 -07:00
parent 2b26dee09c
commit 2990f23065
1236 changed files with 166886 additions and 142315 deletions

View File

@@ -8,9 +8,31 @@
'variables': {
# Label as 'static' or 'dynamic' to use the respective OEMCrypto adapter.
'oemcrypto_adapter%': 'static',
# Choose type of OEMCrypto library to compile in (ref, level3, vendor).
# Production Level 1 systems should use vendor.
# Choose type of OEMCrypto library to compile in. Valid values are:
#
# 'vendor' - Production Level 1 systems should use 'vendor' to indicate that
# they are providing their own OEMCrypto library and the Widevine
# CE CDM build system is not responsible for building anything.
#
# 'ref' - The default value of 'ref' builds the OEMCrypto reference code, in
# order to allow the CE CDM to build without a vendor integration.
# This setting should *NEVER* be used in production systems and is
# for testing purposes only.
#
# 'level3' - Partners who have received a Widevine-generated Level 3 library
# should use 'level3' to indicate that the Widevine CE CDM build
# system should include it in the build.
#
# 'target' - If your vendor OEMCrypto is built using GYP and you would like
# the Widevine CE CDM build system to build it as part of the CE
# CDM build process, you can use 'target' and also set the
# variable 'oemcrypto_gyp_target' below. Most vendors will want
# to use 'vendor', above, instead. This setting exists primarily
# for Google's internal testing.
'oemcrypto_lib%': 'ref',
# You only need to set this value if you set 'oemcrypto_lib' to 'target'
# above.
'oemcrypto_gyp_target%': '',
# Override this for the location to the BoringSSL gyp file.
'boringssl_dependency%': '../third_party/boringssl/boringssl.gyp:ssl',
# Directory where OEMCrypto header, test, and reference files lives.
@@ -67,22 +89,27 @@
}],
['oemcrypto_lib=="level3"', {
'sources': [
# The test impl of OEMCrypto_Level3FileSystem and its factory.
'test/level3_file_system_ce_test.h',
'test/level3_file_system_ce_test.cpp',
'test/level3_file_system_ce_test_factory.cpp',
],
'conditions': [
# The test impl of OEMCrypto_Level3FileSystem and its factory.
'test/level3_file_system_ce_test.h',
'test/level3_file_system_ce_test.cpp',
'test/level3_file_system_ce_test_factory.cpp',
],
'conditions': [
['oemcrypto_adapter=="static"', {
'dependencies': [
'../oemcrypto/level3/oec_level3.gyp:oec_level3_static',
],
'dependencies': [
'../oemcrypto/level3/oec_level3.gyp:oec_level3_static',
],
}, {
'dependencies': [
'../oemcrypto/level3/oec_level3.gyp:oec_level3_dynamic',
],
}],
],
'dependencies': [
'../oemcrypto/level3/oec_level3.gyp:oec_level3_dynamic',
],
}],
],
}],
['oemcrypto_lib=="target"', {
'dependencies': [
'<(oemcrypto_gyp_target)',
],
}],
],
},

View File

@@ -246,9 +246,12 @@ class CDM_EXPORT Cdm : public ITimerClient {
virtual bool write(const std::string& name, const std::string& data) = 0;
virtual bool exists(const std::string& name) = 0;
virtual bool remove(const std::string& name) = 0;
// Returns the size of the given file. If the file does not exist or any
// other error occurs, this should return a negative number.
virtual int32_t size(const std::string& name) = 0;
// populates |file_names| with the name of each file in the file system.
// Populates |file_names| with the name of each file in the file system.
// This is assumed to be a flat filename space (top level directory is
// unnamed, and there are no subdirectories).
virtual bool list(std::vector<std::string>* file_names) = 0;
@@ -444,10 +447,6 @@ class CDM_EXPORT Cdm : public ITimerClient {
// determined by the CDM's current IStorage object.
virtual Status removeProvisioning() = 0;
// Remove the device's usage table.
// This calls on OEMCrypto to delete its usage records.
virtual Status removeUsageTable() = 0;
// Get the current list of offline licenses on the system.
// License storage is origin-specific, and the origin is determined by the
// CDM's current IStorage object.
@@ -554,6 +553,14 @@ class CDM_EXPORT Cdm : public ITimerClient {
// should require a release request, as is done by the remove() method.
virtual Status forceRemove(const std::string& session_id) = 0;
// Wipe the device's usage table.
// This calls on OEMCrypto to delete its usage records.
// This method deletes *all* of the usage records on the device. Generally,
// you do not want to call this method. You probably want to call
// deleteUsageRecord() or deleteAllUsageRecords(), which only operate on the
// current origin.
virtual Status removeUsageTable() = 0;
// Describes a repeating pattern as defined by the CENC 3.0 standard. A
// CENC 3.0 pattern consists of a number of encrypted blocks followed by a
// number of clear blocks, after which it repeats.

View File

@@ -1,3 +1,5 @@
// Widevine CE CDM Version
#define CDM_VERSION "15.1.0"
#ifndef CDM_VERSION
# define CDM_VERSION "15.2.0-non-prod"
#endif
#define EME_VERSION "https://www.w3.org/TR/2017/REC-encrypted-media-20170918"

View File

@@ -1413,7 +1413,7 @@ void CdmImpl::OnSessionKeysChange(const CdmSessionId& session_id,
switch (it->second) {
case kKeyStatusUsable:
map[it->first] = kUsable;
break;
continue;
case kKeyStatusExpired: {
KeyStatusMap::const_iterator it_old = map.find(it->first);
if (it_old != map.end() && it_old->second == kReleased) {
@@ -1422,22 +1422,28 @@ void CdmImpl::OnSessionKeysChange(const CdmSessionId& session_id,
} else {
map[it->first] = kExpired;
}
break;
continue;
}
case kKeyStatusOutputNotAllowed:
map[it->first] = kOutputRestricted;
break;
continue;
case kKeyStatusUsableInFuture:
case kKeyStatusPending:
map[it->first] = kStatusPending;
break;
continue;
case kKeyStatusKeyUnknown:
case kKeyStatusInternalError:
map[it->first] = kInternalError;
break;
default:
LOGE("Unrecognized key status: %d", it->second);
map[it->first] = kInternalError;
break;
continue;
}
// If we get this far, the switch statement fell through, which is an error.
// We do this instead of having a default case in the switch so that the
// compiler will flag if someone fails to add a case for new enum members,
// while still handling the possibility of an invalid value sneaking into
// the map at runtime.
LOGE("Invalid key status %d. Reporting internal error.", it->second);
map[it->first] = kInternalError;
}
listener_->onKeyStatusesChange(session_id, has_new_usable_key);
@@ -1629,7 +1635,10 @@ class FileSystem::Impl {
widevine::Cdm::IStorage* storage_;
};
FileSystem::FileSystem() : impl_(new Impl()) { impl_->storage_ = host.storage; }
FileSystem::FileSystem() : impl_(new Impl()) {
assert(nullptr != host.storage);
impl_->storage_ = host.storage;
}
FileSystem::FileSystem(const std::string& origin, void* extra_data)
: impl_(new Impl()), origin_(origin) {
@@ -1656,7 +1665,7 @@ std::unique_ptr<File> FileSystem::Open(const std::string& file_path,
bool FileSystem::Exists(const std::string& file_path) {
if (!impl_) return false;
return file_path.empty() || impl_->storage_->exists(file_path);
return !file_path.empty() && impl_->storage_->exists(file_path);
}
bool FileSystem::Remove(const std::string& file_path) {

View File

@@ -86,6 +86,7 @@ void Properties::InitOnce() {
oem_crypto_use_userspace_buffers_ = use_userspace_buffers_;
provisioning_messages_are_binary_ = set_provisioning_messages_to_binary_;
allow_service_certificate_requests_ = false;
device_files_is_a_real_filesystem_ = false;
session_property_set_.reset(new CdmClientPropertySetMap());
}

View File

@@ -24,12 +24,9 @@ int main(int argc, char** argv) {
// Init gtest and let it consume arguments.
::testing::InitGoogleTest(&argc, argv);
if (!wvcdm::WvCdmTestBase::Initialize(argc, argv)) return 0;
// Set up a Host so that tests and initialize the library. This makes these
// services available to the tests. We would do this in the test suite
// itself, but the core & OEMCrypto tests don't know they depend on this
// for storage.
// Set up a Host and initialize the library. This makes these services
// available to the tests. We would do this in the test suite itself, but the
// core & OEMCrypto tests don't know they depend on this for storage.
g_host = new TestHost();
Cdm::ClientInfo client_info;
// Set client info that denotes this as the test suite:
@@ -55,5 +52,9 @@ int main(int argc, char** argv) {
(void)status; // status is now used when assertions are turned off.
assert(status == Cdm::kSuccess);
// This must take place after the call to Cdm::initialize() because it may
// make calls that are only valid after the library is initialized.
if (!wvcdm::WvCdmTestBase::Initialize(argc, argv)) return 0;
return RUN_ALL_TESTS();
}