Multiple changes
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=224206719
This commit is contained in:
committed by
Fang Yu
parent
57385ffb5e
commit
c70235c0bd
Binary file not shown.
@@ -32,6 +32,11 @@ class WvPLCASProxyEnvironment : public WvPLSDKEnvironment {
|
||||
*/
|
||||
~WvPLCASProxyEnvironment() override;
|
||||
|
||||
/**
|
||||
* One-time initialization. Must be called after creating the environment.
|
||||
*/
|
||||
virtual WvPLStatus Initialize();
|
||||
|
||||
/**
|
||||
* Creates a session for the license request from the Widevine CDM.
|
||||
*
|
||||
@@ -42,6 +47,17 @@ class WvPLCASProxyEnvironment : public WvPLSDKEnvironment {
|
||||
*/
|
||||
virtual WvPLStatus CreateSession(const std::string& cas_license_request,
|
||||
WvPLCASProxySession** cas_proxy_session);
|
||||
|
||||
/**
|
||||
* Set the certificate status list system-wide.
|
||||
* |cert_list| specifies the device certificate status
|
||||
* list as std::string or certificate status list response from keysmith.
|
||||
*
|
||||
* @param cert_list
|
||||
*
|
||||
* @return WvPLStatus enumeration
|
||||
*/
|
||||
WvPLStatus SetDeviceCertificateStatusList(const std::string& cert_list) const;
|
||||
};
|
||||
|
||||
} // namespace wv_pl_sdk
|
||||
|
||||
@@ -73,7 +73,9 @@ class WvPLCASProxySession : public WvPLSDKSession {
|
||||
friend class WvPLCASProxyEnvironmentTest;
|
||||
friend class WvPLCASProxySessionTest;
|
||||
|
||||
explicit WvPLCASProxySession(const std::string& cas_license_request_from_cdm) {}
|
||||
WvPLCASProxySession(
|
||||
const widevine::DrmRootCertificate* drm_root_certificate,
|
||||
const std::string& cas_license_request_from_cdm);
|
||||
|
||||
WvPLStatus ParsePsshData(
|
||||
WvPLWidevinePsshData* wvpl_widevine_pssh_data) const override;
|
||||
|
||||
17
sdk/external/common/wvpl/wvpl_sdk_environment.h
vendored
17
sdk/external/common/wvpl/wvpl_sdk_environment.h
vendored
@@ -9,9 +9,10 @@
|
||||
#ifndef SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_ENVIRONMENT_H_
|
||||
#define SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_ENVIRONMENT_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "common/certificate_type.h"
|
||||
#include "common/drm_root_certificate.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
#include "protos/public/device_certificate_status.pb.h"
|
||||
#include "protos/public/provisioned_device_info.pb.h"
|
||||
@@ -66,9 +67,10 @@ class WvPLSDKEnvironment {
|
||||
const std::string& service_certificate, const std::string& service_private_key,
|
||||
const std::string& service_private_key_passphrase);
|
||||
|
||||
// Returns the DRM Root Certificate type. This would be a setting passed into
|
||||
// the environment, by a derived class constructor.
|
||||
virtual std::string GetDrmCertificateType() { return drm_certificate_type_; }
|
||||
// Returns the DRM root certificate configured for this environment.
|
||||
const widevine::DrmRootCertificate* drm_root_certificate() const {
|
||||
return drm_root_certificate_.get();
|
||||
}
|
||||
|
||||
protected:
|
||||
// Return the signature for the provider specified in the |config_values|
|
||||
@@ -83,6 +85,8 @@ class WvPLSDKEnvironment {
|
||||
const widevine::DeviceCertificateStatusList&
|
||||
certificate_status_list);
|
||||
|
||||
WvPLStatus SetDeviceCertificateStatusList(const std::string& cert_list) const;
|
||||
|
||||
// Number of seconds until the certificate status list expires after its
|
||||
// creation time. Default value is 604800 seconds.
|
||||
uint32_t device_certificate_expiration_seconds_ = 604800;
|
||||
@@ -100,9 +104,8 @@ class WvPLSDKEnvironment {
|
||||
bool is_service_certificate_loaded_ = false;
|
||||
// If true, allow devices not in the certificate status list.
|
||||
bool allow_unknown_device_ = false;
|
||||
// DRM Certificate type.
|
||||
widevine::CertificateType certificate_type_ =
|
||||
widevine::kCertificateTypeProduction;
|
||||
// DRM root certificate used for verifying all other DRM certificates.
|
||||
std::unique_ptr<widevine::DrmRootCertificate> drm_root_certificate_;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
30
sdk/external/common/wvpl/wvpl_sdk_session.h
vendored
30
sdk/external/common/wvpl/wvpl_sdk_session.h
vendored
@@ -9,6 +9,7 @@
|
||||
#ifndef SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_SESSION_H_
|
||||
#define SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_SESSION_H_
|
||||
|
||||
#include <memory>
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
#include "protos/public/client_identification.pb.h"
|
||||
#include "protos/public/device_certificate_status.pb.h"
|
||||
@@ -17,13 +18,16 @@
|
||||
#include "protos/public/provisioned_device_info.pb.h"
|
||||
|
||||
namespace widevine {
|
||||
class DrmRootCertificate;
|
||||
class SessionInit;
|
||||
}
|
||||
} // namespace widevine
|
||||
namespace widevine_server {
|
||||
namespace wv_pl_sdk {
|
||||
|
||||
class WvPLSDKSession {
|
||||
public:
|
||||
explicit WvPLSDKSession(
|
||||
const widevine::DrmRootCertificate* drm_root_certificate);
|
||||
virtual ~WvPLSDKSession() = 0;
|
||||
|
||||
public:
|
||||
@@ -102,7 +106,7 @@ class WvPLSDKSession {
|
||||
}
|
||||
|
||||
protected:
|
||||
uint32_t system_id_ = 0xFFFFFFFF;
|
||||
const widevine::DrmRootCertificate* drm_root_certificate_;
|
||||
std::string user_agent_;
|
||||
std::vector<WvPLKey> keys_;
|
||||
WvPLPlaybackPolicy policy_;
|
||||
@@ -110,7 +114,6 @@ class WvPLSDKSession {
|
||||
WvPLWidevinePsshData pssh_data_;
|
||||
widevine::ClientIdentification client_id_;
|
||||
bool has_pssh_data_ = false;
|
||||
bool has_system_id_ = false;
|
||||
bool has_client_id_ = false;
|
||||
MessageType message_type_ = UNKNOWN;
|
||||
PlatformVerificationStatus platform_verification_status_ =
|
||||
@@ -182,7 +185,28 @@ class WvPLSDKSession {
|
||||
void CopySessionState(const WvPLSessionState& wvpl_session_state,
|
||||
widevine::SessionState* session_state);
|
||||
|
||||
// Set system_id value.
|
||||
virtual void SetSystemId(uint32_t system_id);
|
||||
|
||||
// Return has_system_id_ value. True if session has system id.
|
||||
virtual bool HasSystemId() const;
|
||||
|
||||
// Return system_id value in uint32_t. The function will crash if it does not
|
||||
// have system_id.
|
||||
virtual uint32_t GetSystemId() const;
|
||||
|
||||
/**
|
||||
* Use system_id to loop up device info.
|
||||
*
|
||||
* @return WvPLStatus - Status::OK if success, else error.
|
||||
*/
|
||||
virtual WvPLStatus LookupDeviceInfo(
|
||||
uint32_t system_id,
|
||||
widevine::ProvisionedDeviceInfo* provisioned_device_info) const;
|
||||
|
||||
private:
|
||||
std::unique_ptr<uint32_t> system_id_;
|
||||
|
||||
/**
|
||||
* Parses WvPLWidevinePsshData in the new license request.
|
||||
*
|
||||
|
||||
@@ -110,7 +110,7 @@ inline bool operator!=(const Status& s1, const Status& s2) {
|
||||
// Prints a human-readable representation of 'x' to 'os'.
|
||||
std::ostream& operator<<(std::ostream& os, const Status& x);
|
||||
|
||||
#define CHECK_OK(expression) CHECK_EQ(util::error::OK, expression.error_code())
|
||||
#define CHECK_OK(expression) CHECK(expression.ok()) << expression.ToString()
|
||||
|
||||
|
||||
} // namespace util
|
||||
|
||||
Reference in New Issue
Block a user