Source release v3.0.5
This commit is contained in:
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,3 +1,14 @@
|
||||
## 3.0.5 (2015-12-16)
|
||||
|
||||
Features:
|
||||
- Add openssl\_config variable for gyp-based projects which already include
|
||||
OpenSSL or BoringSSL
|
||||
|
||||
Bugfixes:
|
||||
- Sleep between tests to avoid triggering OEMCrypto nonce-flood errors on
|
||||
very fast machines
|
||||
|
||||
|
||||
## 3.0.4 (2015-12-14)
|
||||
|
||||
Features:
|
||||
|
||||
BIN
README.pdf
BIN
README.pdf
Binary file not shown.
34
cdm/cdm.gyp
34
cdm/cdm.gyp
@@ -13,6 +13,18 @@
|
||||
# If set to 'dummy', privacy mode in the CDM will fail.
|
||||
'privacy_crypto_impl%': 'openssl',
|
||||
|
||||
# There are two openssl configurations:
|
||||
#
|
||||
# 1) openssl_config == 'system'
|
||||
# Use the openssl headers found in the sysroot and link the system library.
|
||||
#
|
||||
# 2) openssl_config == 'target'
|
||||
# Use the openssl implementation in an existing GYP target.
|
||||
# Specify the openssl target in openssl_target. This target should forward
|
||||
# the include path to its headers to its dependents.
|
||||
'openssl_config%': 'system',
|
||||
'openssl_target%': '',
|
||||
|
||||
# There are three protobuf configurations:
|
||||
#
|
||||
# 1) protobuf_config == 'system'
|
||||
@@ -136,8 +148,24 @@
|
||||
'../core/src/oemcrypto_adapter_static_v10.cpp',
|
||||
],
|
||||
}],
|
||||
],
|
||||
},
|
||||
['privacy_crypto_impl=="openssl"', {
|
||||
'conditions': [
|
||||
['openssl_config == "target"', {
|
||||
'dependencies': [
|
||||
'<(openssl_target)',
|
||||
],
|
||||
}, {
|
||||
# openssl_config == "system"
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lcrypto',
|
||||
],
|
||||
},
|
||||
}],
|
||||
], # conditions
|
||||
}], # privacy_crypto_impl=="openssl"
|
||||
], # conditions
|
||||
}, # widevine_cdm_core target
|
||||
{
|
||||
'target_name': 'widevine_ce_cdm_static',
|
||||
'type': 'static_library',
|
||||
@@ -177,7 +205,7 @@
|
||||
'src/log.cpp',
|
||||
'src/properties_ce.cpp',
|
||||
],
|
||||
},
|
||||
}, # widevine_cdm_static target
|
||||
{
|
||||
'target_name': 'widevine_ce_cdm_shared',
|
||||
'type': 'shared_library',
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
{
|
||||
'variables': {
|
||||
'oemcrypto_lib%': '',
|
||||
'openssl_config%': 'system',
|
||||
'openssl_target%': '',
|
||||
},
|
||||
'targets': [
|
||||
{
|
||||
@@ -28,8 +30,6 @@
|
||||
'cdm_unittests.gypi',
|
||||
],
|
||||
'libraries': [
|
||||
'-lcrypto', # oec_mock
|
||||
'-lssl', # oec_mock
|
||||
'-lpthread', # gtest
|
||||
],
|
||||
'dependencies': [
|
||||
|
||||
@@ -21,4 +21,19 @@
|
||||
'UNIT_TEST',
|
||||
'CDM_TESTS',
|
||||
],
|
||||
'conditions': [
|
||||
# OpenSSL needed for http_socket
|
||||
['openssl_config == "target"', {
|
||||
'dependencies': [
|
||||
'<(openssl_target)',
|
||||
],
|
||||
}, {
|
||||
# openssl_config == "system"
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lssl',
|
||||
],
|
||||
},
|
||||
}],
|
||||
],
|
||||
}
|
||||
|
||||
@@ -33,4 +33,19 @@
|
||||
# correct path.
|
||||
'<(cdm_dir)/cdm/cdm.gyp:license_protocol',
|
||||
],
|
||||
'conditions': [
|
||||
# OpenSSL needed for http_socket
|
||||
['openssl_config == "target"', {
|
||||
'dependencies': [
|
||||
'<(openssl_target)',
|
||||
],
|
||||
}, {
|
||||
# openssl_config == "system"
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lssl',
|
||||
],
|
||||
},
|
||||
}],
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Widevine CE CDM Version
|
||||
#define CDM_VERSION "v3.0.4-0-g4dee2a8-ce"
|
||||
#define CDM_VERSION "v3.0.5-0-g897db53-ce"
|
||||
|
||||
@@ -160,6 +160,13 @@ class CdmTest : public Test,
|
||||
SetDefaultServerCertificate();
|
||||
}
|
||||
|
||||
virtual void TearDown() OVERRIDE {
|
||||
// So the OEMCrypto nonce flood check does not trigger.
|
||||
// A 500ms delay allows up to 10 nonces to be generated per test without
|
||||
// triggering an OEMCrypto error.
|
||||
usleep(500 * 1000);
|
||||
}
|
||||
|
||||
void RecreateCdm(bool privacy_mode) {
|
||||
CreateAdditionalCdm(privacy_mode, &cdm_);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "device_files.pb.h"
|
||||
#include "scoped_ptr.h"
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
@@ -107,7 +108,7 @@ class DeviceFiles {
|
||||
bool StoreFileRaw(const std::string& name,
|
||||
const std::string& serialized_file);
|
||||
bool RetrieveHashedFile(const std::string& name,
|
||||
std::string* serialized_file);
|
||||
video_widevine_client::sdk::File* file);
|
||||
bool FileExists(const std::string& name);
|
||||
bool RemoveFile(const std::string& name);
|
||||
ssize_t GetFileSize(const std::string& name);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
|
||||
#include "device_files.pb.h"
|
||||
#include "file_store.h"
|
||||
#include "log.h"
|
||||
#include "properties.h"
|
||||
@@ -125,14 +124,8 @@ bool DeviceFiles::RetrieveCertificate(const std::string& origin,
|
||||
SecurityLevelPathBackwardCompatibility();
|
||||
}
|
||||
|
||||
std::string serialized_file;
|
||||
if (!RetrieveHashedFile(GetCertificateFileName(origin), &serialized_file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
video_widevine_client::sdk::File file;
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
LOGW("DeviceFiles::RetrieveCertificate: Unable to parse file");
|
||||
if (!RetrieveHashedFile(GetCertificateFileName(origin), &file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -242,14 +235,8 @@ bool DeviceFiles::RetrieveLicense(
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string serialized_file;
|
||||
if (!RetrieveHashedFile(key_set_id + kLicenseFileNameExt, &serialized_file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
video_widevine_client::sdk::File file;
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
LOGW("DeviceFiles::RetrieveLicense: Unable to parse file");
|
||||
if (!RetrieveHashedFile(key_set_id + kLicenseFileNameExt, &file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -362,14 +349,13 @@ bool DeviceFiles::StoreUsageInfo(const std::string& provider_session_token,
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string serialized_file;
|
||||
video_widevine_client::sdk::File file;
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!RetrieveHashedFile(file_name, &serialized_file)) {
|
||||
if (!FileExists(file_name)) {
|
||||
file.set_type(video_widevine_client::sdk::File::USAGE_INFO);
|
||||
file.set_version(video_widevine_client::sdk::File::VERSION_1);
|
||||
} else {
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
if (!RetrieveHashedFile(file_name, &file)) {
|
||||
LOGW("DeviceFiles::StoreUsageInfo: Unable to parse file");
|
||||
return false;
|
||||
}
|
||||
@@ -384,6 +370,7 @@ bool DeviceFiles::StoreUsageInfo(const std::string& provider_session_token,
|
||||
provider_session->set_license(key_response.data(), key_response.size());
|
||||
provider_session->set_key_set_id(key_set_id.data(), key_set_id.size());
|
||||
|
||||
std::string serialized_file;
|
||||
file.SerializeToString(&serialized_file);
|
||||
return StoreFileWithHash(file_name, serialized_file);
|
||||
}
|
||||
@@ -394,15 +381,9 @@ bool DeviceFiles::DeleteUsageInfo(const std::string& app_id,
|
||||
LOGW("DeviceFiles::DeleteUsageInfo: not initialized");
|
||||
return false;
|
||||
}
|
||||
std::string serialized_file;
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!RetrieveHashedFile(file_name, &serialized_file)) return false;
|
||||
|
||||
video_widevine_client::sdk::File file;
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
LOGW("DeviceFiles::DeleteUsageInfo: Unable to parse file");
|
||||
return false;
|
||||
}
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!RetrieveHashedFile(file_name, &file)) return false;
|
||||
|
||||
UsageInfo* usage_info = file.mutable_usage_info();
|
||||
int index = 0;
|
||||
@@ -429,6 +410,7 @@ bool DeviceFiles::DeleteUsageInfo(const std::string& app_id,
|
||||
}
|
||||
sessions->RemoveLast();
|
||||
|
||||
std::string serialized_file;
|
||||
file.SerializeToString(&serialized_file);
|
||||
return StoreFileWithHash(file_name, serialized_file);
|
||||
}
|
||||
@@ -448,16 +430,11 @@ bool DeviceFiles::DeleteAllUsageInfoForApp(
|
||||
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!FileExists(file_name)) return true;
|
||||
std::string serialized_file;
|
||||
if (RetrieveHashedFile(file_name, &serialized_file)) {
|
||||
video_widevine_client::sdk::File file_proto;
|
||||
if (!file_proto.ParseFromString(serialized_file)) {
|
||||
LOGW("DeviceFiles::DeleteAllUsageInfoForApp: Unable to parse file");
|
||||
} else {
|
||||
for (int i = 0; i < file_proto.usage_info().sessions_size(); ++i) {
|
||||
provider_session_tokens->push_back(
|
||||
file_proto.usage_info().sessions(i).token());
|
||||
}
|
||||
|
||||
video_widevine_client::sdk::File file;
|
||||
if (RetrieveHashedFile(file_name, &file)) {
|
||||
for (int i = 0; i < file.usage_info().sessions_size(); ++i) {
|
||||
provider_session_tokens->push_back(file.usage_info().sessions(i).token());
|
||||
}
|
||||
} else {
|
||||
LOGW("DeviceFiles::DeleteAllUsageInfoForApp: Unable to retrieve file");
|
||||
@@ -480,19 +457,14 @@ bool DeviceFiles::RetrieveUsageInfo(
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string serialized_file;
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!RetrieveHashedFile(file_name, &serialized_file)) {
|
||||
if (!FileExists(file_name) || GetFileSize(file_name) == 0) {
|
||||
usage_info->resize(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (!FileExists(file_name) || GetFileSize(file_name) == 0) {
|
||||
usage_info->resize(0);
|
||||
return true;
|
||||
}
|
||||
|
||||
video_widevine_client::sdk::File file;
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
if (!RetrieveHashedFile(file_name, &file)) {
|
||||
LOGW("DeviceFiles::RetrieveUsageInfo: Unable to parse file");
|
||||
return false;
|
||||
}
|
||||
@@ -515,13 +487,10 @@ bool DeviceFiles::RetrieveUsageInfo(const std::string& app_id,
|
||||
LOGW("DeviceFiles::RetrieveUsageInfo: not initialized");
|
||||
return false;
|
||||
}
|
||||
std::string serialized_file;
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!RetrieveHashedFile(file_name, &serialized_file)) return false;
|
||||
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
video_widevine_client::sdk::File file;
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
LOGW("DeviceFiles::RetrieveUsageInfo: Unable to parse file");
|
||||
if (!RetrieveHashedFile(file_name, &file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -546,13 +515,10 @@ bool DeviceFiles::RetrieveUsageInfoByKeySetId(
|
||||
LOGW("DeviceFiles::RetrieveUsageInfoByKeySetId: not initialized");
|
||||
return false;
|
||||
}
|
||||
std::string serialized_file;
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
if (!RetrieveHashedFile(file_name, &serialized_file)) return false;
|
||||
|
||||
std::string file_name = GetUsageInfoFileName(app_id);
|
||||
video_widevine_client::sdk::File file;
|
||||
if (!file.ParseFromString(serialized_file)) {
|
||||
LOGW("DeviceFiles::RetrieveUsageInfoByKeySetId: Unable to parse file");
|
||||
if (!RetrieveHashedFile(file_name, &file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -634,16 +600,16 @@ bool DeviceFiles::StoreFileRaw(const std::string& name,
|
||||
}
|
||||
|
||||
bool DeviceFiles::RetrieveHashedFile(const std::string& name,
|
||||
std::string* serialized_file) {
|
||||
video_widevine_client::sdk::File* file) {
|
||||
std::string serialized_file;
|
||||
|
||||
if (!file_.get()) {
|
||||
LOGW("DeviceFiles::RetrieveHashedFile: Invalid file handle");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!serialized_file) {
|
||||
LOGW(
|
||||
"DeviceFiles::RetrieveHashedFile: Unspecified serialized_file "
|
||||
"parameter");
|
||||
if (!file) {
|
||||
LOGW("DeviceFiles::RetrieveHashedFile: Unspecified file parameter");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -707,7 +673,10 @@ bool DeviceFiles::RetrieveHashedFile(const std::string& name,
|
||||
return false;
|
||||
}
|
||||
|
||||
*serialized_file = hash_file.file();
|
||||
if (!file->ParseFromString(hash_file.file())) {
|
||||
LOGW("DeviceFiles::RetrieveHashedFile: Unable to parse file");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2167,8 +2167,9 @@ TEST_P(DeviceFilesUsageInfoTest, Read) {
|
||||
data = kUsageInfoTestData[index].file_data;
|
||||
}
|
||||
if (index >= 0) {
|
||||
EXPECT_CALL(file, Exists(StrEq(path))).WillOnce(Return(true));
|
||||
EXPECT_CALL(file, FileSize(StrEq(path))).WillOnce(Return(data.size()));
|
||||
EXPECT_CALL(file, Exists(StrEq(path))).WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(file, FileSize(StrEq(path)))
|
||||
.WillRepeatedly(Return(data.size()));
|
||||
EXPECT_CALL(file, Open(StrEq(path), IsBinaryFileFlagSet()))
|
||||
.WillOnce(Return(true));
|
||||
EXPECT_CALL(file, Read(NotNull(), Eq(data.size())))
|
||||
@@ -2177,7 +2178,6 @@ TEST_P(DeviceFilesUsageInfoTest, Read) {
|
||||
EXPECT_CALL(file, Close()).Times(1);
|
||||
} else {
|
||||
EXPECT_CALL(file, Exists(StrEq(path)))
|
||||
.Times(2)
|
||||
.WillRepeatedly(Return(false));
|
||||
EXPECT_CALL(file, FileSize(_)).Times(0);
|
||||
EXPECT_CALL(file, Open(_, _)).Times(0);
|
||||
@@ -2230,7 +2230,7 @@ TEST_P(DeviceFilesUsageInfoTest, Store) {
|
||||
.WillRepeatedly(Return(true));
|
||||
EXPECT_CALL(file, CreateDirectory(_)).Times(0);
|
||||
|
||||
EXPECT_CALL(file, Exists(StrEq(path))).WillOnce(Return(index >= 0));
|
||||
EXPECT_CALL(file, Exists(StrEq(path))).WillRepeatedly(Return(index >= 0));
|
||||
if (index >= 0) {
|
||||
EXPECT_CALL(file, FileSize(StrEq(path))).WillOnce(Return(data.size()));
|
||||
EXPECT_CALL(file, Open(StrEq(path), IsBinaryFileFlagSet()))
|
||||
|
||||
Reference in New Issue
Block a user