Unit Test for OEMCrypto_ERROR_KEY_EXPIRED

Merge from widevine repo of http://go/wvgerrit/21141

All of the decrypt calls and the SelectKey call should return
OEMCrypto_ERROR_KEY_EXPIRED on error.  This CL updates the oemcrypto
unit tests, reference mock, and level 3 code.

b/28294273

Change-Id: I7ac6a3652e0b2fe5a46071e1c2eda00daeed7a33
This commit is contained in:
Fred Gylys-Colwell
2016-11-28 21:52:11 -08:00
parent 7214064635
commit 47f454839e
4 changed files with 31 additions and 10 deletions

View File

@@ -556,12 +556,7 @@ OEMCryptoResult OEMCrypto_SelectKey(const OEMCrypto_SESSION session,
const std::vector<uint8_t> key_id_str =
std::vector<uint8_t>(key_id, key_id + key_id_length);
if (!session_ctx->SelectContentKey(key_id_str)) {
LOGE("[OEMCrypto_SelectKey(): FAIL]");
return OEMCrypto_ERROR_NO_CONTENT_KEY;
}
return OEMCrypto_SUCCESS;
return session_ctx->SelectContentKey(key_id_str);
}
OEMCryptoResult SetDestination(OEMCrypto_DestBufferDesc* out_buffer,