Source release 18.6.0
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
// Copyright 2022 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
#include "FuzzedDataProvider.h"
|
||||
#include "OEMCryptoCENC.h"
|
||||
#include "oemcrypto_fuzz_helper.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
wvoec::RedirectStdoutToFile();
|
||||
|
||||
wvoec::SessionFuzz session_fuzz;
|
||||
session_fuzz.Initialize();
|
||||
|
||||
FuzzedDataProvider fuzzed_data(data, size);
|
||||
|
||||
uint32_t key_session;
|
||||
uint32_t* const key_session_ptr =
|
||||
fuzzed_data.ConsumeBool() ? &key_session : nullptr;
|
||||
|
||||
OEMCrypto_CreateEntitledKeySession(session_fuzz.session().session_id(),
|
||||
key_session_ptr);
|
||||
|
||||
if (key_session_ptr == nullptr || fuzzed_data.ConsumeBool()) {
|
||||
key_session = fuzzed_data.ConsumeIntegral<uint32_t>();
|
||||
}
|
||||
|
||||
OEMCrypto_RemoveEntitledKeySession(key_session);
|
||||
|
||||
session_fuzz.Terminate();
|
||||
return 0;
|
||||
}
|
||||
@@ -122,6 +122,8 @@ class OEMCryptoRenewalAPIFuzz {
|
||||
|
||||
void Initialize() { license_api_fuzz_.Initialize(); }
|
||||
|
||||
void LoadLicense() { license_api_fuzz_.LoadLicense(); }
|
||||
|
||||
void Terminate() { license_api_fuzz_.Terminate(); }
|
||||
|
||||
LicenseRoundTrip& license_messages() {
|
||||
|
||||
@@ -20,6 +20,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
std::vector<uint8_t> input(data, data + size);
|
||||
wvoec::OEMCryptoRenewalAPIFuzz renewal_api_fuzz;
|
||||
renewal_api_fuzz.Initialize();
|
||||
renewal_api_fuzz.LoadLicense();
|
||||
renewal_api_fuzz.renewal_messages().InjectFuzzedRequestData(input.data(),
|
||||
input.size());
|
||||
renewal_api_fuzz.Terminate();
|
||||
|
||||
Reference in New Issue
Block a user