Remove dependencies from frameworks C++ containers.

Replace AString, KeyedVector, List, String8 and Vector
with stl containers. Remove corresponding frameworks
libraries.

Test: Play Movies & TV (streaming and pinning)
Test: Netflix
Test: unit tests

bug: 34677927
Change-Id: I125f45054987d69bbca59c1ffdcbe8add38c3c13
This commit is contained in:
Edwin Wong
2017-03-31 18:34:01 -07:00
parent 82a0ed59fe
commit d9e7070de7
13 changed files with 452 additions and 336 deletions

View File

@@ -0,0 +1,49 @@
//
// Copyright 2013 Google Inc. All Rights Reserved.
//
//#define LOG_NDEBUG 0
#define LOG_TAG "WVCdm"
#include <utils/Log.h>
#include "WVGenericCryptoInterface.h"
#include "wv_cdm_constants.h"
namespace wvdrm {
using namespace android;
using namespace std;
using namespace wvcdm;
OEMCryptoResult WVGenericCryptoInterface::signRSA(const uint8_t* wrapped_rsa_key,
size_t wrapped_rsa_key_length,
const uint8_t* message,
size_t message_length,
std::vector<uint8_t>& signature,
RSA_Padding_Scheme padding_scheme) {
OEMCrypto_SESSION session;
OEMCryptoResult sts = OEMCrypto_OpenSession(&session);
if (sts != OEMCrypto_SUCCESS) return sts;
sts = OEMCrypto_LoadDeviceRSAKey(session, wrapped_rsa_key,
wrapped_rsa_key_length);
if (sts == OEMCrypto_SUCCESS) {
size_t signatureSize = 0;
sts = OEMCrypto_GenerateRSASignature(session, message, message_length,
NULL, &signatureSize,
padding_scheme);
if (sts == OEMCrypto_SUCCESS) {
// Should be short buffer.
sts = OEMCrypto_ERROR_UNKNOWN_FAILURE;
} else if (sts == OEMCrypto_ERROR_SHORT_BUFFER) {
signature.resize(signatureSize);
sts = OEMCrypto_GenerateRSASignature(session, message, message_length,
signature.data(), &signatureSize,
padding_scheme);
}
}
OEMCrypto_CloseSession(session);
return sts;
}
} // namespace wvdrm