From 71aa639c48b05f7483c3d4866a1d495540d764bb Mon Sep 17 00:00:00 2001 From: Jeff Tinker Date: Fri, 17 May 2013 11:19:45 -0700 Subject: [PATCH] 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 --- libwvdrmengine/cdm/core/src/cdm_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libwvdrmengine/cdm/core/src/cdm_engine.cpp b/libwvdrmengine/cdm/core/src/cdm_engine.cpp index e2f3af24..e5709e33 100644 --- a/libwvdrmengine/cdm/core/src/cdm_engine.cpp +++ b/libwvdrmengine/cdm/core/src/cdm_engine.cpp @@ -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,