WvPL License SDK release: 16.5.0
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "license_server_sdk/external/common/wvpl/wvpl_license_counter.h"
|
||||
#include "license_server_sdk/external/common/wvpl/wvpl_session.h"
|
||||
|
||||
using video_widevine::Session;
|
||||
using video_widevine_server::wv_pl_sdk::HDCP_V1;
|
||||
using video_widevine_server::wv_pl_sdk::HDCP_V2;
|
||||
using video_widevine_server::wv_pl_sdk::kDeviceCertificateExpiration;
|
||||
@@ -53,12 +52,6 @@ const char kValidCertList[] =
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
// The preProvKeys map takes a device systemID as the key and an associated
|
||||
// preprovisioning key as value.
|
||||
std::map<uint32_t, std::string> prev_prov_keys;
|
||||
prev_prov_keys[kSystemId] = kPreProvisioningKey;
|
||||
Session::SetPreProvisioningKeys(prev_prov_keys);
|
||||
|
||||
// -- Set up WvPLEnvironment.
|
||||
|
||||
std::map<std::string, std::string> config;
|
||||
@@ -81,6 +74,12 @@ int main(int argc, char** argv) {
|
||||
return status.error_code();
|
||||
}
|
||||
|
||||
// The preProvKeys map takes a device systemID as the key and an associated
|
||||
// preprovisioning key as value.
|
||||
std::map<uint32_t, std::string> prev_prov_keys;
|
||||
prev_prov_keys[kSystemId] = kPreProvisioningKey;
|
||||
wvpl_env.SetPreProvisioningKeys(prev_prov_keys);
|
||||
|
||||
std::string b64DrmServiceCertificate =
|
||||
"CsMCCAMSENU2hMYAMrDf+"
|
||||
"Z9TlWepj1UY7eXE9gUijgIwggEKAoIBAQCqBNtJ830093pLL7h0daCvCUY7WQ8nrNfyYa5NI"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "license_server_sdk/external/common/wvpl/wvpl_session.h"
|
||||
|
||||
using video_widevine::kDefaultProfileOwnerName;
|
||||
using video_widevine::Session;
|
||||
using video_widevine_server::wv_pl_sdk::HDCP_NONE;
|
||||
using video_widevine_server::wv_pl_sdk::HDCP_V1;
|
||||
using video_widevine_server::wv_pl_sdk::kDeviceCertificateExpiration;
|
||||
@@ -266,12 +265,6 @@ int GenerateLicense(WvPLSession& session, const std::string& content_owner,
|
||||
*/
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
// The preProvKeys map takes a device systemID as the key and an associated
|
||||
// preprovisioning key as value.
|
||||
std::map<uint32_t, std::string> prev_prov_keys;
|
||||
prev_prov_keys[kSystemId] = kPreProvisioningKey;
|
||||
Session::SetPreProvisioningKeys(prev_prov_keys);
|
||||
|
||||
// Set up WvPLEnvironment.
|
||||
std::map<std::string, std::string> config;
|
||||
// Set device certificate expiration time to 10 years (10 * 365 * 24 * 3600).
|
||||
@@ -293,6 +286,12 @@ int main(int argc, char** argv) {
|
||||
return status.error_code();
|
||||
}
|
||||
|
||||
// The preProvKeys map takes a device systemID as the key and an associated
|
||||
// preprovisioning key as value.
|
||||
std::map<uint32_t, std::string> prev_prov_keys;
|
||||
prev_prov_keys[kSystemId] = kPreProvisioningKey;
|
||||
wvpl_env.SetPreProvisioningKeys(prev_prov_keys);
|
||||
|
||||
std::string b64DecodedDrmServiceCertificate;
|
||||
std::string b64DecodedPrivateKey;
|
||||
if (!absl::Base64Unescape(b64DrmServiceCertificate,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "license_server_sdk/public/environment.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_sdk_environment.h"
|
||||
#include "sdk/external/common/wvpl/wvpl_types.h"
|
||||
|
||||
@@ -15,6 +16,8 @@
|
||||
namespace video_widevine_server {
|
||||
namespace wv_pl_sdk {
|
||||
|
||||
using video_widevine::Environment;
|
||||
|
||||
class WvPLLicenseCounter;
|
||||
class WvPLSession;
|
||||
|
||||
@@ -36,6 +39,7 @@ class WvPLSession;
|
||||
// std::string service_cert;
|
||||
// WVStatus status;
|
||||
// status = wvpl_environment->Initialize();
|
||||
// wvpl_environment->SetPreProvisioningKeys(prev_prov_keys);
|
||||
// status = wvpl_environment->SetDrmServiceCertificate(
|
||||
// "<Provider service cert>", "<Service Private Key>",
|
||||
// "<Service Private Key Passphrase>");
|
||||
@@ -53,6 +57,8 @@ class WvPLEnvironment : public WvPLSDKEnvironment {
|
||||
|
||||
virtual ~WvPLEnvironment();
|
||||
|
||||
// TODO(b/194740480): This function will be changed to private since end-Q3
|
||||
// 2021 release.
|
||||
// One time initialization. Must be called once after construction.
|
||||
virtual WvPLStatus Initialize();
|
||||
|
||||
@@ -95,10 +101,13 @@ class WvPLEnvironment : public WvPLSDKEnvironment {
|
||||
virtual WvPLStatus GetStatsAsBytes(bool flush_data,
|
||||
std::string* signed_license_stats);
|
||||
|
||||
// Return the license counter data in a human-readable format. The internal
|
||||
// data is flushed if |flush_data| is true. If |flush_data| is false,
|
||||
// license counters will accumulate. If this call returns "Status::OK",
|
||||
// |license_stats| is populated. |license_stats| is owned by the caller.
|
||||
// TODO(b/193921143): flush_data parameter will be removed since end-Q3 2021
|
||||
// release.
|
||||
// Return the license counter data in a human-readable format. The
|
||||
// internal data is flushed if |flush_data| is true. If |flush_data| is
|
||||
// false, license counters will accumulate. If this call returns
|
||||
// "Status::OK", |license_stats| is populated. |license_stats| is owned by
|
||||
// the caller.
|
||||
virtual WvPLStatus GetStatsAsString(bool flush_data,
|
||||
std::string* license_stats);
|
||||
|
||||
@@ -120,9 +129,11 @@ class WvPLEnvironment : public WvPLSDKEnvironment {
|
||||
|
||||
// Generate a signed request to be sent to Widevine Certificate Provisioning
|
||||
// Server to retrieve 'DeviceCertificateStatusList'.
|
||||
virtual WvPLStatus GenerateDeviceStatusListRequest(
|
||||
std::string* signed_device_certificate_status_list_request);
|
||||
WvPLStatus GenerateDeviceStatusListRequest(
|
||||
std::string* signed_device_certificate_status_list_request) override;
|
||||
|
||||
// TODO(b/193920802): This function will be changed to private function in
|
||||
// mid-2021 Q3 release.
|
||||
// Get the expected service type for drm service certificate. The expected
|
||||
// value is LICENSE_SERVER_SDK.
|
||||
int GetExpectedServiceCertificateType() override;
|
||||
@@ -154,6 +165,9 @@ class WvPLEnvironment : public WvPLSDKEnvironment {
|
||||
// send a v17 message by setting the std::string to "16". For details, please see
|
||||
// common/oemcrypto_core_message/odk/include/core_message_features.h
|
||||
std::string core_message_features_;
|
||||
// A few functions from license_server_sdk/public/environment are used to run
|
||||
// wvpl_environment.
|
||||
std::unique_ptr<Environment> environment_;
|
||||
};
|
||||
|
||||
} // namespace wv_pl_sdk
|
||||
|
||||
@@ -29,8 +29,8 @@ class WvPLLicenseCounter;
|
||||
|
||||
// major version to line up with latest released OEMCryptoAPI version.
|
||||
const uint32_t kMajorVersion = 16;
|
||||
const uint32_t kMinorVersion = 4;
|
||||
const uint32_t kRelease = 5;
|
||||
const uint32_t kMinorVersion = 5;
|
||||
const uint32_t kRelease = 0;
|
||||
|
||||
// Once a Widevine environment object is successfully initialized, generate a
|
||||
// Widevine session object for each license request. CreateSession() parses
|
||||
@@ -67,9 +67,10 @@ class WvPLSession : public WvPLSDKSession {
|
||||
// <major_version>.<minor_version>.<release>
|
||||
static std::string GetVersionString();
|
||||
|
||||
// TODO(b/193921795): this API will be deprecated since end-Q3 2021 release.
|
||||
// Please use GetDeviceInfo() instead.
|
||||
// Returns true if a provisioned device info exists. Populates the specified
|
||||
// |device_info| structure.
|
||||
// TODO(hali): Deprecate this API and use GetDeviceInfo() instead.
|
||||
virtual bool GetProvisionedDeviceInfo(WvPLDeviceInfo* device_info) const;
|
||||
|
||||
// Populates the specified |device_info| structure. This API works only for
|
||||
|
||||
@@ -3,18 +3,28 @@
|
||||
#ifndef VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_ENVIRONMENT_H_
|
||||
#define VIDEO_WIDEVINE_EXPORT_LICENSE_SERVER_SDK_PUBLIC_ENVIRONMENT_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#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"
|
||||
|
||||
namespace video_widevine {
|
||||
|
||||
constexpr char kWrappingKeyLabel[] = "ENCRYPTION";
|
||||
constexpr uint32_t kWrappingKeySizeBits = 128;
|
||||
constexpr char kSigningKeyLabel[] = "AUTHENTICATION";
|
||||
constexpr uint32_t kSigningKeySizeBits = 256;
|
||||
|
||||
class Environment {
|
||||
public:
|
||||
Environment(absl::string_view provider, const DrmRootCertificate* root_cert);
|
||||
|
||||
~Environment();
|
||||
virtual ~Environment();
|
||||
|
||||
// Add a service certificate system-wide.
|
||||
// |service_certificate| is a Google-generated certificate used to
|
||||
@@ -30,16 +40,205 @@ class Environment {
|
||||
// Returns true if service certificate is loaded.
|
||||
bool is_service_certificate_loaded();
|
||||
|
||||
// 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.
|
||||
void SetDevicesToHandleOEMCryptoVersionInKCB(
|
||||
const std::string& system_id_list);
|
||||
|
||||
void SetPreProvisioningKeys(const std::map<uint32_t, std::string>& keys);
|
||||
|
||||
void SetPreProvisioningKeys(const std::multimap<uint32_t, std::string>& keys);
|
||||
|
||||
// Set the certificate status list system-wide.
|
||||
// |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.
|
||||
Status SetCertificateStatusList(const std::string& certificate_status_list,
|
||||
uint32_t expiration_period_seconds,
|
||||
bool allow_unknown_devices);
|
||||
|
||||
// Enable delivery of licenses to client devices. This includes devices with
|
||||
// TEST_ONLY status, and development platform verification certificates.
|
||||
// Defaults to false.
|
||||
void AllowDevelopmentClients(bool enable);
|
||||
|
||||
// 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.
|
||||
void AllowTestOnlyDevicesByMake(const std::string& device_list_make);
|
||||
|
||||
// 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.
|
||||
void AllowTestOnlyDevicesByProvider(const std::string& device_list_provider);
|
||||
|
||||
// Enable delivery of licenses to revoked client devices. |system_id_list| is
|
||||
// a comma separated list of systems Ids to allow even if revoked.
|
||||
void AllowRevokedDevices(const std::string& system_id_list);
|
||||
|
||||
// A comma separated list of DRM Certificate Serial Numbers that are revoked.
|
||||
void RevokedDrmCertificateSerialNumbers(
|
||||
const std::string& drm_certificate_serial_numbers);
|
||||
|
||||
// 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. This restricts the features that the server will support in an
|
||||
// oemcrypto core message. For example, we may restrict the server to never
|
||||
// send a v17 message by setting the std::string to "16". For details, please see
|
||||
// common/oemcrypto_core_message/odk/include/core_message_features.h
|
||||
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
|
||||
// Environment::GenerateErrorResponse should be invoked.
|
||||
// Example usage:
|
||||
// Environment env = absl::make_unique<Environment>(kProvider,
|
||||
// drm_root_cert);
|
||||
// Session* session = NULL;
|
||||
// Status status = env->CreateSession(request_from_client,&session);
|
||||
// if (!status.ok()) {
|
||||
// std::string error_license;
|
||||
// if (env->GenerateErrorResponse(status, &error_license)) {
|
||||
// // Send error_license to the client.
|
||||
// } else {
|
||||
// // Handle error
|
||||
// }
|
||||
// return ...
|
||||
// }
|
||||
// // Create license, invoke GenerateSignedLicense, etc.
|
||||
Status CreateSession(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.
|
||||
Status CreateSessionWithOptions(const std::string& signed_license_request,
|
||||
const SessionCreateOptions& options,
|
||||
Session** session);
|
||||
|
||||
// Variation of Environment::CreateSession which also fills in the parsed
|
||||
// LicenseRequest, for use in logging or debugging.
|
||||
Status CreateSession(const std::string& signed_license_request,
|
||||
const SessionCreateOptions& options, Session** session,
|
||||
LicenseRequest* parsed_request_out);
|
||||
|
||||
// Same as CreateSession(), 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|.
|
||||
Status CreateSessionForProxy(
|
||||
const std::string& signed_license_request,
|
||||
const PlatformVerificationStatus platform_verification_status,
|
||||
const ClientIdentification* client_id,
|
||||
const SessionCreateOptions& options, Session** session,
|
||||
LicenseRequest* parsed_request_out);
|
||||
|
||||
// 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 Environment::Create comments above.
|
||||
bool GenerateErrorResponse(const Status& status,
|
||||
std::string* signed_message_bytes);
|
||||
|
||||
// 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
|
||||
std::string DeriveKey(const std::string& key, const std::string& label,
|
||||
const std::string& context, const uint32_t size_bits);
|
||||
|
||||
// Returns a std::string containing the Widevine License Server SDK version in the
|
||||
// form <major_version>.<minor_version>.<release> <build date> <build time> .
|
||||
std::string GetSdkVersionString();
|
||||
|
||||
// If set to true, adds SDK and server version information to the license
|
||||
// response.
|
||||
void SetIncludeVersionInfoInLicense(bool include_version_info);
|
||||
|
||||
// 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 '.'.
|
||||
void SetHostServerVersion(const std::string& host_version);
|
||||
|
||||
// Generate a signed request to be sent to Widevine Certificate Provisioning
|
||||
// Server to retrieve 'DeviceCertificateStatusList'.
|
||||
Status GenerateDeviceStatusListRequest(
|
||||
std::string* signed_device_certificate_status_list_request);
|
||||
|
||||
// Set the custom device security profile list which is returned, from a call
|
||||
// to Widevine PublishedDevicesService.
|
||||
Status SetCustomDeviceSecurityProfiles(
|
||||
absl::string_view serialized_signed_device_security_profiles);
|
||||
|
||||
// Return a list of the default profile names.
|
||||
Status GetDefaultDeviceSecurityProfileNames(
|
||||
std::vector<std::string>* profile_names) const;
|
||||
|
||||
// Return the default profile associated with |profile_name|.
|
||||
Status GetDefaultDeviceSecurityProfile(
|
||||
absl::string_view profile_name,
|
||||
SecurityProfile* device_security_profile) const;
|
||||
|
||||
// Obtain the owner list for custom profiles.
|
||||
Status GetCustomDeviceSecurityProfileOwners(
|
||||
std::vector<std::string>* custom_profile_owners) const;
|
||||
|
||||
// Return a list of custom profile names associated with |owner_name|.
|
||||
Status GetCustomDeviceSecurityProfileNames(
|
||||
absl::string_view owner_name,
|
||||
std::vector<std::string>* profile_names) const;
|
||||
|
||||
// Return the custom profiles associated with |owner_name|.
|
||||
Status GetCustomDeviceSecurityProfiles(
|
||||
absl::string_view owner_name,
|
||||
std::vector<SecurityProfile>* custom_device_security_profiles) const;
|
||||
|
||||
// If |auto_set_provider_session_token| is 'true', the provider session token
|
||||
// may be automatically set,
|
||||
//
|
||||
// The default setting for |auto_set_provider_session_token| is 'true'.
|
||||
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;
|
||||
|
||||
private:
|
||||
// Returns the DRM root certificate configured for this environment.
|
||||
const video_widevine::DrmRootCertificate* drm_root_certificate() const;
|
||||
bool is_service_certificate_loaded_ = false;
|
||||
// Environment::CreateSession which also fills in the parsed
|
||||
// ExternalLicenseRequest. Used to create a Session object.
|
||||
Status CreateSession(SignedMessage* signed_message, Session** session,
|
||||
ExternalLicenseRequest* parsed_request_out);
|
||||
|
||||
std::string provider_;
|
||||
// DRM root certificate used for verifying all other DRM certificates.
|
||||
const DrmRootCertificate* drm_root_certificate_;
|
||||
mutable absl::Mutex profile_mutex_;
|
||||
std::unique_ptr<video_widevine::SecurityProfileList>
|
||||
device_security_profile_list_ ABSL_GUARDED_BY(profile_mutex_);
|
||||
device_security_profile_list_;
|
||||
std::shared_ptr<EnvironmentImpl> env_impl_;
|
||||
friend class EnvironmentTest;
|
||||
};
|
||||
} // namespace video_widevine
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "common/status.h"
|
||||
#include "protos/public/client_identification.pb.h"
|
||||
#include "protos/public/device_certificate_status.pb.h"
|
||||
@@ -32,6 +33,7 @@ class ProvisionedDeviceInfo;
|
||||
class SecurityProfile;
|
||||
class SecurityProfileList;
|
||||
class SessionImpl;
|
||||
class EnvironmentImpl;
|
||||
class SessionInit;
|
||||
class SessionState;
|
||||
class SessionUsage;
|
||||
@@ -83,11 +85,17 @@ class Session {
|
||||
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
|
||||
@@ -95,8 +103,15 @@ class Session {
|
||||
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
|
||||
@@ -104,14 +119,23 @@ class Session {
|
||||
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.
|
||||
@@ -179,6 +203,9 @@ class Session {
|
||||
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
|
||||
@@ -189,12 +216,18 @@ class Session {
|
||||
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
|
||||
@@ -204,14 +237,23 @@ class Session {
|
||||
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
|
||||
@@ -219,22 +261,23 @@ class Session {
|
||||
// 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);
|
||||
|
||||
static const char* const kWrappingKeyLabel;
|
||||
static const uint32_t kWrappingKeySizeBits;
|
||||
static const char* const kSigningKeyLabel;
|
||||
static const uint32_t kSigningKeySizeBits;
|
||||
|
||||
virtual ~Session();
|
||||
virtual const LicenseRequest& request() const;
|
||||
virtual const std::string& GetSessionId();
|
||||
@@ -342,20 +385,32 @@ 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.
|
||||
@@ -363,6 +418,9 @@ class Session {
|
||||
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,
|
||||
@@ -387,10 +445,39 @@ 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);
|
||||
Session(std::shared_ptr<EnvironmentImpl> env_impl,
|
||||
std::unique_ptr<ExternalPlayReadySessionImpl>
|
||||
external_playready_session_impl);
|
||||
// For testing only. This allows unit tests to define a mock Session class.
|
||||
Session();
|
||||
|
||||
friend class Environment;
|
||||
|
||||
private:
|
||||
#ifndef SWIG
|
||||
Session(const Session&) = delete;
|
||||
@@ -408,10 +495,13 @@ class Session {
|
||||
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 std::unique_ptr<SecurityProfileList> security_profile_list_;
|
||||
static absl::Mutex profile_mutex_;
|
||||
static std::unique_ptr<SecurityProfileList> security_profile_list_
|
||||
ABSL_GUARDED_BY(profile_mutex_);
|
||||
};
|
||||
|
||||
} // namespace video_widevine
|
||||
|
||||
Reference in New Issue
Block a user