Additional merges from cdm master

* Update unit test make files to use BoringSSL

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

  This CL updates the android makefiles to use the libcrypto_static.

* Do Not Run Provisioning Tests On Devices Without Keyboxes

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

  The provisioning tests outside OEMCrypto were failing on devices that
  use baked-in certificates because only OEMCrypto knows that the cert
  is baked in and the device cannot be reprovisioned. This change
  skips those two tests if the device says it does not implement
  rewrapping the cert. (i.e. it does not implement provisioning)

  Bug: 23554998

* Add new third-party libs (protobuf & gyp)

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

  The CE CDM used to expect these to be installed system-wide, which
  creates challenges for integrators who must cross-compile the CDM.

  These are now used in source form from third_party.

Change-Id: I29cca2f9415fe2fafdf948273e5a0f5d7de50285
This commit is contained in:
Rahul Frias
2015-10-05 11:30:03 -07:00
parent dfe644da56
commit 0fe3f79cc3
10 changed files with 25 additions and 14 deletions

View File

@@ -81,12 +81,12 @@ LOCAL_C_INCLUDES := \
LOCAL_STATIC_LIBRARIES := \
libcdm \
libcdm_utils \
libcrypto_static \
libwvlevel3 \
libwvdrmcryptoplugin \
libwvdrmdrmplugin \
LOCAL_SHARED_LIBRARIES := \
libcrypto \
libcutils \
libdl \
liblog \

View File

@@ -4,6 +4,7 @@
#define WVCDM_CORE_DEVICE_FILES_H_
#include <unistd.h>
#include <set>
#include <string>

View File

@@ -641,7 +641,8 @@ CdmResponseType CryptoSession::Decrypt(const CdmDecryptionParameters& params) {
buffer_descriptor.type =
params.is_secure ? destination_buffer_type_ : OEMCrypto_BufferType_Clear;
if (params.is_secure && buffer_descriptor.type == OEMCrypto_BufferType_Clear) {
if (params.is_secure &&
buffer_descriptor.type == OEMCrypto_BufferType_Clear) {
return SECURE_BUFFER_REQUIRED;
}

View File

@@ -330,7 +330,6 @@ bool DeviceFiles::LicenseExists(const std::string& key_set_id) {
LOGW("DeviceFiles::LicenseExists: not initialized");
return false;
}
return FileExists(key_set_id + kLicenseFileNameExt);
return reserved_license_ids_.count(key_set_id) ||
FileExists(key_set_id + kLicenseFileNameExt);
}

View File

@@ -140,10 +140,6 @@ CdmLicense::CdmLicense(const CdmSessionId& session_id, Clock* clock)
session_id_(session_id),
initialized_(false),
renew_with_client_id_(false) {
if (NULL == clock) {
LOGE("CdmLicense::CdmLicense: clock parameter not provided");
return;
}
clock_.reset(clock);
}

View File

@@ -13,6 +13,7 @@
#include "initialization_data.h"
#include "license_request.h"
#include "log.h"
#include "OEMCryptoCENC.h"
#include "properties.h"
#include "scoped_ptr.h"
#include "string_conversions.h"
@@ -178,6 +179,18 @@ class WvCdmEngineTest : public testing::Test {
// Test that provisioning works, even if device is already provisioned.
TEST_F(WvCdmEngineTest, ProvisioningTest) {
uint32_t nonce = 0;
uint8_t buffer[1];
size_t size = 0;
int result = OEMCrypto_RewrapDeviceRSAKey(
0, buffer, 0, buffer, 0, &nonce, buffer, 0, buffer, buffer, &size);
if (result == OEMCrypto_ERROR_NOT_IMPLEMENTED) {
LOGW("WARNING: Skipping ProvisioningTest because the device does not "
"support provisioning. If you are using a baked-in certificate, this "
"is expected. Otherwise, something is wrong.");
return;
}
Provision();
}

View File

@@ -2,8 +2,8 @@
//
// Timer - Platform independent interface for a Timer class
//
#ifndef CDM_BASE_CORE_TIMER_H_
#define CDM_BASE_CORE_TIMER_H_
#ifndef CDM_BASE_TIMER_H_
#define CDM_BASE_TIMER_H_
#include "wv_cdm_types.h"
@@ -48,4 +48,4 @@ class Timer {
} // namespace wvcdm
#endif // CDM_BASE_CORE_TIMER_H_
#endif // CDM_BASE_TIMER_H_

View File

@@ -457,8 +457,8 @@ class TestWvCdmClientPropertySet : public CdmClientPropertySet {
virtual const std::string& service_certificate() const {
return service_certificate_;
}
virtual void set_service_certificate(const std::string& service_certificate) {
service_certificate_ = service_certificate;
virtual void set_service_certificate(const std::string& cert) {
service_certificate_ = cert;
}
virtual bool use_privacy_mode() const { return use_privacy_mode_; }
virtual bool is_session_sharing_enabled() const {
@@ -980,7 +980,7 @@ TEST_F(WvCdmRequestLicenseTest, PropertySetTest) {
itr = query_info.find(wvcdm::QUERY_KEY_SECURITY_LEVEL);
EXPECT_TRUE(itr != query_info.end());
security_level = itr->second;
EXPECT_TRUE(security_level.empty() ||
EXPECT_TRUE(!security_level.compare(QUERY_VALUE_SECURITY_LEVEL_L1) ||
!security_level.compare(QUERY_VALUE_SECURITY_LEVEL_L3));
std::string app_id = "not empty";

View File

@@ -0,0 +1 @@
# dummy

View File

@@ -48,7 +48,7 @@
* If you are ripping this out of the library, comment out the next
* line and uncomment the next lines as approrpiate
*/
//#include "config.h"
#include "config.h"
/* if on motoral, sun, ibm; uncomment this */
/* #define WORDS_BIGENDIAN 1 */