This is a cherry pick of recent changes to OEMCrypto and ODK. Most of these are part of the document migration to doxygen. See http://go/wvgerrit/106005 and its parents for code reviews. Bug: 144715340 Bug: 148232693 Bug: 167580674 Change-Id: I658f99c8117b974faed97322d61fac0f382283af
28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
// Copyright 2020 Google LLC. All Rights Reserved. This file and proprietary
|
|
// source code may only be used and distributed under the Widevine Master
|
|
// License Agreement.
|
|
|
|
#include "oemcrypto_fuzz_helper.h"
|
|
|
|
namespace wvoec {
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|
// Redirect printf and log statements from oemcrypto functions to a file to
|
|
// reduce noise
|
|
RedirectStdoutToFile();
|
|
if (size < sizeof(ODK_ParsedProvisioning) + sizeof(RSAPrivateKeyMessage)) {
|
|
return 0;
|
|
}
|
|
|
|
OEMCryptoProvisioningAPIFuzz provisioning_api_fuzz;
|
|
provisioning_api_fuzz.provisioning_messages().SignAndVerifyRequest();
|
|
// Interpreting input fuzz data as unencrypted(core_response + provisioning
|
|
// message data) from provisioning server.
|
|
provisioning_api_fuzz.provisioning_messages().InjectFuzzedResponseData(data,
|
|
size);
|
|
provisioning_api_fuzz.provisioning_messages().EncryptAndSignResponse();
|
|
provisioning_api_fuzz.provisioning_messages().LoadResponse();
|
|
return 0;
|
|
}
|
|
} // namespace wvoec
|