Add build info API to OEMCrypto

Merge from master branch of Widevine repo of http://go/wvgerrit/66065
Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/63080

This is for the reference code, the unit tests, and the oemcrypto adapter.

Bug: 116414218
Test: unit tests
Test: tested as part of http://go/ag/5501993

Change-Id: I05a631f6cfcf1584a748b3a0c9ae48633893589f
This commit is contained in:
Fred Gylys-Colwell
2018-11-12 14:11:55 -08:00
parent f2edb8f2dd
commit f3e9d84484
4 changed files with 39 additions and 2 deletions

View File

@@ -1148,6 +1148,10 @@ extern "C" uint32_t OEMCrypto_GetAnalogOutputFlags() {
return crypto_engine->analog_output_flags();
}
extern "C" const char* OEMCrypto_BuildInformation() {
return "OEMCrypto Ref Code " __DATE__ " " __TIME__;
}
extern "C" bool OEMCrypto_SupportsUsageTable() {
if (!crypto_engine) {
LOGE("OEMCrypto_SupportsUsageTable: OEMCrypto Not Initialized.");

View File

@@ -112,6 +112,13 @@ TEST_F(OEMCryptoClientTest, VersionNumber) {
} else {
cout << " OEMCrypto does not support usage tables." << endl;
}
if (version >= 15) {
const char* build_info = OEMCrypto_BuildInformation();
ASSERT_TRUE(build_info != NULL);
ASSERT_TRUE(strnlen(build_info, 256) <= 256)
<< "BuildInformation should be a short printable string.";
cout << " BuildInformation: " << build_info << endl;
}
ASSERT_GE(version, 8u);
ASSERT_LE(version, 15u);
}