Added key_session_ guard to SelectKey. am: 1fac6fa5de

Original change: https://googleplex-android-review.googlesource.com/c/platform/vendor/widevine/+/17262613

Change-Id: I70573778fb89a8f266cd0f756f133f597c6b9bed
This commit is contained in:
Alex Dale
2022-03-22 05:32:35 +00:00
committed by Automerger Merge Worker

View File

@@ -1539,7 +1539,9 @@ CdmResponseType CryptoSession::LoadOemCertificatePrivateKey(
// Private.
CdmResponseType CryptoSession::SelectKey(const std::string& key_id,
CdmCipherMode cipher_mode) {
RETURN_IF_NOT_OPEN(CRYPTO_SESSION_NOT_OPEN);
const OEMCryptoResult sts = WithOecSessionLock("SelectKey", [&] {
RETURN_IF_NULL(key_session_, OEMCrypto_ERROR_INVALID_SESSION);
return key_session_->SelectKey(key_id, cipher_mode);
});