Files
android/libwvdrmengine/oemcrypto/mock/src/oemcrypto_engine_device_properties_L1.cpp
Fred Gylys-Colwell ab0d00b92a Use Inheritence for OEMCrypto Mock Properties
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
2017-04-20 14:48:48 -07:00

36 lines
1006 B
C++

// Copyright 2014 Google Inc. All Rights Reserved.
//
// Mock implementation of OEMCrypto APIs
//
// This file contains oemcrypto engine properties that would be for a
// level 1 device.
#include "oemcrypto_engine_mock.h"
namespace wvoec_mock {
class L1CryptoEngine : public CryptoEngine {
public:
explicit L1CryptoEngine(wvcdm::FileSystem* file_system)
: CryptoEngine(file_system) {}
bool config_local_display_only() { return true; }
OEMCrypto_HDCP_Capability config_maximum_hdcp_capability() {
return HDCP_V2;
}
bool config_is_anti_rollback_hw_present() { return true; }
const char* config_security_level() { return "L1"; }
// This should start at 0, and be incremented only when a security patch has
// been applied to the device that fixes a security bug.
uint8_t config_security_patch_level() { return 3; }
};
CryptoEngine* CryptoEngine::MakeCryptoEngine(wvcdm::FileSystem* file_system) {
return new L1CryptoEngine(file_system);
}
} // namespace wvoec_mock