Merge from Widevine repo of http://go/wvgerrit/24728 We use compiler options to set different properties in the oemcrypto mock. With this CL, we define a base class that has default properties. All other variants need only define the properties that they change. b/35141278 b/37353534 Change-Id: Id38ec5bf35dcd83cea9a066ebe201e6da7c1a2b0
35 lines
990 B
C++
35 lines
990 B
C++
// Copyright 2015 Google Inc. All Rights Reserved.
|
|
//
|
|
// Mock implementation of OEMCrypto APIs
|
|
//
|
|
// This file contains oemcrypto engine properties that would be for a device
|
|
// that does not have persistant storage or a keybox.
|
|
//
|
|
// Note: We also define it to be L2 for illustration only. Production devices
|
|
// are rarely level 2.
|
|
#include "oemcrypto_engine_mock.h"
|
|
|
|
namespace wvoec_mock {
|
|
|
|
class CertOnlyCryptoEngine : public CryptoEngine {
|
|
public:
|
|
explicit CertOnlyCryptoEngine(wvcdm::FileSystem* file_system)
|
|
: CryptoEngine(file_system) {}
|
|
|
|
bool config_local_display_only() { return true; }
|
|
|
|
bool config_supports_usage_table() { return false; }
|
|
|
|
OEMCrypto_ProvisioningMethod config_provisioning_method() {
|
|
return OEMCrypto_DrmCertificate;
|
|
}
|
|
|
|
const char* config_security_level() { return "L2"; }
|
|
};
|
|
|
|
CryptoEngine* CryptoEngine::MakeCryptoEngine(wvcdm::FileSystem* file_system) {
|
|
return new CertOnlyCryptoEngine(file_system);
|
|
}
|
|
|
|
} // namespace wvoec_mock
|