From 5ee5d005149b6d26ae1e110d4b00a6e4a26b76e7 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Thu, 9 May 2019 13:24:04 -0700 Subject: [PATCH] Report OEMCrypto Build Information in License Request Merge from Widevine repo of http://go/wvgerrit/78623 This updates the license request client identification to include OEMCrypto build information. Bug: 129070445 Test: ExoPlayer on crosshatch with mod mock Change-Id: I0dbce0cca4e9810e14f60561e4e434f1dbcadfb6 --- libwvdrmengine/cdm/core/include/crypto_session.h | 1 + libwvdrmengine/cdm/core/src/client_identification.cpp | 8 ++++++++ libwvdrmengine/cdm/core/src/crypto_session.cpp | 9 +++++++++ 3 files changed, 18 insertions(+) diff --git a/libwvdrmengine/cdm/core/include/crypto_session.h b/libwvdrmengine/cdm/core/include/crypto_session.h index 0d0230a5..721f308b 100644 --- a/libwvdrmengine/cdm/core/include/crypto_session.h +++ b/libwvdrmengine/cdm/core/include/crypto_session.h @@ -177,6 +177,7 @@ class CryptoSession { virtual bool GetBuildInformation(SecurityLevel security_level, std::string* info); + virtual bool GetBuildInformation(std::string* info); virtual uint32_t IsDecryptHashSupported(SecurityLevel security_level); diff --git a/libwvdrmengine/cdm/core/src/client_identification.cpp b/libwvdrmengine/cdm/core/src/client_identification.cpp index 1a1d864f..4948f76e 100644 --- a/libwvdrmengine/cdm/core/src/client_identification.cpp +++ b/libwvdrmengine/cdm/core/src/client_identification.cpp @@ -24,6 +24,8 @@ const std::string kKeyDeviceId = "device_id"; const std::string kKeyWvCdmVersion = "widevine_cdm_version"; const std::string kKeyOemCryptoSecurityPatchLevel = "oem_crypto_security_patch_level"; +const std::string kKeyOemCryptoBuildInformation = + "oem_crypto_build_information"; } // unnamed namespace namespace wvcdm { @@ -272,6 +274,12 @@ CdmResponseType ClientIdentification::Prepare( client_capabilities->set_resource_rating_tier(tier); } } + std::string info; + if (crypto_session_->GetBuildInformation(&info)) { + client_info = client_id->add_client_info(); + client_info->set_name(kKeyOemCryptoBuildInformation); + client_info->set_value(info); + } } return NO_ERROR; diff --git a/libwvdrmengine/cdm/core/src/crypto_session.cpp b/libwvdrmengine/cdm/core/src/crypto_session.cpp index 3576fec5..4b77072a 100644 --- a/libwvdrmengine/cdm/core/src/crypto_session.cpp +++ b/libwvdrmengine/cdm/core/src/crypto_session.cpp @@ -1880,6 +1880,15 @@ bool CryptoSession::GetResourceRatingTier(SecurityLevel security_level, return true; } +bool CryptoSession::GetBuildInformation(std::string* info) { + LOGV("CryptoSession::GetBuildInformation"); + if (!open_) { + LOGW("CryptoSession::GetBuildInformation: session not open"); + return false; + } + return GetBuildInformation(requested_security_level_, info); +} + bool CryptoSession::GetBuildInformation(SecurityLevel security_level, std::string* info) { LOGV("GetBuildInformation");