[ Merge of http://go/wvgerrit/173170 ] This CL updates the Widevine's Android DRM plugin to use the generic crypto operations provided by CDM core rather than its own implementation. Bug: 274984456 Test: atest WvtsDeviceTestCases Change-Id: I94e1c92c7da577aad5ec43bd3bf0bb380b607b80
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
//
|
|
// Copyright 2021 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine License
|
|
// Agreement.
|
|
//
|
|
|
|
#ifndef WV_GENERIC_CRYPTO_INTERFACE_H_
|
|
#define WV_GENERIC_CRYPTO_INTERFACE_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <vector>
|
|
|
|
#include "OEMCryptoCENC.h"
|
|
#include "media/stagefright/foundation/ABase.h"
|
|
|
|
namespace wvdrm {
|
|
|
|
class WVGenericCryptoInterface {
|
|
public:
|
|
WVGenericCryptoInterface() {}
|
|
virtual ~WVGenericCryptoInterface() {}
|
|
|
|
virtual OEMCryptoResult 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);
|
|
|
|
virtual OEMCryptoResult loadDeviceRSAKey(OEMCrypto_SESSION session,
|
|
const uint8_t* wrapped_rsa_key,
|
|
size_t wrapped_rsa_key_length) {
|
|
return OEMCrypto_LoadDRMPrivateKey(session, OEMCrypto_RSA_Private_Key,
|
|
wrapped_rsa_key, wrapped_rsa_key_length);
|
|
}
|
|
|
|
private:
|
|
DISALLOW_EVIL_CONSTRUCTORS(WVGenericCryptoInterface);
|
|
};
|
|
|
|
} // namespace wvdrm
|
|
|
|
#endif // WV_GENERIC_CRYPTO_INTERFACE_H_
|