Source release v3.0.0-0-g8d3792b-ce + third_party
Change-Id: I399e71ddfffcd436171d1c60283c63ab4658e0b1
This commit is contained in:
41
oemcrypto/test/oemcrypto_test.h
Normal file
41
oemcrypto/test/oemcrypto_test.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef CDM_OEMCRYPTO_TEST_H_
|
||||
#define CDM_OEMCRYPTO_TEST_H_
|
||||
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "wv_keybox.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.
|
||||
EXISTING_TEST_KEYBOX, // Keybox is already the test keybox.
|
||||
FORCE_TEST_KEYBOX, // User requested calling InstallKeybox.
|
||||
};
|
||||
|
||||
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.
|
||||
uint32_t api_version;
|
||||
|
||||
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;
|
||||
|
||||
} // namespace wvoec
|
||||
|
||||
#endif // CDM_OEMCRYPTO_TEST_H_
|
||||
Reference in New Issue
Block a user