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:
@@ -318,9 +318,7 @@ CdmResponseType CertificateProvisioning::GetProvisioningRequestInternal(
|
||||
|
||||
if (!wvcdm::Properties::provisioning_messages_are_binary()) {
|
||||
// Return request as web-safe base64 string
|
||||
std::vector<uint8_t> request_vector(serialized_request.begin(),
|
||||
serialized_request.end());
|
||||
*request = Base64SafeEncodeNoPad(request_vector);
|
||||
*request = Base64SafeEncodeNoPad(serialized_request);
|
||||
} else {
|
||||
*request = std::move(serialized_request);
|
||||
}
|
||||
|
||||
@@ -1771,9 +1771,7 @@ std::string DeviceFiles::GetUsageInfoFileName(const std::string& app_id) {
|
||||
}
|
||||
|
||||
std::string DeviceFiles::GetFileNameSafeHash(const std::string& input) {
|
||||
std::string hash = Md5Hash(input);
|
||||
return wvcdm::Base64SafeEncode(
|
||||
std::vector<uint8_t>(hash.begin(), hash.end()));
|
||||
return wvcdm::Base64SafeEncode(Md5Hash(input));
|
||||
}
|
||||
|
||||
} // namespace wvcdm
|
||||
|
||||
Reference in New Issue
Block a user