Update drm_certificate.proto
[ Merge of http://go/wvgerrit/118563 ] Sync with the latest version of drm_certificate.proto to add in certificate expiry time. Add in signed_drm_certificate.proto and remove messages from device_certificate.proto. SignedDrmDeviceCertificate and DrmDeviceCertificate are now named SignedDrmCertificate and DrmCertificate. This necessitated non-proto changes. Bug: 169740403 Test: WV unit/integration tests Change-Id: Ie5969ac7217a25eb075a41df59b77da2becd4545
This commit is contained in:
@@ -129,10 +129,10 @@ namespace wvcdm {
|
||||
|
||||
// Protobuf generated classes.
|
||||
using video_widevine::ClientIdentification;
|
||||
using video_widevine::DrmDeviceCertificate;
|
||||
using video_widevine::DrmCertificate;
|
||||
using video_widevine::EncryptedClientIdentification;
|
||||
using video_widevine::LicenseError;
|
||||
using video_widevine::SignedDrmDeviceCertificate;
|
||||
using video_widevine::SignedDrmCertificate;
|
||||
using video_widevine::SignedMessage;
|
||||
|
||||
CdmResponseType ServiceCertificate::Init(const std::string& certificate) {
|
||||
@@ -140,12 +140,12 @@ CdmResponseType ServiceCertificate::Init(const std::string& certificate) {
|
||||
sizeof(kRootCertForProd));
|
||||
|
||||
// Load root cert public key. Don't bother verifying it.
|
||||
SignedDrmDeviceCertificate signed_root_cert;
|
||||
SignedDrmCertificate signed_root_cert;
|
||||
if (!signed_root_cert.ParseFromString(root_cert_str)) {
|
||||
LOGE("Failed to deserialize signed root certificate");
|
||||
return DEVICE_CERTIFICATE_ERROR_1;
|
||||
}
|
||||
DrmDeviceCertificate root_cert;
|
||||
DrmCertificate root_cert;
|
||||
if (!root_cert.ParseFromString(signed_root_cert.drm_certificate())) {
|
||||
LOGE("Failed to deserialize root certificate");
|
||||
return DEVICE_CERTIFICATE_ERROR_1;
|
||||
@@ -158,7 +158,7 @@ CdmResponseType ServiceCertificate::Init(const std::string& certificate) {
|
||||
|
||||
// Load the provided service certificate.
|
||||
// First, parse it and verify its signature.
|
||||
SignedDrmDeviceCertificate signed_service_cert;
|
||||
SignedDrmCertificate signed_service_cert;
|
||||
if (!signed_service_cert.ParseFromString(certificate)) {
|
||||
LOGE("Failed to parse signed service certificate");
|
||||
return DEVICE_CERTIFICATE_ERROR_2;
|
||||
@@ -174,19 +174,17 @@ CdmResponseType ServiceCertificate::Init(const std::string& certificate) {
|
||||
}
|
||||
#endif
|
||||
|
||||
DrmDeviceCertificate service_cert;
|
||||
DrmCertificate service_cert;
|
||||
if (!service_cert.ParseFromString(signed_service_cert.drm_certificate())) {
|
||||
LOGE("Failed to parse service certificate");
|
||||
return DEVICE_CERTIFICATE_ERROR_2;
|
||||
}
|
||||
if (service_cert.type() !=
|
||||
video_widevine::DrmDeviceCertificate_CertificateType_SERVICE) {
|
||||
if (service_cert.type() != video_widevine::DrmCertificate_Type_SERVICE) {
|
||||
LOGE(
|
||||
"DRM device certificate type is not a service certificate: "
|
||||
"type = %d, expected_type = %d",
|
||||
static_cast<int>(service_cert.type()),
|
||||
static_cast<int>(
|
||||
video_widevine::DrmDeviceCertificate_CertificateType_SERVICE));
|
||||
static_cast<int>(video_widevine::DrmCertificate_Type_SERVICE));
|
||||
return DEVICE_CERTIFICATE_ERROR_3;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user