Source release 19.2.0
This commit is contained in:
32
oemcrypto/test/fuzz_tests/oemcrypto_release_request_fuzz.cc
Normal file
32
oemcrypto/test/fuzz_tests/oemcrypto_release_request_fuzz.cc
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright 2024 Google LLC. All Rights Reserved. This file and proprietary
|
||||
// source code may only be used and distributed under the Widevine
|
||||
// License Agreement.
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "oec_session_util.h"
|
||||
#include "oemcrypto_fuzz_helper.h"
|
||||
#include "oemcrypto_fuzz_structs.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
wvoec::RedirectStdoutToFile();
|
||||
|
||||
// If input size is less than fuzz data structure, reject the input.
|
||||
if (size < sizeof(wvoec::OEMCrypto_Request_Fuzz)) {
|
||||
return 0;
|
||||
}
|
||||
wvoec::LicenseWithUsageEntryFuzz entry;
|
||||
entry.Initialize();
|
||||
entry.CreateUsageTableHeader();
|
||||
entry.InstallTestDrmKey();
|
||||
entry.session().CreateNewUsageEntry();
|
||||
entry.session().GenerateNonce();
|
||||
std::vector<uint8_t> encrypted_usage_header;
|
||||
entry.session().UpdateUsageEntry(&encrypted_usage_header);
|
||||
entry.LoadLicense();
|
||||
wvoec::ReleaseRoundTrip release_messages(&entry.license_messages());
|
||||
std::vector<uint8_t> input(data, data + size);
|
||||
release_messages.InjectFuzzedRequestData(input.data(), input.size());
|
||||
entry.Terminate();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user