| Index: third_party/ots/fuzz/ots_fuzzer.cc
|
| diff --git a/components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc b/third_party/ots/fuzz/ots_fuzzer.cc
|
| similarity index 52%
|
| copy from components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc
|
| copy to third_party/ots/fuzz/ots_fuzzer.cc
|
| index 184012299e576afa4f344f2a04c7762e27a78ca3..d52f1b64fd009a53b52ebad2f457c8262b8366ee 100644
|
| --- a/components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc
|
| +++ b/third_party/ots/fuzz/ots_fuzzer.cc
|
| @@ -5,11 +5,15 @@
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| -#include "components/webcrypto/fuzzer_support.h"
|
| +#include "third_party/ots/include/opentype-sanitiser.h"
|
| +#include "third_party/ots/include/ots-memory-stream.h"
|
| +
|
| +static uint8_t buffer[256 * 1024] = { 0 };
|
|
|
| // Entry point for LibFuzzer.
|
| extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
| - webcrypto::ImportRsaKeyFromDerFuzzData(data, size,
|
| - blink::WebCryptoKeyFormatPkcs8);
|
| + ots::OTSContext context;
|
| + ots::MemoryStream stream(static_cast<void*>(buffer), sizeof(buffer));
|
| + context.Process(&stream, data, size);
|
| return 0;
|
| }
|
|
|