From 9d97c2bf60cc3ac8266b377d28e65c44a14cbb77 Mon Sep 17 00:00:00 2001 From: Cong Lin Date: Thu, 23 Mar 2023 10:31:50 -0700 Subject: [PATCH] Implement OEMCrypto_LoadCasECMKeys() with TODO WTPIs Add function body of OEMCrypto_LoadCasECMKeys() with a few TODOs. At the end, Cas content keys and IVs shall be installed to key slot by WTPIs, which will be declared in the next CL. Test: opk_ta Bug: 241146324 Merged from https://widevine-internal-review.googlesource.com/169378 Merged from https://widevine-internal-review.googlesource.com/178139 Change-Id: Idf3930ec916e95012067741e46254018fc6e4381 --- libwvdrmengine/oemcrypto/test/oec_session_util.cpp | 4 ++-- libwvdrmengine/oemcrypto/test/oec_session_util.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libwvdrmengine/oemcrypto/test/oec_session_util.cpp b/libwvdrmengine/oemcrypto/test/oec_session_util.cpp index 9390c0fc..095ed9aa 100644 --- a/libwvdrmengine/oemcrypto/test/oec_session_util.cpp +++ b/libwvdrmengine/oemcrypto/test/oec_session_util.cpp @@ -1367,8 +1367,8 @@ void EntitledMessage::LoadCasKeys(bool load_even, bool load_odd, // Convert the OEMCrypto_EntitledContentKeyObject to // OEMCrypto_EntitledCasKeyObject. Only the first two key object is used. - OEMCrypto_EntitledContentKeyObject even_key; - OEMCrypto_EntitledContentKeyObject odd_key; + OEMCrypto_EntitledContentKeyObject even_key = {}; + OEMCrypto_EntitledContentKeyObject odd_key = {}; bool has_even = load_even && num_keys_ >= 1; bool has_odd = load_odd && num_keys_ >= 2; if (has_even) { diff --git a/libwvdrmengine/oemcrypto/test/oec_session_util.h b/libwvdrmengine/oemcrypto/test/oec_session_util.h index e13bb519..3d7839c4 100644 --- a/libwvdrmengine/oemcrypto/test/oec_session_util.h +++ b/libwvdrmengine/oemcrypto/test/oec_session_util.h @@ -634,9 +634,9 @@ class EntitledMessage { uint32_t num_keys_; // Clear Entitlement key data. This is the backing data for // |entitled_key_array_|. - EntitledContentKeyData entitled_key_data_[kMaxNumKeys]; + EntitledContentKeyData entitled_key_data_[kMaxNumKeys] = {}; // Entitled key object. Pointers are backed by |entitled_key_data_|. - OEMCrypto_EntitledContentKeyObject entitled_key_array_[kMaxNumKeys]; + OEMCrypto_EntitledContentKeyObject entitled_key_array_[kMaxNumKeys] = {}; uint32_t entitled_key_session_; };