Get the udc-widevine-dev Android branch and oemcrypto-v18 cdm branch in sync. The commit ID for 18.4 on oemcrypto-v18 is https://widevine-internal.git.corp.google.com/cdm/+/a2f23a2281e5e06dc2867585bdc516fa132b639. Merged from go/wvgerrit/190151 Bug: 290252845 Test: unit tests passing on Panther device Change-Id: I63fa3f1c784f737ca1480e5febe4f3f5a8a49948
38 lines
937 B
C++
38 lines
937 B
C++
#include "oemcrypto_session_tests_helper.h"
|
|
#include "properties.h"
|
|
|
|
using namespace wvoec;
|
|
|
|
static bool is_init = false;
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|
SessionUtil session_helper;
|
|
if (!is_init) {
|
|
wvoec::global_features.Initialize();
|
|
wvoec::global_features.RestrictFilter("*");
|
|
wvutil::Properties::Init();
|
|
is_init = true;
|
|
}
|
|
|
|
OEMCrypto_Initialize();
|
|
OEMCrypto_EnterTestMode();
|
|
session_helper.EnsureTestROT();
|
|
|
|
Session s;
|
|
s.open();
|
|
s.GenerateDerivedKeysFromKeybox(session_helper.keybox_);
|
|
|
|
static const uint32_t SignatureBufferMaxLength = size;
|
|
vector<uint8_t> signature(SignatureBufferMaxLength);
|
|
size_t signature_length = signature.size();
|
|
|
|
OEMCryptoResult sts;
|
|
sts = OEMCrypto_GenerateSignature(s.session_id(), data, size, &signature[0],
|
|
&signature_length);
|
|
|
|
s.close();
|
|
OEMCrypto_Terminate();
|
|
|
|
return 0;
|
|
}
|