Merge from Widevine repo of http://go/wvgerrit/62782 There were still some old test keyboxes in the unit tests for older devices and in the mod mock. These are removed. Also, the cert with system id 7346 has been removed. The new test keybox has system ID 7912. The new test cert has system id 7913. bug: 76435251 Test: unit tests (unit tests do not pass on v13 oemcrypto) Test: tested as part of http://go/ag/5501993 Change-Id: I6007b6650162d9dc9d01384faaafc87acdf8ebd7
48 lines
1.7 KiB
C++
48 lines
1.7 KiB
C++
#ifndef CDM_OEC_DEVICE_FEATURES_H_
|
|
#define CDM_OEC_DEVICE_FEATURES_H_
|
|
|
|
#include <string>
|
|
|
|
#include "OEMCryptoCENC.h"
|
|
#include "oemcrypto_types.h"
|
|
|
|
namespace wvoec {
|
|
|
|
class DeviceFeatures {
|
|
public:
|
|
enum DeriveMethod { // Method to use derive session keys.
|
|
NO_METHOD, // Cannot derive known session keys.
|
|
LOAD_TEST_KEYBOX, // Call LoadTestKeybox before deriving keys.
|
|
LOAD_TEST_RSA_KEY, // Call LoadTestRSAKey before deriving keys.
|
|
FORCE_TEST_KEYBOX, // User requested calling InstallKeybox.
|
|
TEST_PROVISION_30, // Device has OEM Certificate installed.
|
|
};
|
|
|
|
enum DeriveMethod derive_key_method;
|
|
bool uses_keybox; // Device uses a keybox to derive session keys.
|
|
bool uses_certificate; // Device uses a certificate to derive session keys.
|
|
bool loads_certificate; // Device can load a certificate from the server.
|
|
bool generic_crypto; // Device supports generic crypto.
|
|
bool cast_receiver; // Device supports alternate rsa signature padding.
|
|
bool usage_table; // Device saves usage information.
|
|
bool supports_rsa_3072; // Device supports 3072 bit RSA keys.
|
|
bool supports_level_1; // Device supports Level 1 security.
|
|
uint32_t api_version;
|
|
OEMCrypto_ProvisioningMethod provisioning_method;
|
|
|
|
void Initialize(bool is_cast_receiver, bool force_load_test_keybox);
|
|
std::string RestrictFilter(const std::string& initial_filter);
|
|
|
|
private:
|
|
void PickDerivedKey();
|
|
bool IsTestKeyboxInstalled();
|
|
void FilterOut(std::string* current_filter, const std::string& new_filter);
|
|
};
|
|
|
|
extern DeviceFeatures global_features;
|
|
const char* ProvisioningMethodName(OEMCrypto_ProvisioningMethod method);
|
|
|
|
} // namespace wvoec
|
|
|
|
#endif // CDM_OEC_DEVICE_FEATURES_H_
|