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; |
} |