From 8fd728e9927ce93215e8af245b9262077d9a1bc6 Mon Sep 17 00:00:00 2001 From: "John \"Juce\" Bruce" Date: Wed, 1 Dec 2021 14:30:37 -0800 Subject: [PATCH] Consistent result variable in CdmSession::RestoreOfflineSession (This is a merge of http://go/wvgerrit/139632.) While fixing a compiler error about shadowed variables in CdmSession, I noticed that this function had two result variables with different names as well. This patch consolidates down to one result variable. Bug: 207684988 Test: x86-64 Change-Id: Iaf6d742ef3409d85a1c364b486909d2497093112 --- libwvdrmengine/cdm/core/src/cdm_session.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libwvdrmengine/cdm/core/src/cdm_session.cpp b/libwvdrmengine/cdm/core/src/cdm_session.cpp index e9a07aef..0f07860d 100644 --- a/libwvdrmengine/cdm/core/src/cdm_session.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_session.cpp @@ -249,9 +249,9 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id, usage_entry_ = std::move(license_data.usage_entry); usage_entry_number_ = license_data.usage_entry_number; - CdmResponseType status = LoadPrivateOrLegacyKey( + CdmResponseType result = LoadPrivateOrLegacyKey( license_data.drm_certificate, license_data.wrapped_private_key); - if (status != NO_ERROR) return status; + if (result != NO_ERROR) return result; // Attempts to restore a released offline license are treated as a release // retry. @@ -309,13 +309,11 @@ CdmResponseType CdmSession::RestoreOfflineSession(const CdmKeySetId& key_set_id, std::string license_request_signature; // Sign a fake message so that OEMCrypto will start the rental clock. The // signature and generated core message are ignored. - const CdmResponseType status = - crypto_session_->PrepareAndSignLicenseRequest( - fake_message, &core_message, &license_request_signature); - if (status != NO_ERROR) return status; + result = crypto_session_->PrepareAndSignLicenseRequest( + fake_message, &core_message, &license_request_signature); + if (result != NO_ERROR) return result; } - CdmResponseType result; if (license_type == kLicenseTypeRelease) { result = license_parser_->RestoreLicenseForRelease( license_data.drm_certificate, key_request_, key_response_);