Removing Non-HIDL Widevine DRM Plugin for Android
[ Merge of http://go/wvgerrit/138089 ] Non-hidl code is no longer needed in the widevine android plugin. By doing work this cleanup will save the team from having to keep maintaining code that isn't needed anymore. Clean up steps taken as follows: 1. Remove non-hidl code but keep commonly used code 2. Remove legacy test code 3. Remove legacy test build and test entry Bug: 69573078 Bug: 172285246 Test: unit tests, GtsMediaTestCases, CtsMediaDrmTestCases Change-Id: I75938d69413c631ef6be82da3d885ba173efc581
This commit is contained in:
committed by
Kyle Zhang
parent
2046fc05fa
commit
0b02296014
File diff suppressed because it is too large
Load Diff
@@ -1,51 +0,0 @@
|
||||
//
|
||||
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine License
|
||||
// Agreement.
|
||||
//
|
||||
|
||||
//#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,
|
||||
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_LoadDRMPrivateKey(session, OEMCrypto_RSA_Private_Key,
|
||||
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.editArray(), &signatureSize,
|
||||
padding_scheme);
|
||||
}
|
||||
}
|
||||
OEMCrypto_CloseSession(session);
|
||||
return sts;
|
||||
}
|
||||
|
||||
} // namespace wvdrm
|
||||
Reference in New Issue
Block a user