Fall back to Level 3 if Keybox not found am: 0e55743d3a am: 057c925d3c
Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/16300799 Change-Id: I8b5eb5fd6d2b9d2ef32ee4d80f961963e03adede
This commit is contained in:
committed by
Automerger Merge Worker
commit
a6cdd16900
@@ -756,6 +756,8 @@ class Adapter {
|
||||
}
|
||||
}
|
||||
|
||||
bool level1_valid() { return level1_valid_; }
|
||||
|
||||
void SetSandbox(const uint8_t* sandbox_id, size_t sandbox_id_length) {
|
||||
sandbox_id_.assign(sandbox_id, sandbox_id + sandbox_id_length);
|
||||
}
|
||||
@@ -817,17 +819,21 @@ class Adapter {
|
||||
level1_.BuildInformation());
|
||||
}
|
||||
} else {
|
||||
level1_ = FunctionPointers(); // revert to all null pointers.
|
||||
level1_valid_ = false;
|
||||
// Note: if the function pointers are bad, we do not close the library and
|
||||
// try again later. Instead, we permanently fall back to L3. This is a
|
||||
// debatable choice: I decided the risk of a dlclose resource leak out
|
||||
// weighed the possibility that the library would be fixed on the next
|
||||
// load.
|
||||
FallBackToLevel3();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void FallBackToLevel3() {
|
||||
level1_ = FunctionPointers(); // revert to all null pointers.
|
||||
level1_valid_ = false;
|
||||
// Note: if the function pointers are bad, we do not close the library and
|
||||
// try again later. Instead, we permanently fall back to L3. This is a
|
||||
// debatable choice: I decided the risk of a dlclose resource leak out
|
||||
// weighed the possibility that the library would be fixed on the next
|
||||
// load.
|
||||
}
|
||||
|
||||
bool LoadLevel1(wvcdm::metrics::OemCryptoDynamicAdapterMetrics* metrics) {
|
||||
if (metrics == nullptr) {
|
||||
return false;
|
||||
@@ -1282,6 +1288,7 @@ namespace wvcdm {
|
||||
OEMCryptoResult OEMCrypto_InitializeAndCheckKeybox(
|
||||
bool* needs_keybox_provisioning) {
|
||||
if (!needs_keybox_provisioning) return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||
*needs_keybox_provisioning = false;
|
||||
if (!gAdapter) {
|
||||
gAdapter.reset(new Adapter());
|
||||
}
|
||||
@@ -1295,7 +1302,8 @@ OEMCryptoResult OEMCrypto_InitializeAndCheckKeybox(
|
||||
if (ignore_count > 0) {
|
||||
LOGD("Ignoring keybox status %d", static_cast<int>(keybox_status));
|
||||
}
|
||||
*needs_keybox_provisioning = true;
|
||||
LOGD("L1 has no keybox. Falling back to L3.");
|
||||
gAdapter->FallBackToLevel3();
|
||||
return OEMCrypto_SUCCESS;
|
||||
}
|
||||
return keybox_status;
|
||||
|
||||
Reference in New Issue
Block a user