Merge latest oemcrypto-v17 change

No-Typo-Check: Not related to this change.

Bug: 161477208
Change-Id: I99e4780f6855b7045aa0cd5a49c13d2d0d51ed64
This commit is contained in:
Kyle Zhang
2022-01-21 05:58:12 +00:00
committed by Fred Gylys-Colwell
parent c924960962
commit 642965c678
176 changed files with 301013 additions and 296749 deletions

View File

@@ -11,17 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------
// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS. PLEASE
// CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
// DEPENDING ON IT IN YOUR PROJECT. ***
package {
// See: http://go/android-license-faq
// legacy_by_exception_only (by exception only)
default_applicable_licenses: ["vendor_widevine_license"],
}
// Builds libwvdrmdrmplugin_hidl
//
cc_library_static {

View File

@@ -272,7 +272,7 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
// List this field first so it is destructed last; ensure logging uid
// is cleared right before plugin is destructed.
wvcdm::LoggingUidSetter mLoggingUidSetter;
wvutil::LoggingUidSetter mLoggingUidSetter;
struct CryptoSession {
public:
@@ -487,6 +487,7 @@ struct WVDrmPlugin : public ::drm::V1_4::IDrmPlugin, IDrmPluginListener,
void DoTerminate() {
Mutex::Autolock lock(mLock);
for_each(mPlugins.begin(), mPlugins.end(), [] (WVDrmPlugin* plugin) {
ALOGI("WVDrmPlugin::Terminating plugin %p", (void*)plugin);
plugin->Close();
});
exit(0);

View File

@@ -24,7 +24,7 @@ class WVGenericCryptoInterface {
const uint8_t* key_id,
size_t key_id_length) {
return OEMCrypto_SelectKey(session, key_id, key_id_length,
OEMCrypto_CipherMode_CBC);
OEMCrypto_CipherMode_CBCS);
}
virtual OEMCryptoResult encrypt(OEMCrypto_SESSION session,

View File

@@ -202,7 +202,7 @@ WVDrmPlugin::WVDrmPlugin(const sp<WvContentDecryptionModule>& cdm,
}
WVDrmPlugin::~WVDrmPlugin() {
wvcdm::SetLoggingUid(mCdmIdentifierBuilder.user_id());
wvutil::SetLoggingUid(mCdmIdentifierBuilder.user_id());
Terminator::Forget(this);
Close();
}
@@ -1975,7 +1975,7 @@ Return<void> WVDrmPlugin::sendSessionLostState(
}
Return<void> WVDrmPlugin::getLogMessages(getLogMessages_cb _hidl_cb) {
const std::vector<wvcdm::LogMessage> &logs(wvcdm::g_logbuf.getLogs());
const std::vector<wvutil::LogMessage> &logs(wvutil::g_logbuf.getLogs());
_hidl_cb(::drm::V1_4::Status::OK, toHidlVec<::drm::V1_4::LogMessage>(logs));
return Void();
}
@@ -2236,7 +2236,7 @@ WVDrmPlugin::CdmIdentifierBuilder::CdmIdentifierBuilder(
mParent(parent) {
mCdmIdentifier.app_package_name = mAppPackageName;
mCdmIdentifier.unique_id = getNextUniqueId();
mCdmIdentifier.user_id = wvcdm::GetIpcCallingUid();
mCdmIdentifier.user_id = wvutil::GetIpcCallingUid();
}
Status WVDrmPlugin::CdmIdentifierBuilder::getCdmIdentifier(

View File

@@ -68,7 +68,7 @@ using wvcdm::kLicenseTypeRelease;
using wvcdm::kLicenseTypeStreaming;
using wvcdm::kSecurityLevelL1;
using wvcdm::kSecurityLevelL3;
using wvcdm::Base64Encode;
using wvutil::Base64Encode;
using wvcdm::CdmAppParameterMap;
using wvcdm::CdmCertificateType;
using wvcdm::CdmClientPropertySet;
@@ -1281,7 +1281,7 @@ TEST_F(WVDrmPluginTest, ReturnsExpectedPropertyValues) {
static const std::string oemCryptoPartnerDefinedHash = "2";
static const std::string decryptHashErrorBadHashAndFrameNumber = "53, 1";
drm_metrics::WvCdmMetrics expected_metrics;
std::string serialized_metrics = wvcdm::a2bs_hex(kSerializedMetricsHex);
std::string serialized_metrics = wvutil::a2bs_hex(kSerializedMetricsHex);
ASSERT_TRUE(expected_metrics.ParseFromString(serialized_metrics));
EXPECT_CALL(*cdm, QueryStatus(_, QUERY_KEY_SECURITY_LEVEL, _))
@@ -3227,7 +3227,7 @@ TEST_F(WVDrmPluginTest, CanSetDecryptHashProperties) {
const std::vector<uint8_t> hashVector(
reinterpret_cast<uint8_t*>(&hash),
reinterpret_cast<uint8_t*>(&hash) + sizeof(uint32_t));
const std::string base64EncodedHash = Base64Encode(hashVector);
const std::string base64EncodedHash = wvutil::Base64Encode(hashVector);
std::string computedHash(sessionId.begin(), sessionId.end());
computedHash.append(frameNumber.c_str());
computedHash.append(base64EncodedHash.c_str());