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

Unified Diff: testing/libfuzzer/fuzzers/nss/cert_certificate_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/cert_certificate_fuzzer.cc
diff --git a/components/webcrypto/rsa_import_key_spki_fuzzer.cc b/testing/libfuzzer/fuzzers/nss/cert_certificate_fuzzer.cc
similarity index 50%
copy from components/webcrypto/rsa_import_key_spki_fuzzer.cc
copy to testing/libfuzzer/fuzzers/nss/cert_certificate_fuzzer.cc
index e91b1403738b8f35258a74895ab741f9c1ce4679..ce69f42292241b8bd1711cb172cac8eee9883395 100644
--- a/components/webcrypto/rsa_import_key_spki_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/nss/cert_certificate_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 <cert.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<CERTCertificate, SEC_QuickDERDecodeItem>(
+ SEC_ASN1_GET(CERT_CertificateTemplate), data, size);
+ NSSFuzzOneInput<CERTCertificate, SEC_ASN1DecodeItem>(
+ SEC_ASN1_GET(CERT_CertificateTemplate), data, size);
+
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698