Merge "Level 3 OEMCrypto library"

This commit is contained in:
Fred Gylys-Colwell
2016-01-04 19:49:09 +00:00
committed by Android (Google) Code Review
6 changed files with 15 additions and 0 deletions

View File

@@ -182,6 +182,10 @@ uint32_t Level3_APIVersion() {
return OEMCrypto_ERROR_NOT_IMPLEMENTED;
}
uint8_t Level3_SecurityPatchLevel() {
return 0;
}
const char* Level3_SecurityLevel() {
return "L3";
}

View File

@@ -58,6 +58,7 @@ namespace wvoec3 {
#define Level3_LoadTestKeybox _lcc42
#define Level3_ForceDeleteUsageEntry _lcc43
#define Level3_LoadTestRSAKey _lcc45
#define Level3_SecurityPatchLevel _lcc46
extern "C" {
@@ -171,6 +172,7 @@ OEMCryptoResult Level3_DeriveKeysFromSessionKey(OEMCrypto_SESSION session,
const uint8_t *enc_key_context,
size_t enc_key_context_length);
uint32_t Level3_APIVersion();
uint8_t Level3_SecurityPatchLevel();
const char* Level3_SecurityLevel();
OEMCryptoResult Level3_GetHDCPCapability(OEMCrypto_HDCP_Capability* current,
OEMCrypto_HDCP_Capability* maximum);

View File

@@ -1604,6 +1604,15 @@ TEST_F(OEMCryptoKeyboxTest, NormalGetKeyData) {
ASSERT_EQ(OEMCrypto_SUCCESS, sts);
}
// TODO(fredgc): warn people that this will be turned on. It causes a
// seg fault on some devices at the moment.
TEST_F(OEMCryptoKeyboxTest, DISABLED_GetKeyDataNullPointer) {
OEMCryptoResult sts;
uint8_t key_data[256];
sts = OEMCrypto_GetKeyData(key_data, NULL);
ASSERT_NE(OEMCrypto_SUCCESS, sts);
}
TEST_F(OEMCryptoKeyboxTest, ProductionKeyboxValid) {
ASSERT_EQ(OEMCrypto_SUCCESS, OEMCrypto_IsKeyboxValid());
}