WvPL License SDK release: 17.0.1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// Copyright 2020 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_ENVIRONMENT_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_ENVIRONMENT_H_
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVDRM_LICENSE_SERVER_SDK_ENVIRONMENT_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVDRM_LICENSE_SERVER_SDK_ENVIRONMENT_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include "common/drm_root_certificate.h"
|
||||
#include "common/security_profile_list.h"
|
||||
#include "common/status.h"
|
||||
#include "license_server_sdk/internal/environment_impl.h"
|
||||
#include "license_server_sdk/public/session.h"
|
||||
#include "sdk/external/cpp/wvdrm/license_server_sdk/session.h"
|
||||
#include "sdk/internal/environment_impl.h"
|
||||
|
||||
namespace video_widevine {
|
||||
|
||||
@@ -47,6 +47,11 @@ class Environment {
|
||||
void SetDevicesToHandleOEMCryptoVersionInKCB(
|
||||
const std::string& system_id_list);
|
||||
|
||||
// Set pre-provisioning keys system-wide. Map key is system_id, value.
|
||||
// Value should be human-readable hex digits encoded bytes, e.g.
|
||||
// 'preProvKeys.put(100, "f7008b38acc00ec68c732ac665c55c65")'. Must be called
|
||||
// before any other calls to this class. Calls are thread-safe, so the keys
|
||||
// can be updated at any time.
|
||||
void SetPreProvisioningKeys(const std::map<uint32_t, std::string>& keys);
|
||||
|
||||
void SetPreProvisioningKeys(const std::multimap<uint32_t, std::string>& keys);
|
||||
@@ -222,14 +227,22 @@ class Environment {
|
||||
// may be automatically set,
|
||||
//
|
||||
// The default setting for |auto_set_provider_session_token| is 'true'.
|
||||
virtual void SetAutosetProviderSessionToken(
|
||||
virtual void SetAutoSetProviderSessionToken(
|
||||
bool auto_set_provider_session_token);
|
||||
|
||||
// Returns the setting as to whether the provider session token will be
|
||||
// automatically set.
|
||||
virtual bool GetAutosetProviderSessionToken() const;
|
||||
virtual bool GetAutoSetProviderSessionToken() const;
|
||||
|
||||
// Set the provider key used for L3 CDM.
|
||||
// |provider_key_config_bytes| is a serialized ProviderKeyConfig proto
|
||||
// message. Return OK if parsing is successful, otherwise an error is
|
||||
// returned.
|
||||
virtual Status SetProviderKeyConfig(
|
||||
const std::string& provider_key_config_bytes);
|
||||
|
||||
private:
|
||||
friend class EnvironmentTest;
|
||||
// Environment::CreateSession which also fills in the parsed
|
||||
// ExternalLicenseRequest. Used to create a Session object.
|
||||
Status CreateSession(SignedMessage* signed_message, Session** session,
|
||||
@@ -239,8 +252,9 @@ class Environment {
|
||||
std::unique_ptr<video_widevine::SecurityProfileList>
|
||||
device_security_profile_list_;
|
||||
std::shared_ptr<EnvironmentImpl> env_impl_;
|
||||
friend class EnvironmentTest;
|
||||
// Provider key configuration assigned to a provider for use with L3 CDM.
|
||||
ProviderKeyConfig provider_key_config_;
|
||||
};
|
||||
} // namespace video_widevine
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_ENVIRONMENT_H_
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVDRM_LICENSE_SERVER_SDK_ENVIRONMENT_H_
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2021 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_INTERNAL_ENVIRONMENT_IMPL_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_INTERNAL_ENVIRONMENT_IMPL_H_
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_INTERNAL_ENVIRONMENT_IMPL_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_INTERNAL_ENVIRONMENT_IMPL_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
@@ -16,13 +16,14 @@
|
||||
#include "common/core_message_util.h"
|
||||
#include "common/security_profile_list.h"
|
||||
#include "common/status.h"
|
||||
#include "license_server_sdk/internal/session_usage_report.h"
|
||||
#include "sdk/internal/session_usage_report.h"
|
||||
#include "common/crypto_util.h"
|
||||
#include "protos/public/client_identification.pb.h"
|
||||
#include "protos/public/device_certificate_status.pb.h"
|
||||
#include "protos/public/license_protocol.pb.h"
|
||||
#include "protos/public/license_server_sdk.pb.h"
|
||||
#include "protos/public/oem_key_container.pb.h"
|
||||
#include "protos/public/provider_key.pb.h"
|
||||
#include "protos/public/provisioned_device_info.pb.h"
|
||||
|
||||
namespace video_widevine {
|
||||
@@ -192,19 +193,36 @@ class EnvironmentImpl {
|
||||
|
||||
// If |auto_set_provider_session_token| is 'true', the provider session token
|
||||
// may be automatically set,
|
||||
// * if the provider session token has not been specified.
|
||||
// * for OFFLINE requests
|
||||
// * if Policy.can_persist is set to 'true'.
|
||||
// * if Policy.can_renew is set to 'true'.
|
||||
// * if OEMCryptoVersion of the client making the request is at least 16.
|
||||
//
|
||||
// The default setting for |auto_set_provider_session_token| is 'true'.
|
||||
virtual void SetAutosetProviderSessionToken(
|
||||
virtual void SetAutoSetProviderSessionToken(
|
||||
bool auto_set_provider_session_token) {
|
||||
auto_set_provider_session_token_ = auto_set_provider_session_token;
|
||||
}
|
||||
|
||||
// Returns the setting as to whether the provider session token will be
|
||||
// automatically set.
|
||||
virtual bool GetAutosetProviderSessionToken() const {
|
||||
virtual bool GetAutoSetProviderSessionToken() const {
|
||||
return auto_set_provider_session_token_;
|
||||
}
|
||||
|
||||
// Set the provider key used for L3 CDM.
|
||||
// |provider_key_config_bytes| is a serialized ProviderKeyConfig proto
|
||||
// message. Return OK if parsing is successful, otherwise an error is
|
||||
// returned.
|
||||
virtual Status SetProviderKeyConfig(
|
||||
const std::string& provider_key_config_bytes);
|
||||
|
||||
// Returns the provider key config.
|
||||
virtual const ProviderKeyConfig& GetProviderKeyConfig() const {
|
||||
return provider_key_config_;
|
||||
}
|
||||
|
||||
virtual ~EnvironmentImpl();
|
||||
|
||||
private:
|
||||
@@ -221,7 +239,9 @@ class EnvironmentImpl {
|
||||
const DrmRootCertificate* drm_root_certificate_;
|
||||
mutable absl::Mutex profile_mutex_;
|
||||
SecurityProfileList* profile_list_ ABSL_GUARDED_BY(profile_mutex_);
|
||||
// Provider key configuration assigned to a provider for use with L3 CDM.
|
||||
ProviderKeyConfig provider_key_config_;
|
||||
};
|
||||
} // namespace video_widevine
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_INTERNAL_ENVIRONMENT_IMPL_H_
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_INTERNAL_ENVIRONMENT_IMPL_H_
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_SESSION_H__
|
||||
#define VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_SESSION_H__
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVDRM_LICENSE_SERVER_SDK_SESSION_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVDRM_LICENSE_SERVER_SDK_SESSION_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <list>
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "protos/public/license_server_sdk.pb.h"
|
||||
#include "protos/public/oem_key_container.pb.h"
|
||||
#include "protos/public/security_profile.pb.h"
|
||||
#include "protos/public/provider_key.pb.h"
|
||||
|
||||
namespace video_widevine {
|
||||
|
||||
@@ -42,242 +43,6 @@ class SessionUsage;
|
||||
// global settings and create new sessions.
|
||||
class Session {
|
||||
public:
|
||||
// Specify a comma separated list of system Ids that can support having
|
||||
// OEMCrypto version, as specified in the license request, reflected back in
|
||||
// the Key Control Block which is used by partner. Otherwise, only 'kctl' or
|
||||
// 'kc09' is returned in KCB.
|
||||
// TODO(tinskip): What is this, and can we do it better? Seems like something
|
||||
// that would be better in the ClientCapabilities or device metadata.
|
||||
static void SetDevicesToHandleOEMCryptoVersionInKCB(
|
||||
const std::string& system_id_list);
|
||||
// Set pre-provisioning keys system-wide. Map key is system_id, value.
|
||||
// Value should be human-readable hex digits encoded bytes.
|
||||
// Must be called before any other calls to this class. Calls are
|
||||
// thread-safe, so the keys can be updated at any time.
|
||||
static void SetPreProvisioningKeys(
|
||||
const std::map<uint32_t, std::string>& keys);
|
||||
static void SetPreProvisioningKeys(
|
||||
const std::multimap<uint32_t, std::string>& keys);
|
||||
// Set the certificate status list system-wide. |root_cert| is the root
|
||||
// certificate which signed the DCSL.
|
||||
// |expiration_period| is the number of seconds until the
|
||||
// certificate_status_list expires after its creation time
|
||||
// (creation_time_seconds). If |allow_unknown_devices| is false, an error is
|
||||
// returned if the device does not appear in the certificate_status_list.
|
||||
static Status SetCertificateStatusList(
|
||||
const DrmRootCertificate* root_cert,
|
||||
const std::string& certificate_status_list,
|
||||
uint32_t expiration_period_seconds, bool allow_unknown_devices);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Add a service certificate system-wide. |root_cert| is the root certificate
|
||||
// which signed the service certificate; |service_certificate| is a
|
||||
// Google-generated certificate used to authenticate the service provider for
|
||||
// purposes of device privacy; |service_private_key| is the encrypted PKCS#8
|
||||
// private RSA key corresponding to the service certificate; and
|
||||
// |service_private_key_passphrase| is the password required to decrypt
|
||||
// |service_private_key|.
|
||||
static Status AddDrmServiceCertificate(
|
||||
const DrmRootCertificate* root_cert,
|
||||
const std::string& service_certificate,
|
||||
const std::string& service_private_key,
|
||||
const std::string& service_private_key_passphrase);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Enable delivery of licenses to client devices. This includes devices with
|
||||
// TEST_ONLY status, and development platform verification certificates.
|
||||
// Defaults to false.
|
||||
static void AllowDevelopmentClients(bool enable);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Enable delivery of licenses to TEST_ONLY client devices.
|
||||
// |device_list_make| is a comma separated list of devices to allow even
|
||||
// if the device is in a TEST_ONLY state. This list wil be used only if
|
||||
// AllowDevelopmentClient(false) is in use.
|
||||
static void AllowTestOnlyDevices(const std::string& device_list_make) {
|
||||
AllowTestOnlyDevicesByMake(device_list_make);
|
||||
}
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
static void AllowTestOnlyDevicesByMake(const std::string& device_list_make);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Enable delivery of licenses to TEST_ONLY client devices.
|
||||
// |device_list_provider| is a comma separated list of provider to allow
|
||||
// even if the device is in a TEST_ONLY state. This list wil be used only if
|
||||
// AllowDevelopmentClient(false) is in use.
|
||||
static void AllowTestOnlyDevicesByProvider(
|
||||
const std::string& device_list_provider);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Enable delivery of licenses to revoked client devices. |system_id_list| is
|
||||
// a comma separated list of systems Ids to allow even if revoked.
|
||||
static void AllowRevokedDevices(const std::string& system_id_list);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// A comma separated list of DRM Certificate Serial Numbers that are revoked.
|
||||
static void RevokedDrmCertificateSerialNumbers(
|
||||
const std::string& drm_certificate_serial_numbers);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Restriction on core message features. If this is an empty string, the
|
||||
// default feature set is used. If it is an integer, that is the ODK version
|
||||
// supported.
|
||||
static void SetCoreMessageFeatures(const std::string& core_message_features);
|
||||
|
||||
// Creates a Session object.
|
||||
// |root_cert| is the root certificate to be used to validate client
|
||||
// credentials.
|
||||
// |signed_license_request| is the serialized SignedMessage received from the
|
||||
// client. |session| points to a Session*, which must be initialized to NULL
|
||||
// on entry, but |session| itself may not be NULL. The new Session object will
|
||||
// be owned by the caller. This method returns Status::OK if successful,
|
||||
// or an appropriate error status, in which case
|
||||
// Session::GenerateErrorResponse should be invoked.
|
||||
// Example usage:
|
||||
// Session* session = NULL;
|
||||
// Status status = Session::Create(root_cert, request_from_client,
|
||||
// &session);
|
||||
// if (!status.ok()) {
|
||||
// std::string error_license;
|
||||
// if (Session::GenerateErrorResponse(status, &error_license)) {
|
||||
// // Send error_license to the client.
|
||||
// } else {
|
||||
// // Handle error
|
||||
// }
|
||||
// return ...
|
||||
// }
|
||||
// // Create license, invoke GenerateSignedLicense, etc.
|
||||
static Status Create(const DrmRootCertificate* root_cert,
|
||||
const std::string& signed_license_request,
|
||||
Session** session);
|
||||
|
||||
// Create a session for generating a license. This variation of Create takes
|
||||
// options to allow for the creation of the session to succeed even if the
|
||||
// device is revoked.
|
||||
static Status CreateWithOptions(const DrmRootCertificate* root_cert,
|
||||
const std::string& signed_license_request,
|
||||
const SessionCreateOptions& options,
|
||||
Session** session);
|
||||
|
||||
// Variation of Session::Create which also fills in the parsed LicenseRequest,
|
||||
// for use in logging or debugging.
|
||||
static Status Create(const DrmRootCertificate* root_cert,
|
||||
const std::string& signed_license_request,
|
||||
const SessionCreateOptions& options, Session** session,
|
||||
LicenseRequest* parsed_request_out);
|
||||
|
||||
// Same as Create(), but caller can specify the ClientIdentification
|
||||
// message and/or PlatformVerificationStatus. If ClientIdentification is
|
||||
// specified, this variation of Create() will use the specified |client_id|
|
||||
// instead of what is specified in |signed_license_request|. If
|
||||
// PlatformVerificationStatus is specified, this method will use the specified
|
||||
// |platform_verification_status| instead of attempting to determine it.
|
||||
// Background for this function is to support cases where the client
|
||||
// identification is encrypted with the provider's service certificate in
|
||||
// which case we won't be able to decrypt OR when the provider determines
|
||||
// platform verification. The provider will specify the
|
||||
// clear client identification in |client_id| and the platform verification
|
||||
// in |platform_verification_status|.
|
||||
static Status CreateForProxy(
|
||||
const DrmRootCertificate* root_cert,
|
||||
const std::string& signed_license_request,
|
||||
const PlatformVerificationStatus platform_verification_status,
|
||||
const ClientIdentification* client_id,
|
||||
const SessionCreateOptions& options, Session** session,
|
||||
LicenseRequest* parsed_request_out);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Generates a SignedMessage containing a message generated in response to
|
||||
// an error condition. |status| is a previous error status returned by the
|
||||
// Session or Status(error::UNAVAILABLE, ...) to indicate that the
|
||||
// backend is unavailable, |signed_message| points to a std::string to contain the
|
||||
// serialized SignedMessage, and may not be NULL. This method returns true if
|
||||
// there is an error license to be sent to the client, or false otherwise.
|
||||
// Example usage in the Session::Create comments above.
|
||||
static bool GenerateErrorResponse(const Status& status,
|
||||
std::string* signed_message_bytes);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Generates a SignedMessage containing a service certificate for the
|
||||
// specified |provider_id|. This method returns true if a service certificate
|
||||
// exist for the provider.
|
||||
static bool GenerateServiceCertificateResponse(
|
||||
const std::string& provider_id, std::string* signed_message_bytes);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// DeriveKey uses the NIST 800-108 KDF recommendation, using AES-CMAC PRF.
|
||||
// NIST 800-108:
|
||||
// http://csrc.nist.gov/publications/nistpubs/800-108/sp800-108.pdf
|
||||
// AES-CMAC:
|
||||
// http://tools.ietf.org/html/rfc4493
|
||||
static std::string DeriveKey(const std::string& key, const std::string& label,
|
||||
const std::string& context,
|
||||
const uint32_t size_bits);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Returns a std::string containing the Widevine License Server SDK version in the
|
||||
// form <major_version>.<minor_version>.<release> <build date> <build time> .
|
||||
static std::string GetSdkVersionString();
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// If set to true, adds SDK and server version information to the license
|
||||
// response.
|
||||
static void SetIncludeVersionInfoInLicense(bool include_version_info);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Sets the service version information which can be included with the license
|
||||
// response. If SetIncludeVersionInfoInLicense() is set to true and the server
|
||||
// version is not empty, then the server version will be included in the
|
||||
// license response. The host_version must be <= 32 characters and limited to
|
||||
// alphanumeric and '_', '-', ':', ';', ' ', '/' and '.'.
|
||||
static void SetHostServerVersion(const std::string& host_version);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Generate a signed request to be sent to Widevine Certificate Provisioning
|
||||
// Server to retrieve 'DeviceCertificateStatusList'.
|
||||
static Status GenerateDeviceStatusListRequest(
|
||||
std::string* signed_device_certificate_status_list_request);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Set the custom device security profile list which is returned, from a call
|
||||
// to Widevine PublishedDevicesService.
|
||||
static Status SetCustomDeviceSecurityProfiles(
|
||||
const DrmRootCertificate* root_cert,
|
||||
absl::string_view serialized_signed_device_security_profiles);
|
||||
|
||||
virtual ~Session();
|
||||
virtual const LicenseRequest& request() const;
|
||||
virtual const std::string& GetSessionId();
|
||||
@@ -385,47 +150,6 @@ class Session {
|
||||
// 'Provider' making the request.
|
||||
virtual void set_provider(const std::string& provider);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Obtain the owner list for custom profiles.
|
||||
virtual Status GetCustomDeviceSecurityProfileOwners(
|
||||
std::vector<std::string>* custom_profile_owners) const;
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Return a list of custom profile names associated with |owner_name|.
|
||||
virtual Status GetCustomDeviceSecurityProfileNames(
|
||||
absl::string_view owner_name,
|
||||
std::vector<std::string>* profile_names) const;
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Return the custom profiles associated with |owner_name|.
|
||||
virtual Status GetCustomDeviceSecurityProfiles(
|
||||
absl::string_view owner_name,
|
||||
std::vector<SecurityProfile>* custom_device_security_profiles) const;
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Return a list of default profile names obtained from default profiles.
|
||||
// The input argument |profile_names| cannot be null and it will be replaced
|
||||
// by the results.
|
||||
// For any non-ok status, |profile_names| won't be modified.
|
||||
virtual Status GetDefaultDeviceSecurityProfileNames(
|
||||
std::vector<std::string>* profile_names) const;
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/187189998): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the mid-Q3 2021 SDK release.
|
||||
// Return the default profile associated with |profile_name|.
|
||||
virtual Status GetDefaultDeviceSecurityProfile(
|
||||
absl::string_view profile_name,
|
||||
SecurityProfile* device_security_profile) const;
|
||||
|
||||
// Return the device status such as as RELEASED or REVOKED.
|
||||
virtual DeviceCertificateStatus::Status GetDeviceStatus() const;
|
||||
|
||||
@@ -445,28 +169,6 @@ class Session {
|
||||
// Retrieves the request type.
|
||||
virtual LicenseRequest::RequestType request_type() const;
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/200839386): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the Q4 2021 SDK release.
|
||||
// If |auto_set_provider_session_token| is 'true', the provider session token
|
||||
// will be automatically set,
|
||||
// * if the provider session token has not been specified.
|
||||
// * for OFFLINE requests
|
||||
// * if Policy.can_persist is set to 'true'.
|
||||
// * if Policy.can_renew is set to 'true'.
|
||||
// * if OEMCryptoVersion of the client making the request is at least 16.
|
||||
//
|
||||
// The default setting for |auto_set_provider_session_token| is 'true'.
|
||||
virtual void set_auto_set_provider_session_token(
|
||||
bool auto_set_provider_session_token);
|
||||
|
||||
// Deprecated.
|
||||
// TODO(b/200839386): This API is now available in environment.h. It will be
|
||||
// removed from this header file in the Q4 2021 SDK release.
|
||||
// Returns the setting as to whether the provider session token will be
|
||||
// automatically set.
|
||||
virtual bool auto_set_provider_session_token() const;
|
||||
|
||||
protected:
|
||||
Session(std::shared_ptr<EnvironmentImpl> env_impl,
|
||||
std::unique_ptr<SessionImpl> impl);
|
||||
@@ -484,26 +186,12 @@ class Session {
|
||||
Session& operator=(const Session&) = delete;
|
||||
#endif
|
||||
|
||||
// Session::Create which also fills in the parsed
|
||||
// ExternalLicenseRequest. Used to create a Session object.
|
||||
static Status Create(const DrmRootCertificate* root_cert,
|
||||
SignedMessage* signed_message, Session** session,
|
||||
ExternalLicenseRequest* parsed_request_out);
|
||||
|
||||
explicit Session(std::unique_ptr<SessionImpl> impl);
|
||||
|
||||
explicit Session(std::unique_ptr<ExternalPlayReadySessionImpl>
|
||||
external_playready_session_impl);
|
||||
|
||||
std::shared_ptr<EnvironmentImpl> env_impl_;
|
||||
std::unique_ptr<SessionImpl> impl_;
|
||||
std::unique_ptr<ExternalPlayReadySessionImpl>
|
||||
external_playready_session_impl_;
|
||||
static absl::Mutex profile_mutex_;
|
||||
static std::unique_ptr<SecurityProfileList> security_profile_list_
|
||||
ABSL_GUARDED_BY(profile_mutex_);
|
||||
};
|
||||
|
||||
} // namespace video_widevine
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_SESSION_H__
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVDRM_LICENSE_SERVER_SDK_SESSION_H_
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
// Copyright 2017 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_EXTERNAL_COMMON_WVPL_WVPL_LICENSE_COUNTER_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_EXTERNAL_COMMON_WVPL_WVPL_LICENSE_COUNTER_H_
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_LICENSE_SERVER_SDK_WVPL_LICENSE_COUNTER_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_LICENSE_SERVER_SDK_WVPL_LICENSE_COUNTER_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
#include "sdk/external/cpp/wvpl/common/wvpl_types.h"
|
||||
#include "protos/public/provisioned_device_info.pb.h"
|
||||
#include "protos/public/sdk_stats.pb.h"
|
||||
|
||||
@@ -99,4 +100,4 @@ class WvPLLicenseCounter {
|
||||
} // namespace wv_pl_sdk
|
||||
} // namespace video_widevine_server
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_EXTERNAL_COMMON_WVPL_WVPL_LICENSE_COUNTER_H_
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_LICENSE_SERVER_SDK_WVPL_LICENSE_COUNTER_H_
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
// Copyright 2017 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_ENVIRONMENT_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_ENVIRONMENT_H_
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_COMMON_WVPL_SDK_ENVIRONMENT_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_COMMON_WVPL_SDK_ENVIRONMENT_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
#include "sdk/external/cpp/wvpl/common/wvpl_types.h"
|
||||
#include "protos/public/client_identification.pb.h"
|
||||
#include "protos/public/device_security_profile_list.pb.h"
|
||||
#include "protos/public/provider_key.pb.h"
|
||||
#include "protos/public/security_profile.pb.h"
|
||||
|
||||
namespace video_widevine {
|
||||
@@ -152,6 +153,22 @@ class WvPLSDKEnvironment {
|
||||
*/
|
||||
static WvPLDeviceInfo GetDeviceInfo(uint32_t system_id);
|
||||
|
||||
/**
|
||||
* Set the provider key used for L3 CDM.
|
||||
* |provider_key_config_bytes| is a serialized ProviderKeyConfig proto
|
||||
* message. Returns OK if parsing is successful, otherwise an error is
|
||||
* returned.
|
||||
*/
|
||||
virtual WvPLStatus SetProviderKeyConfig(
|
||||
const std::string& provider_key_config_bytes);
|
||||
|
||||
/**
|
||||
* Returns the provider key config used for L3 CDM.
|
||||
*/
|
||||
const video_widevine::ProviderKeyConfig& GetProviderKeyConfig() const {
|
||||
return provider_key_config_;
|
||||
}
|
||||
|
||||
protected:
|
||||
// Return the signature for the provider specified in the |config_values|
|
||||
// parameter in the constructor. |signature| is owned by the caller.
|
||||
@@ -197,6 +214,8 @@ class WvPLSDKEnvironment {
|
||||
// List of device system Ids to succeed even if the device is revoked.
|
||||
std::vector<uint32_t> allowed_revoked_devices_
|
||||
ABSL_GUARDED_BY(allowed_revoked_devices_mutex_);
|
||||
// Provider key config used with L3 CDM.
|
||||
video_widevine::ProviderKeyConfig provider_key_config_;
|
||||
|
||||
private:
|
||||
// Get the expected service type for drm service certificate.
|
||||
@@ -244,4 +263,4 @@ class WvPLSDKEnvironment {
|
||||
} // namespace wv_pl_sdk
|
||||
} // namespace video_widevine_server
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_ENVIRONMENT_H_
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_COMMON_WVPL_SDK_ENVIRONMENT_H_
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2018 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_SESSION_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_SESSION_H_
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_COMMON_WVPL_SDK_SESSION_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_COMMON_WVPL_SDK_SESSION_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "common/security_profile_list.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
#include "sdk/external/cpp/wvpl/common/wvpl_types.h"
|
||||
#include "protos/public/device_certificate_status.pb.h"
|
||||
|
||||
namespace video_widevine {
|
||||
@@ -219,6 +219,7 @@ class WvPLSDKSession {
|
||||
WvPLRequestType request_type_;
|
||||
bool has_session_state_ = false;
|
||||
bool has_encrypted_client_id_ = false;
|
||||
bool using_generated_content_id_ = false;
|
||||
std::string provider_;
|
||||
std::string provider_iv_;
|
||||
std::string provider_key_;
|
||||
@@ -331,6 +332,10 @@ class WvPLSDKSession {
|
||||
DeviceStatus GetDeviceStatus(video_widevine::DeviceCertificateStatus::Status
|
||||
device_certificate_status) const;
|
||||
|
||||
bool using_generated_content_id() const {
|
||||
return using_generated_content_id_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<uint32_t> system_id_;
|
||||
bool has_policy_ = false;
|
||||
@@ -344,4 +349,4 @@ class WvPLSDKSession {
|
||||
} // namespace wv_pl_sdk
|
||||
} // namespace video_widevine_server
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_COMMON_WVPL_WVPL_SDK_SESSION_H_
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_COMMON_WVPL_SDK_SESSION_H_
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// Copyright 2017 Google LLC. All rights reserved.
|
||||
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_EXTERNAL_COMMON_WVPL_WVPL_SESSION_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_EXTERNAL_COMMON_WVPL_WVPL_SESSION_H_
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_LICENSE_SERVER_SDK_WVPL_SESSION_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_LICENSE_SERVER_SDK_WVPL_SESSION_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "license_server_sdk/public/session.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_sdk_session.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
#include "sdk/external/cpp/wvdrm/license_server_sdk/session.h"
|
||||
#include "sdk/external/cpp/wvpl/common/wvpl_sdk_session.h"
|
||||
#include "sdk/external/cpp/wvpl/common/wvpl_types.h"
|
||||
#include "protos/public/errors.pb.h"
|
||||
#include "protos/public/license_server_sdk.pb.h"
|
||||
#include "protos/public/oem_key_container.pb.h"
|
||||
@@ -28,9 +28,9 @@ namespace wv_pl_sdk {
|
||||
class WvPLLicenseCounter;
|
||||
|
||||
// major version to line up with latest released OEMCryptoAPI version.
|
||||
const uint32_t kMajorVersion = 16;
|
||||
const uint32_t kMinorVersion = 5;
|
||||
const uint32_t kRelease = 0;
|
||||
const uint32_t kMajorVersion = 17;
|
||||
const uint32_t kMinorVersion = 0;
|
||||
const uint32_t kRelease = 1;
|
||||
|
||||
// Once a Widevine environment object is successfully initialized, generate a
|
||||
// Widevine session object for each license request. CreateSession() parses
|
||||
@@ -116,4 +116,4 @@ class WvPLSession : public WvPLSDKSession {
|
||||
} // namespace wv_pl_sdk
|
||||
} // namespace video_widevine_server
|
||||
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_EXTERNAL_COMMON_WVPL_WVPL_SESSION_H_
|
||||
#endif // VIDEO_WIDEVINE_EXPORT_SDK_EXTERNAL_CPP_WVPL_LICENSE_SERVER_SDK_WVPL_SESSION_H_
|
||||
|
||||
Reference in New Issue
Block a user