Move the fuzzers into the fuzz directory and make them build.
Change-Id: I9346a4bf48d756da254dc27842cd645a3a69f847 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62045 Commit-Queue: David Benjamin <davidben@google.com> Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
committed by
Boringssl LUCI CQ
parent
9f4cad2208
commit
257bfaa329
@@ -22,10 +22,20 @@ fuzzer(bn_mod_exp)
|
||||
fuzzer(cert)
|
||||
fuzzer(client ssl)
|
||||
fuzzer(conf)
|
||||
fuzzer(crl_getcrlstatusforcert_fuzzer pki)
|
||||
fuzzer(crl_parse_crl_certificatelist_fuzzer pki)
|
||||
fuzzer(crl_parse_crl_tbscertlist_fuzzer pki)
|
||||
fuzzer(crl_parse_issuing_distribution_point_fuzzer pki)
|
||||
fuzzer(decode_client_hello_inner ssl)
|
||||
fuzzer(der_roundtrip)
|
||||
fuzzer(dtls_client ssl)
|
||||
fuzzer(dtls_server ssl)
|
||||
fuzzer(ocsp_parse_ocsp_cert_id_fuzzer pki)
|
||||
fuzzer(ocsp_parse_ocsp_response_data_fuzzer pki)
|
||||
fuzzer(ocsp_parse_ocsp_response_fuzzer pki)
|
||||
fuzzer(ocsp_parse_ocsp_single_response_fuzzer pki)
|
||||
fuzzer(parse_authority_key_identifier_fuzzer pki)
|
||||
fuzzer(parse_certificate_fuzzer pki)
|
||||
fuzzer(pkcs12)
|
||||
fuzzer(pkcs8)
|
||||
fuzzer(privkey)
|
||||
@@ -34,4 +44,6 @@ fuzzer(server ssl)
|
||||
fuzzer(session ssl)
|
||||
fuzzer(spki)
|
||||
fuzzer(ssl_ctx_api ssl)
|
||||
fuzzer(parse_certificate_fuzzer pki)
|
||||
fuzzer(verify_name_match_fuzzer pki)
|
||||
fuzzer(verify_name_match_normalizename_fuzzer pki)
|
||||
fuzzer(verify_name_match_verifynameinsubtree_fuzzer pki)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "crl.h"
|
||||
#include "input.h"
|
||||
#include "../pki/crl.h"
|
||||
#include "../pki/input.h"
|
||||
#include <openssl/sha.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
@@ -15,14 +15,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
|
||||
uint8_t data_hash[SHA256_DIGEST_LENGTH];
|
||||
SHA256(data, size, data_hash);
|
||||
const net::CrlVersion crl_version =
|
||||
(data_hash[0] % 2) ? net::CrlVersion::V2 : net::CrlVersion::V1;
|
||||
const bssl::CrlVersion crl_version =
|
||||
(data_hash[0] % 2) ? bssl::CrlVersion::V2 : bssl::CrlVersion::V1;
|
||||
const size_t serial_len = data_hash[1] % (sizeof(data_hash) - 2);
|
||||
assert(serial_len + 2 < sizeof(data_hash));
|
||||
const bssl::der::Input cert_serial(
|
||||
reinterpret_cast<const uint8_t*>(data_hash + 2), serial_len);
|
||||
|
||||
net::GetCRLStatusForCert(cert_serial, crl_version,
|
||||
bssl::GetCRLStatusForCert(cert_serial, crl_version,
|
||||
std::make_optional(input_der));
|
||||
|
||||
return 0;
|
||||
BIN
fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_extensions
Normal file
BIN
fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_extensions
Normal file
Binary file not shown.
BIN
fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_sequence
Normal file
BIN
fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_sequence
Normal file
Binary file not shown.
BIN
fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good
Normal file
BIN
fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
0#0!<0C><>8<19>V<EFBFBD>+<2B>R<EFBFBD>'<27><>
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include "crl.h"
|
||||
#include "input.h"
|
||||
#include "../pki/crl.h"
|
||||
#include "../pki/input.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input crl_der(data, size);
|
||||
@@ -17,7 +17,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input signature_algorithm_tlv;
|
||||
bssl::der::BitString signature_value;
|
||||
|
||||
std::ignore = net::ParseCrlCertificateList(
|
||||
std::ignore = bssl::ParseCrlCertificateList(
|
||||
crl_der, &tbs_cert_list_tlv, &signature_algorithm_tlv, &signature_value);
|
||||
|
||||
return 0;
|
||||
BIN
fuzz/crl_parse_crl_certificatelist_fuzzer_corpus/good_minimal
Normal file
BIN
fuzz/crl_parse_crl_certificatelist_fuzzer_corpus/good_minimal
Normal file
Binary file not shown.
@@ -7,14 +7,14 @@
|
||||
|
||||
#include <tuple>
|
||||
|
||||
#include "crl.h"
|
||||
#include "input.h"
|
||||
#include "../pki/crl.h"
|
||||
#include "../pki/input.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input input_der(data, size);
|
||||
|
||||
net::ParsedCrlTbsCertList tbs_cert_list;
|
||||
std::ignore = net::ParseCrlTbsCertList(input_der, &tbs_cert_list);
|
||||
bssl::ParsedCrlTbsCertList tbs_cert_list;
|
||||
std::ignore = bssl::ParseCrlTbsCertList(input_der, &tbs_cert_list);
|
||||
|
||||
return 0;
|
||||
}
|
||||
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good
Normal file
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good
Normal file
Binary file not shown.
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_noextensions
Normal file
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_noextensions
Normal file
Binary file not shown.
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nonextupdate
Normal file
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nonextupdate
Normal file
Binary file not shown.
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nooptionals
Normal file
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nooptionals
Normal file
Binary file not shown.
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_norevokedcerts
Normal file
BIN
fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_norevokedcerts
Normal file
Binary file not shown.
@@ -6,22 +6,22 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "crl.h"
|
||||
#include "input.h"
|
||||
#include "../pki/crl.h"
|
||||
#include "../pki/input.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input idp_der(data, size);
|
||||
|
||||
std::unique_ptr<net::GeneralNames> distribution_point_names;
|
||||
net::ContainedCertsType only_contains_cert_type;
|
||||
std::unique_ptr<bssl::GeneralNames> distribution_point_names;
|
||||
bssl::ContainedCertsType only_contains_cert_type;
|
||||
|
||||
if (net::ParseIssuingDistributionPoint(idp_der, &distribution_point_names,
|
||||
if (bssl::ParseIssuingDistributionPoint(idp_der, &distribution_point_names,
|
||||
&only_contains_cert_type)) {
|
||||
bool has_distribution_point_names =
|
||||
distribution_point_names &&
|
||||
distribution_point_names->present_name_types != net::GENERAL_NAME_NONE;
|
||||
distribution_point_names->present_name_types != bssl::GENERAL_NAME_NONE;
|
||||
if (!has_distribution_point_names &&
|
||||
only_contains_cert_type == net::ContainedCertsType::ANY_CERTS) {
|
||||
only_contains_cert_type == bssl::ContainedCertsType::ANY_CERTS) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
0 <20><1E><1C>http://example.com/foo.crl
|
||||
@@ -0,0 +1 @@
|
||||
0<11><0F>
|
||||
@@ -0,0 +1 @@
|
||||
0+<2B><1E><1C>http://example.com/foo.crl<72><01><><07><><EFBFBD><01>
|
||||
@@ -0,0 +1 @@
|
||||
0<03><01>
|
||||
@@ -0,0 +1 @@
|
||||
0<03><01>
|
||||
@@ -0,0 +1 @@
|
||||
0<03><01>
|
||||
@@ -0,0 +1 @@
|
||||
0<03><01>
|
||||
@@ -0,0 +1 @@
|
||||
0<05><07><>
|
||||
@@ -5,13 +5,13 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ocsp.h"
|
||||
#include "input.h"
|
||||
#include "../pki/ocsp.h"
|
||||
#include "../pki/input.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input cert_id_der(data, size);
|
||||
net::OCSPCertID cert_id;
|
||||
net::ParseOCSPCertID(cert_id_der, &cert_id);
|
||||
bssl::OCSPCertID cert_id;
|
||||
bssl::ParseOCSPCertID(cert_id_der, &cert_id);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_name_hash_type
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_name_hash_type
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_params
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_params
Normal file
Binary file not shown.
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_hash
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_hash
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_hash_oid
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_hash_oid
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_sequence
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_sequence
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_serial_number
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_serial_number
Normal file
Binary file not shown.
2
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/good
Normal file
2
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/good
Normal file
@@ -0,0 +1,2 @@
|
||||
0;0
|
||||
*<2A><1C>U<01>u<14><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><14><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/hash_as_integer
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/hash_as_integer
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/hash_oid_as_integer
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/hash_oid_as_integer
Normal file
Binary file not shown.
2
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/md4_params
Normal file
2
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/md4_params
Normal file
@@ -0,0 +1,2 @@
|
||||
00
|
||||
*<2A>H<EFBFBD><48>
|
||||
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/negative_serial
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/negative_serial
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/non_minimal_serial
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/non_minimal_serial
Normal file
Binary file not shown.
1
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/not_sequence
Normal file
1
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/not_sequence
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/null_params
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/null_params
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/overlong_serial
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/overlong_serial
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_data
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_data
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_inner_data
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_inner_data
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
0 0+
|
||||
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/zero_serial
Normal file
BIN
fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/zero_serial
Normal file
Binary file not shown.
@@ -5,13 +5,13 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ocsp.h"
|
||||
#include "input.h"
|
||||
#include "../pki/ocsp.h"
|
||||
#include "../pki/input.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input response_data_der(data, size);
|
||||
net::OCSPResponseData response_data;
|
||||
net::ParseOCSPResponseData(response_data_der, &response_data);
|
||||
bssl::OCSPResponseData response_data;
|
||||
bssl::ParseOCSPResponseData(response_data_der, &response_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
0<17><13><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responses
Normal file
BIN
fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responses
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_version
Normal file
BIN
fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_version
Normal file
Binary file not shown.
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_junk
Normal file
BIN
fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_junk
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
0<06>
|
||||
@@ -0,0 +1 @@
|
||||
0<05>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,13 +5,13 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "ocsp.h"
|
||||
#include "input.h"
|
||||
#include "../pki/ocsp.h"
|
||||
#include "../pki/input.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
bssl::der::Input response_der(data, size);
|
||||
net::OCSPResponse response;
|
||||
net::ParseOCSPResponse(response_der, &response);
|
||||
bssl::OCSPResponse response;
|
||||
bssl::ParseOCSPResponse(response_der, &response);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
0
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
0
|
||||
|
||||
BIN
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/trailing_inner_data
Normal file
BIN
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/trailing_inner_data
Normal file
Binary file not shown.
BIN
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/trailing_outer_data
Normal file
BIN
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/trailing_outer_data
Normal file
Binary file not shown.
2
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/try_later
Normal file
2
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/try_later
Normal file
@@ -0,0 +1,2 @@
|
||||
0
|
||||
|
||||
2
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/unused
Normal file
2
fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/unused
Normal file
@@ -0,0 +1,2 @@
|
||||
0
|
||||
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user