Use std::move for key strings.

[ Cherry-pick of v19 http://go/wvgerrit/219351 ]
[ Merge of http://go/wvgerrit/219455 ]

Coverity discovered an oppertunity to use the C++'s move semantics
for the prov 4.0 keys.  A similar possibility was available for the
matching wrapped key.  The CryptoWrappedKey class was updated to
enable moving of the wrapped key as well.

Bug: 406539167
Bug: 391469176
Change-Id: I7d76013638c220fc81d6d9c42add2516abd7374a
This commit is contained in:
Alex Dale
2025-04-21 17:07:29 -07:00
parent a2cdce4296
commit 207edd9b79
2 changed files with 6 additions and 2 deletions

View File

@@ -651,10 +651,10 @@ CdmResponseType CertificateProvisioning::GetProvisioning40RequestInternal(
// Need the wrapped Prov 4.0 private key to store once the response
// is received. The wrapped key is not available in the response.
prov40_wrapped_private_key_ =
CryptoWrappedKey(private_key_type, wrapped_private_key);
CryptoWrappedKey(private_key_type, std::move(wrapped_private_key));
// Store the public key from the request. This is used to match
// up the response with the most recently generated request.
prov40_public_key_ = public_key;
prov40_public_key_ = std::move(public_key);
state_ = is_oem_prov_request ? kOemRequestSent : kDrmRequestSent;
return CdmResponseType(NO_ERROR);