Improve OEMCrypto unit tests

This is a merge of http://go/wvgerrit/13701 and http://go/wvgerrit/13780.

I added a new set of engine properties for the mock oemcrypto.  This
set pretends to be level 1. This allows the widevine build bot to test
the dual security level path: a level 1 liboemcrypto.so and a fall
back to L3.

I also adjusted the failing test in oemcrypto_test.cpp.  A correct fix
requires us to rewrite some of the oemcrypto mock code so that it
returns real error codes instead of just 'false' on error.

Change-Id: I9cdbfc23c87ad2fb6068eac1394ce4c5b6a32dae
This commit is contained in:
Fred Gylys-Colwell
2015-03-18 18:14:03 -07:00
parent d2ba3a3f91
commit 047f543e7c
5 changed files with 78 additions and 18 deletions

View File

@@ -1001,7 +1001,11 @@ uint32_t OEMCrypto_APIVersion() {
extern "C"
const char* OEMCrypto_SecurityLevel() {
return "L3";
const char* security_level = crypto_engine->security_level();
if (LogCategoryEnabled(kLoggingTraceOEMCryptoCalls)) {
LOGI("-- bool OEMCrypto_SecurityLevel(); // returns %s.\n", security_level);
}
return security_level;
}
extern "C"