Add custom key fetcher callback to Simulcrypt ECMG

This commit is contained in:
Lu Chen
2020-09-18 18:34:38 -07:00
parent 02c1c8adf5
commit 90bbcb4b4d
14 changed files with 720 additions and 42 deletions

View File

@@ -1,9 +1,15 @@
// Copyright 2017 Google LLC. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
// Copyright 2017 Google LLC.
//
// This software is licensed under the terms defined in the Widevine Master
// License Agreement. For a copy of this agreement, please contact
// widevine-licensing@google.com.
////////////////////////////////////////////////////////////////////////////////
#ifndef VIDEO_WIDEVINE_EXPORT_COMMON_CERTIFICATE_TYPE_H_
#define VIDEO_WIDEVINE_EXPORT_COMMON_CERTIFICATE_TYPE_H_
#ifndef COMMON_CERTIFICATE_TYPE_H_
#define COMMON_CERTIFICATE_TYPE_H_
namespace video_widevine {
namespace widevine {
enum CertificateType {
kCertificateTypeTesting,
@@ -11,6 +17,6 @@ enum CertificateType {
kCertificateTypeProduction,
};
} // namespace video_widevine
} // namespace widevine
#endif // VIDEO_WIDEVINE_EXPORT_COMMON_CERTIFICATE_TYPE_H_
#endif // COMMON_CERTIFICATE_TYPE_H_

View File

@@ -1,14 +1,20 @@
// Copyright 2020 Google LLC. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
// Copyright 2020 Google LLC.
//
// This software is licensed under the terms defined in the Widevine Master
// License Agreement. For a copy of this agreement, please contact
// widevine-licensing@google.com.
////////////////////////////////////////////////////////////////////////////////
//
// Description:
// Container of Widevine default security profiless.
#ifndef VIDEO_WIDEVINE_EXPORT_COMMON_DEFAULT_DEVICE_SECURITY_PROFILE_LIST_H_
#define VIDEO_WIDEVINE_EXPORT_COMMON_DEFAULT_DEVICE_SECURITY_PROFILE_LIST_H_
#ifndef COMMON_DEFAULT_DEVICE_SECURITY_PROFILE_LIST_H_
#define COMMON_DEFAULT_DEVICE_SECURITY_PROFILE_LIST_H_
#include "video/widevine/export/common/security_profile_list.h"
#include "common/security_profile_list.h"
namespace video_widevine {
namespace widevine {
class DefaultDeviceSecurityProfileList : public SecurityProfileList {
public:
@@ -28,6 +34,6 @@ class DefaultDeviceSecurityProfileList : public SecurityProfileList {
std::vector<std::string>* default_profile_strings) const;
};
} // namespace video_widevine
} // namespace widevine
#endif // VIDEO_WIDEVINE_EXPORT_COMMON_DEFAULT_DEVICE_SECURITY_PROFILE_LIST_H_
#endif // COMMON_DEFAULT_DEVICE_SECURITY_PROFILE_LIST_H_

View File

@@ -1,20 +1,26 @@
// Copyright 2020 Google LLC. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
// Copyright 2020 Google LLC.
//
// This software is licensed under the terms defined in the Widevine Master
// License Agreement. For a copy of this agreement, please contact
// widevine-licensing@google.com.
////////////////////////////////////////////////////////////////////////////////
//
// Description:
// Container of device security profiles. Security profiles indicate rules
// to allow using the profile. The rules are based on DRM capabilities of a
// device.
#ifndef VIDEO_WIDEVINE_EXPORT_COMMON_SECURITY_PROFILE_LIST_H_
#define VIDEO_WIDEVINE_EXPORT_COMMON_SECURITY_PROFILE_LIST_H_
#ifndef COMMON_SECURITY_PROFILE_LIST_H_
#define COMMON_SECURITY_PROFILE_LIST_H_
#include "third_party/absl/synchronization/mutex.h"
#include "video/widevine/protos/public/client_identification.proto.h"
#include "video/widevine/protos/public/device_security_profile_data.proto.h"
#include "video/widevine/protos/public/provisioned_device_info.proto.h"
#include "video/widevine/protos/public/security_profile.proto.h"
#include "absl/synchronization/mutex.h"
#include "protos/public/client_identification.pb.h"
#include "protos/public/device_security_profile_data.pb.h"
#include "protos/public/provisioned_device_info.pb.h"
#include "protos/public/security_profile.pb.h"
namespace video_widevine {
namespace widevine {
using ClientCapabilities = ClientIdentification::ClientCapabilities;
// The SecurityProfileList will hold all security profiles. During license
@@ -76,10 +82,10 @@ class SecurityProfileList {
const ClientIdentification& client_id,
const ProvisionedDeviceInfo& device_info) const;
int64 GetCurrentTimeSeconds() const;
int64_t GetCurrentTimeSeconds() const;
bool IsProfileActive(const SecurityProfile& profile,
int64 current_time_seconds) const;
int64_t current_time_seconds) const;
mutable absl::Mutex mutex_;
// Security profiles
@@ -87,5 +93,5 @@ class SecurityProfileList {
std::vector<SecurityProfile> security_profiles_ ABSL_GUARDED_BY(mutex_);
};
} // namespace video_widevine
#endif // VIDEO_WIDEVINE_EXPORT_COMMON_SECURITY_PROFILE_LIST_H_
} // namespace widevine
#endif // COMMON_SECURITY_PROFILE_LIST_H_