Add Mock OEMCrypto Stub

I added a Mock OEMCrypto implementation with stubs only.

I corrected the "extern C" location in OEMCrypto.h. (Thanks, Jerry!)

I added some Android.mk files that allows us to compile and
run a few simple unit tests.

Unit Test 1: The library compiles. (passes)
Unit Test 2: The test program links and runs. (passes)

Change-Id: Ib4c9554553de49645b5841b0bae889728cbfc8b1
This commit is contained in:
Fred Gylys-Colwell
2012-11-27 18:33:11 -08:00
parent 27bb877763
commit 684eb227d4
7 changed files with 862 additions and 8 deletions

View File

@@ -6,8 +6,12 @@
* Reference APIs needed to support Widevine's crypto algorithms.
*********************************************************************/
#ifndef _WIDEVINE_OEMCRYPTO_AES_H
#define _WIDEVINE_OEMCRYPTO_AES_H
#ifndef WV_OEMCRYPTO_H_
#define WV_OEMCRYPTO_H_
#ifdef __cplusplus
extern "C" {
#endif
#define OEMCRYPTO_VERSION "4.0"
static const char oec_version[] = OEMCRYPTO_VERSION;
@@ -93,10 +97,6 @@ typedef struct
OEMCrypto_UINT32 key_control_offset;
} OEMCrypto_KeyRefreshObject;
#ifdef __cplusplus
extern "C" {
#endif
#define OEMCrypto_Initialize _oec01
#define OEMCrypto_Terminate _oec02
#define OEMCrypto_SetEntitlementKey _oec03
@@ -643,7 +643,7 @@ OEMCryptoResult OEMCrypto_DecryptCTR(OEMCrypto_SESSION session_id,
OEMCrypto_UINT32 key_id_length,
const OEMCrypto_UINT8 *iv,
OEMCrypto_UINT32 offset,
OEMCrypto_UINT32 data_length)
OEMCrypto_UINT32 data_length);
/*
* OEMCrypto_InstallKeybox
@@ -815,4 +815,4 @@ OEMCryptoResult OEMCrypto_DecryptCTS(OEMCrypto_UINT8 *pSrcBuf,
}
#endif
#endif // _WIDEVINE_OEMCRYPTO_AES_H
#endif // WV_OEMCRYPTO_H_