Updates to OEMCrytpo Mock

Squash merge from the widevine repo of several changes to oemcrypto
unit tests and the mock reference code.

http://go/wvgerrit/16264 Use unsigned int for count in usage table (more mock)
http://go/wvgerrit/16262 Use unsigned int for count in usage table (mock version)
http://go/wvgerrit/16247 Fix mock OEMCrypto_DeleteUsageTable
http://go/wvgerrit/16070 Fix OEMCrypto_GenerateRSASignature return values
http://go/wvgerrit/15991 Fix buffer overflow for 32-bit systems
http://go/wvgerrit/15993 Return Correct Value from OEMCrypto_RefreshKeys
http://go/wvgerrit/15880 Cast RSA_size() to int
http://go/wvgerrit/15831 Be strict about warnings for CE CDM

b/23729420
b/25221168

Change-Id: I97b91dfc672db8c586ae317977871b7d6afac4bb
This commit is contained in:
Fred Gylys-Colwell
2015-12-05 11:39:26 -08:00
parent 6886b1fa12
commit 6d7dcb8cba
7 changed files with 67 additions and 74 deletions

View File

@@ -15,7 +15,7 @@
#include "lock.h"
#include "oemcrypto_key_mock.h"
#include "oemcrypto_keybox_mock.h"
#include "OEMCryptoCENC.h" // Needed for enum OEMCrypto_Algorithm.
#include "OEMCryptoCENC.h" // Needed for enums only.
#include "wv_cdm_types.h"
namespace wvoec_mock {
@@ -99,11 +99,11 @@ class SessionContext {
uint8_t* signature,
size_t* signature_length);
size_t RSASignatureSize();
bool GenerateRSASignature(const uint8_t* message,
size_t message_length,
uint8_t* signature,
size_t* signature_length,
RSA_Padding_Scheme padding_scheme);
OEMCryptoResult GenerateRSASignature(const uint8_t* message,
size_t message_length,
uint8_t* signature,
size_t* signature_length,
RSA_Padding_Scheme padding_scheme);
bool ValidateMessage(const uint8_t* message,
size_t message_length,
const uint8_t* signature,
@@ -157,9 +157,9 @@ class SessionContext {
size_t message_length,
const uint8_t* signature,
size_t signature_length);
bool RefreshKey(const KeyId& key_id,
const std::vector<uint8_t>& key_control,
const std::vector<uint8_t>& key_control_iv);
OEMCryptoResult RefreshKey(const KeyId& key_id,
const std::vector<uint8_t>& key_control,
const std::vector<uint8_t>& key_control_iv);
bool UpdateMacKeys(const std::vector<uint8_t>& mac_keys,
const std::vector<uint8_t>& iv);
bool QueryKeyControlBlock(const KeyId& key_id, uint32_t* data);