Revert "Use aidl interface for Widevine service."

This reverts commit 96a8ccd4a1.

Reason for revert:
Could break DeviceManifest/SingleManifestTest#ManifestAidlHalsServed

Bug: 200055138
Bug: 170964303
Bug: 217241995
Change-Id: I9c42df15defec428c9ef8c62439c63d4a603fee6
This commit is contained in:
Yohei Yukawa
2022-01-31 22:01:25 +00:00
parent 96a8ccd4a1
commit a4d835af3a
75 changed files with 1480 additions and 7078 deletions

View File

@@ -1,50 +0,0 @@
//
// Copyright 2021 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 <log/log.h>
#include "WVGenericCryptoInterface.h"
#include "wv_cdm_constants.h"
namespace wvdrm {
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_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.data(), &signatureSize,
padding_scheme);
}
}
OEMCrypto_CloseSession(session);
return sts;
}
} // namespace wvdrm