Files
android/libwvdrmengine/cdm/core/include/client_identification.h
Rahul Frias 3acc64a478 Added an OTA keybox provisioner.
[ Merge of http://go/wvgerrit/133729 ]
[ Cherry pick of http://ag/15836224 ]

The OtaKeyboxProvisioner is a system-wide provisioner for sharing the
provisioning workflow between CDM engines.

Bug: 189232882
Test: GtsMediaTestCases
Change-Id: I873af3087cc05e1831bdd1d2c14fb002b73e6902

Added keybox provisioning proto fields.

[ Merge of http://go/wvgerrit/133730 and http://go/ag/15113032 ]

This CL copies over the required license_protocol.proto changes that
are required for OTA keybox provisioning.  These fields are defined in
the server-side certificate_provisioning.proto, defined in
http://cl/377533774.

Note, changes are slightly different from server proto due to the RVC
version of license_protocol.proto being out of date with SC and newer
changes.

Bug: 189232882
Test: run_x86_64_tests
Change-Id: I55fcf6a7ac2ba4b6026b9acc63e822ff33c431d9

Added OTA keybox provisioning device files.

[ Merge of http://go/wvgerrit/133743 and http://go/ag/15421141 ]

This change adds a new set of proto messages/fields the CDM's device
files for recording device and engine information around OTA keybox
provisioning (OKP).

To make cleanup and thread protection possible, there is a single file
which will contain all the information for the device as a whole and
each CDM engine tied to an app/origin.

Bug: 189232882
Test: Linux unit tests
Change-Id: Iaf80cd6342f32657e04416750d9b278d935821a5

Client ID for OKP requests.

[ Merge of http://go/wvgerrit/133744 and http://go/ag/15645331 ]

Extended the CDM ClientIdentification class to support a subset of
client info used for OKP requests.

Bug: 189232882
Test: Android unit tests
Change-Id: I6aafb4f2164efe69bc733ece0a912f0e91893b91
2021-09-29 14:00:36 -07:00

64 lines
2.3 KiB
C++

// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
#ifndef WVCDM_CORE_CLIENT_IDENTIFICATION_H_
#define WVCDM_CORE_CLIENT_IDENTIFICATION_H_
#include <string>
// ClientIdentification fills in the ClientIdentification portion
// of the License or Provisioning request messages.
#include "disallow_copy_and_assign.h"
#include "license_protocol.pb.h"
#include "wv_cdm_types.h"
namespace wvcdm {
class CryptoSession;
class ClientIdentification {
public:
ClientIdentification() {}
virtual ~ClientIdentification() {}
// Call this method when used with provisioning requests
CdmResponseType InitForProvisioning(CryptoSession* crypto_session);
// Use in conjunction with license requests
// |client_token| must be provided
// |crypto_session| input parameter, mandatory
CdmResponseType InitForLicenseRequest(const std::string& client_token,
CryptoSession* crypto_session);
CdmResponseType InitForOtaKeyboxProvisioning(CryptoSession* crypto_session);
// Fill the ClientIdentification portion of the license, DRM cert
// provisioning or OTA keybox provisioning request.
// |app_parameters| parameters provided by client/app to be included in
// provisioning/license request. optional, only used
// if |is_license_request| is true
// |provider_client_token| optional parameter specified by the content
// and included in the license. Only used if
// specified and if |is_license_request| is true
// |client_id| Portion of license/provisioning request that needs to be
// populated.
virtual CdmResponseType Prepare(
const CdmAppParameterMap& app_parameters,
const std::string& provider_client_token,
video_widevine::ClientIdentification* client_id);
private:
bool GetProvisioningTokenType(
video_widevine::ClientIdentification::TokenType* token_type);
bool is_license_request_ = false;
bool is_okp_request_ = false;
std::string client_token_;
std::string device_id_;
CryptoSession* crypto_session_ = nullptr;
CORE_DISALLOW_COPY_AND_ASSIGN(ClientIdentification);
};
} // namespace wvcdm
#endif // WVCDM_CORE_CLIENT_IDENTIFICATION_H_