From 89d19be76659e31f95cfb1d4cc02f8f8f542506e Mon Sep 17 00:00:00 2001 From: Rahul Frias Date: Thu, 12 Mar 2020 15:58:33 -0700 Subject: [PATCH] Disable delayed termination on unprovisioning [ Merge of http://go/wvgerrit/95784 ] On unprovisioning, all persistent state/files are deleted. If a provisioning session is opened soon after, |OEMCrypto_Terminate| and |OEMCrypto_Initialize| will not be called. The (deleted) device key will remain resident in memory and will not be regenerated until |OEMCrypto_Initialize| is called. Any L3 licenses created will be associated with a device key that does not exist, at least after OEMCrypto is terminated. By disabling delayed termination of OEMCrypto, OEMCrypto will be terminated and initialized immediately on unprovisioning. Bug: 149808504 Test: WV unit/integration tests on L3 Change-Id: Id3fbce621b47a723ff624cf45f1ac203421a8dba --- libwvdrmengine/cdm/src/wv_content_decryption_module.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp b/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp index ebe19432..d7fecc2a 100644 --- a/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp +++ b/libwvdrmengine/cdm/src/wv_content_decryption_module.cpp @@ -227,6 +227,12 @@ CdmResponseType WvContentDecryptionModule::HandleProvisioningResponse( CdmResponseType WvContentDecryptionModule::Unprovision( CdmSecurityLevel level, const CdmIdentifier& identifier) { CdmEngine* cdm_engine = EnsureCdmForIdentifier(identifier); + // Persistent state is deleted on unprovisioning. The L3 OEMCrypto device + // key may however remain in memory until |OEMCrypto_Terminate| is called. + // It is not regenerated until |OEMCrypto_Initialize| is called. + // Enable immediate OEMCrypto termination and re-initalization on + // unprovisioning. + CryptoSession::DisableDelayedTermination(); return cdm_engine->Unprovision(level); }