Group license support

This commit is contained in:
Lu Chen
2021-03-05 16:09:59 -08:00
parent 00785b2ccd
commit 5c81c1aa9e
30 changed files with 1236 additions and 585 deletions

View File

@@ -10,28 +10,9 @@
#include <vector>
#include "OEMCryptoCAS.h"
#include "crypto_key.h"
namespace wvcas {
// LoadKeysParams mirrors the parameters in the OEMCrypto API. It's purpose is
// to allow OEMCrypto_LoadKeys to be mocked. OEMCrypto_LoadKeys takes 13
// parameters as of API V14. GoogleMock allows a maximum of 10.
struct LoadKeysParams {
OEMCrypto_SESSION session = 0;
const uint8_t* message = nullptr;
size_t message_length = 0;
const uint8_t* signature = nullptr;
size_t signature_length = 0;
OEMCrypto_Substring enc_mac_keys_iv = {};
OEMCrypto_Substring enc_mac_keys = {};
size_t num_keys = 0;
const OEMCrypto_KeyObject* key_array = nullptr;
OEMCrypto_Substring pst = {};
OEMCrypto_Substring srm_requirement = {};
OEMCrypto_LicenseType license_type = OEMCrypto_ContentLicense;
};
// InputStreamParams mirrors the parameters in OEMCrypto API. The
// purpose is to allow OEMCrypto_Descramble to be mocked. OEMCrypto_Descramble
// takes 11 parameters as of API V15. GoogleMock allows a maximum of 10.
@@ -107,8 +88,6 @@ class OEMCryptoInterface {
size_t enc_session_key_length, const uint8_t* mac_key_context,
size_t mac_key_context_length, const uint8_t* enc_key_context,
size_t enc_key_context_length) const;
virtual OEMCryptoResult OEMCrypto_LoadKeys(
const LoadKeysParams& load_key_params) const;
virtual OEMCryptoResult OEMCrypto_LoadLicense(OEMCrypto_SESSION session,
const uint8_t* message,
size_t message_length,
@@ -130,10 +109,6 @@ class OEMCryptoInterface {
size_t content_key_id_length, OEMCryptoCipherMode cipher_mode) const;
virtual OEMCryptoResult OEMCrypto_GetHDCPCapability(
OEMCrypto_HDCP_Capability* current, OEMCrypto_HDCP_Capability* max) const;
virtual OEMCryptoResult OEMCrypto_RefreshKeys(
OEMCrypto_SESSION session, const uint8_t* message, size_t message_length,
const uint8_t* signature, size_t signature_length, size_t num_keys,
const OEMCrypto_KeyRefreshObject* key_array);
virtual OEMCryptoResult OEMCrypto_GetDeviceID(uint8_t* deviceID,
size_t* idLength);
virtual OEMCryptoResult OEMCrypto_LoadTestKeybox(const uint8_t* buffer,