Fix intermitent bad nonce being passed to RewrapDeviceRSAKey.

Since CryptoSession::RewrapDeviceRSAKey takes a const std::string& nonce, the calling code
implicitly constructa temporary std::string from a character array with undefined termination
and sometimes bogus value when nonce.data() is passed in.

Bug: 9016828

Merge of https://widevine-internal-review.googlesource.com/#/c/5690/
from the Widevine CDM repository

Change-Id: Ia3beaa5f1a96924a8cc53a719f25af52217b8cc5
This commit is contained in:
Jeff Tinker
2013-05-17 11:19:45 -07:00
parent eaebea9141
commit 71aa639c48

View File

@@ -725,7 +725,7 @@ CdmResponseType CdmEngine::HandleProvisioningResponse(
std::string wrapped_rsa_key;
if (!crypto_session->RewrapDeviceRSAKey(signed_message,
signature,
nonce.data(),
nonce,
enc_rsa_key,
enc_rsa_key.size(),
rsa_key_iv,