Multiple changes

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=224206719
This commit is contained in:
Widevine Buildbot
2018-12-05 21:36:03 +00:00
committed by Fang Yu
parent 57385ffb5e
commit c70235c0bd
6 changed files with 57 additions and 12 deletions

View File

@@ -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:
/**

View File

@@ -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.
*