/* Copyright 2019 Google LLC. All Rights Reserved. This file and proprietary source code may only be used and distributed under the Widevine Master License Agreement. */ #ifndef OEMCRYPTO_TA_OEMCRYPTO_CONFIG_INTERFACE_H_ #define OEMCRYPTO_TA_OEMCRYPTO_CONFIG_INTERFACE_H_ #include "OEMCryptoCENC.h" #include "oemcrypto_config_macros.h" /* Returns the provisioning method configured for this TA. */ OEMCrypto_ProvisioningMethod GetProvisioningMethod(void); /* Returns the resource rating tier associated with this device. */ uint32_t GetResourceRatingTier(void); /* Returns an xor of all the padding schemes allowed by this device. */ uint32_t GetRSAPaddingSchemes(void); /* Gets the current supported version of SRM for the device and sets the |srm_version|. Returns OEMCrypto_SUCCESS if it was able to be fetched, OEMCrypto_ERROR_INVALID_CONTEXT if |srm_version| is NULL, any OEMCrypto_ERROR_UNKNOWN_FAILURE otherwise. */ OEMCryptoResult GetCurrentSRMVersion(uint32_t* srm_version); /* Returns whether the device has hardware protection preventing rollback of the usage table. */ bool IsAntiRollbackHWPresent(void); /* Returns whether or not the device was able to apply the CGMS protection for the device. The |cgms_field| correlates to those under the Key Control Block description in the OEMCrypto doc. If the cgms_field is invalid, return OEMCrypto_ERROR_UNKNOWN_FAILURE. Even if this function is not called, the device should attempt best effort for CGMS. */ OEMCryptoResult ApplyCGMS(uint8_t cgms_field); /* Returns whether CGMS is enabled for analog output for this device. */ bool IsCGMS_AActive(void); /* Returns whether this device is capable of supporting 2-bit CGMS-A. */ bool SupportsCGMS_A(void); /* Returns whether the device is capable of analog display. */ bool HasAnalogDisplay(void); /* Returns whether analog display is enabled for this display. */ bool IsAnalogDisplayActive(void); /* Returns whether the analog display is capable of being disabled. If this device doesn't have analog display, return false. */ bool CanDisableAnalogDisplay(void); /* Turn off analog display and return whether it was successful. If this device doesn't have analog display, return false. */ bool DisableAnalogDisplay(void); /* Returns the max buffer size/max subsample size in bytes allowed for DecryptCENC. If there is no restriction, returns 0. */ uint32_t MaxBufferSizeForDecrypt(void); /* Returns the max output size in bytes allowed for DecryptCENC and CopyBuffer. If there is no restriction, returns 0. */ uint32_t MaxOutputSizeForDecrypt(void); /* A closed platform can use clear buffers during decryption. */ /* TODO(b/145245387): define what constitutes a closed platform. */ bool IsClosedPlatform(void); /* Returns the current and maximum HDCP capabilities of the device. Look at the OEMCrypto integration guide for full details on what the current and maximum capabilities entail. */ OEMCrypto_HDCP_Capability CurrentHDCPCapability(void); OEMCrypto_HDCP_Capability MaxHDCPCapability(void); /* Returns the max buffer size allowed for OEMCrypto_Generic_*. If there is no restriction, returns 0. */ uint32_t MaxBufferSizeForGenericCrypto(void); /* Returns the type of certificates this device can support. See OEMCrypto_SupportedCertificates in the integration guide for details on return value. */ uint32_t SupportedCertificates(void); #endif /* OEMCRYPTO_TA_OEMCRYPTO_CONFIG_INTERFACE_H_ */