Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: testing/libfuzzer/fuzzers/nss/asn1_algorithmid_fuzzer.cc

Issue 1677803002: Add a bunch of NSS ASN.1 fuzzers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix leak Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/libfuzzer/fuzzers/nss/asn1_algorithmid_fuzzer.cc
diff --git a/components/webcrypto/rsa_import_key_spki_fuzzer.cc b/testing/libfuzzer/fuzzers/nss/asn1_algorithmid_fuzzer.cc
similarity index 50%
copy from components/webcrypto/rsa_import_key_spki_fuzzer.cc
copy to testing/libfuzzer/fuzzers/nss/asn1_algorithmid_fuzzer.cc
index e91b1403738b8f35258a74895ab741f9c1ce4679..ffbbb17b90d2ec51691326438fffdd5d18d6ea22 100644
--- a/components/webcrypto/rsa_import_key_spki_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/nss/asn1_algorithmid_fuzzer.cc
@@ -2,14 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <secoid.h>
#include <stddef.h>
#include <stdint.h>
-#include "components/webcrypto/fuzzer_support.h"
+#include "testing/libfuzzer/fuzzers/nss/asn1_fuzzer_template.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- webcrypto::ImportRsaKeyFromDerFuzzData(data, size,
- blink::WebCryptoKeyFormatSpki);
+ NSSFuzzOneInput<SECAlgorithmID, SEC_QuickDERDecodeItem>(
+ SEC_ASN1_GET(SECOID_AlgorithmIDTemplate), data, size);
+ NSSFuzzOneInput<SECAlgorithmID, SEC_ASN1DecodeItem>(
+ SEC_ASN1_GET(SECOID_AlgorithmIDTemplate), data, size);
+
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698