Use new Base64 encode functions.

[ Merge of http://go/wvgerrit/119806 ]

This change replaces all calls for base64 encoding which first converts
a string to a vector.  The new base64 encoding function allow for
encoding binary data contained within strings.

Bug: 181732604
Test: Android unittests
Change-Id: Ibfe79dba99e6a2ee2f2a96e85b62fbd22519aea7
This commit is contained in:
Alex Dale
2021-03-12 19:35:59 -08:00
parent e51f869190
commit d859c1ab17
8 changed files with 19 additions and 33 deletions

View File

@@ -8,6 +8,7 @@
#include <chrono>
#include <sstream>
#include <thread>
#include <utility>
#include <android-base/properties.h>
#include <gmock/gmock.h>
@@ -2564,9 +2565,9 @@ TEST_F(WvCdmRequestLicenseTest, ProvisioningRevocationTest) {
signed_response.SerializeToString(&response);
if (!wvcdm::Properties::provisioning_messages_are_binary()) {
std::vector<uint8_t> response_vec(response.begin(), response.end());
const std::string binary_response = std::move(response);
response = "\"signedResponse\": \"";
response.append(wvcdm::Base64SafeEncode(response_vec));
response.append(wvcdm::Base64SafeEncode(binary_response));
response.append("\"");
}