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:
@@ -3224,10 +3224,10 @@ TEST_F(WVDrmPluginTest, CanSetDecryptHashProperties) {
|
||||
// "<sessionId>,<frameNumber>,<base64encodedHash>"
|
||||
static const std::string frameNumber = ",1";
|
||||
uint32_t hash = 0xbeef; // crc32 hash
|
||||
std::vector<uint8_t> hashVector(
|
||||
const std::vector<uint8_t> hashVector(
|
||||
reinterpret_cast<uint8_t*>(&hash),
|
||||
reinterpret_cast<uint8_t*>(&hash) + sizeof(uint32_t));
|
||||
std::string base64EncodedHash = Base64Encode(hashVector);
|
||||
const std::string base64EncodedHash = Base64Encode(hashVector);
|
||||
std::string computedHash(sessionId.begin(), sessionId.end());
|
||||
computedHash.append(frameNumber.c_str());
|
||||
computedHash.append(base64EncodedHash.c_str());
|
||||
|
||||
Reference in New Issue
Block a user