From 257bfaa3294d2a7aa01ebdbd3e0f9eeea0071e01 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Tue, 25 Jul 2023 10:07:38 -0700 Subject: [PATCH] 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 Reviewed-by: David Benjamin --- fuzz/CMakeLists.txt | 14 +++++++- .../crl_getcrlstatusforcert_fuzzer.cc | 10 +++--- .../bad_empty_extensions | Bin 0 -> 39 bytes .../bad_empty_sequence | Bin 0 -> 2 bytes .../good | Bin 0 -> 51 bytes .../good_no_extensions | 1 + .../crl_parse_crl_certificatelist_fuzzer.cc | 6 ++-- .../good_minimal | Bin 0 -> 10 bytes .../crl_parse_crl_tbscertlist_fuzzer.cc | 8 ++--- .../good | Bin 0 -> 45 bytes .../good_noextensions | Bin 0 -> 41 bytes .../good_nonextupdate | Bin 0 -> 30 bytes .../good_nooptionals | Bin 0 -> 24 bytes .../good_norevokedcerts | Bin 0 -> 43 bytes ...parse_issuing_distribution_point_fuzzer.cc | 14 ++++---- .../empty_sequence | Bin 0 -> 2 bytes .../idp_with_distributionPoint_fullName_uri | 1 + ..._distributionPoint_nameRelativeToCRLIssuer | 1 + ...with_dpname_onlyca_reasons_and_indirectcrl | 1 + .../idp_with_indirectCrl | 1 + .../idp_with_onlyContainsAttributeCerts | 1 + .../idp_with_onlyContainsCaCerts | 1 + .../idp_with_onlyContainsUserCerts | 1 + .../idp_with_onlySomeReasons | 1 + .../ocsp_parse_ocsp_cert_id_fuzzer.cc | 8 ++--- .../bad_issuer_key_hash_type | Bin 0 -> 16 bytes .../bad_name_hash_type | Bin 0 -> 14 bytes .../bad_params | Bin 0 -> 14 bytes .../bad_serial_number_type | Bin 0 -> 17 bytes .../empty_hash | Bin 0 -> 4 bytes .../empty_hash_oid | Bin 0 -> 6 bytes .../empty_sequence | Bin 0 -> 2 bytes .../empty_serial_number | Bin 0 -> 17 bytes .../good | 2 ++ .../hash_as_integer | Bin 0 -> 5 bytes .../hash_oid_as_integer | Bin 0 -> 7 bytes .../md4_params | 2 ++ .../negative_serial | Bin 0 -> 18 bytes .../non_minimal_serial | Bin 0 -> 19 bytes .../not_sequence | 1 + .../null_params | Bin 0 -> 13 bytes .../overlong_serial | Bin 0 -> 38 bytes .../trailing_data | Bin 0 -> 5 bytes .../trailing_inner_data | Bin 0 -> 40 bytes .../unknown_hash_oid | 1 + .../zero_serial | Bin 0 -> 18 bytes .../ocsp_parse_ocsp_response_data_fuzzer.cc | 8 ++--- .../bad_produced_at_type | Bin 0 -> 28 bytes .../bad_responder_id_key_hash_length | 1 + .../bad_responder_id_key_hash_trailing_data | Bin 0 -> 8 bytes .../bad_responder_id_key_hash_type | Bin 0 -> 6 bytes .../bad_responses_data | Bin 0 -> 44 bytes .../bad_responses_type | Bin 0 -> 43 bytes .../empty_extensions | Bin 0 -> 49 bytes .../empty_responder_id_name | Bin 0 -> 4 bytes .../empty_responses | Bin 0 -> 43 bytes .../empty_version | Bin 0 -> 4 bytes .../null_responses_data | Bin 0 -> 45 bytes .../trailing_junk | Bin 0 -> 47 bytes .../trailing_outer_data | Bin 0 -> 4 bytes .../version_explicit_default | Bin 0 -> 7 bytes .../version_too_large | 1 + .../version_too_new | 1 + .../version_trailing_data | Bin 0 -> 9 bytes .../wrong_outer_type | Bin 0 -> 2 bytes .../wrong_responder_id_type | Bin 0 -> 4 bytes .../ocsp_parse_ocsp_response_fuzzer.cc | 8 ++--- .../baisc_response_bad_data | Bin 0 -> 25 bytes .../baisc_response_trailing_data | Bin 0 -> 26 bytes .../basic_response_bad_certs | Bin 0 -> 45 bytes .../basic_response_bad_certs_inner_data | Bin 0 -> 47 bytes .../basic_response_bad_certs_trailing_data | Bin 0 -> 48 bytes .../basic_response_bad_certs_type | Bin 0 -> 46 bytes .../basic_response_bad_sig_alg | Bin 0 -> 27 bytes .../basic_response_bad_sig_alg_bad_params | Bin 0 -> 31 bytes ...onse_bad_sig_alg_bad_sha1_non_empty_params | Bin 0 -> 42 bytes ...basic_response_bad_sig_alg_bad_sha1_params | Bin 0 -> 42 bytes ..._response_bad_sig_alg_data_trailing_params | Bin 0 -> 34 bytes .../basic_response_bad_sig_alg_empty_oid | Bin 0 -> 30 bytes .../basic_response_bad_sig_alg_oid_type | Bin 0 -> 30 bytes .../basic_response_bad_sig_alg_type | Bin 0 -> 28 bytes .../basic_response_bad_sig_type | Bin 0 -> 42 bytes .../basic_response_empty_certs | Bin 0 -> 44 bytes .../basic_response_empty_sig | Bin 0 -> 41 bytes .../basic_response_null_certs | Bin 0 -> 48 bytes .../basic_response_trailing_inner_junk | Bin 0 -> 50 bytes .../basic_response_trailing_junk | Bin 0 -> 44 bytes .../basic_response_trailing_outer_junk | Bin 0 -> 50 bytes .../response_bytes_bad_oid_type | Bin 0 -> 12 bytes .../response_bytes_bad_response_type | Bin 0 -> 22 bytes .../response_bytes_empty_oid | Bin 0 -> 11 bytes .../response_bytes_empty_response | Bin 0 -> 22 bytes .../response_bytes_trailing_data | Bin 0 -> 11 bytes .../response_status_type_out_of_range | 2 ++ .../response_status_type_too_large | 2 ++ .../trailing_inner_data | Bin 0 -> 50 bytes .../trailing_outer_data | Bin 0 -> 4 bytes .../try_later | 2 ++ .../unused | 2 ++ .../wrong_basic_response_type | Bin 0 -> 24 bytes .../wrong_outer_type | Bin 0 -> 3 bytes .../wrong_response_bytes | Bin 0 -> 8 bytes .../wrong_response_bytes_type | Bin 0 -> 9 bytes .../wrong_response_status_type | Bin 0 -> 5 bytes .../ocsp_parse_ocsp_single_response_fuzzer.cc | 8 ++--- .../bad_cert_status_context | Bin 0 -> 6 bytes .../bad_cert_status_type | Bin 0 -> 6 bytes .../bad_extensions | Bin 0 -> 59 bytes .../bad_next_update | Bin 0 -> 43 bytes .../bad_next_update_trailing_data | Bin 0 -> 60 bytes .../bad_next_update_type | Bin 0 -> 46 bytes .../bad_outer_type | Bin 0 -> 3 bytes .../bad_revoked_info_date_offset | Bin 0 -> 21 bytes .../bad_revoked_info_date_type | Bin 0 -> 9 bytes .../bad_revoked_info_date_value | Bin 0 -> 8 bytes .../bad_revoked_info_reason_integer | Bin 0 -> 24 bytes .../bad_revoked_info_reason_primitive | Bin 0 -> 23 bytes ...bad_revoked_info_reason_value_out_of_range | Bin 0 -> 26 bytes .../bad_revoked_info_reason_value_too_large | Bin 0 -> 27 bytes ...ad_revoked_info_reason_value_trailing_data | Bin 0 -> 28 bytes .../bad_revoked_info_reason_value_type | Bin 0 -> 26 bytes .../bad_revoked_info_reason_value_unused | Bin 0 -> 26 bytes .../bad_revoked_info_trailing_data | Bin 0 -> 28 bytes .../bad_this_update_type | Bin 0 -> 29 bytes .../empty_extensions | Bin 0 -> 60 bytes .../empty_next_update | Bin 0 -> 43 bytes .../no_extensions | Bin 0 -> 58 bytes .../trailing_inner_data | Bin 0 -> 60 bytes .../trailing_outer_data | Bin 0 -> 5 bytes .../parse_authority_key_identifier_fuzzer.cc | 8 ++--- .../empty_sequence | Bin 0 -> 2 bytes .../extra_contents_after_issuer_and_serial | 1 + .../invalid_contents | 1 + .../issuer_and_serial | 1 + .../issuer_only | 1 + .../key_identifier | 1 + .../key_identifier_and_issuer_and_serial | 1 + .../serial_only | 1 + .../url_issuer_and_serial | 1 + {pki => fuzz}/verify_name_match_fuzzer.cc | 8 ++--- .../1b016c1840c8e898f9ff55e637fafb3cf3ead130 | Bin 0 -> 48 bytes .../4294e32c0898747dbab77e9305416adb00507c4f | Bin 0 -> 14 bytes .../8e747a3d570ba8af6fd8a086363be7c7ff129717 | Bin 0 -> 10 bytes .../a530be31dc772f5da83827396e2db7f3530dbd63 | Bin 0 -> 6 bytes .../b010e4b4f94f13421176001e854c198d659cdbc6 | Bin 0 -> 64 bytes .../c100b87975cddf2b5ba2dc5c79cf19be094ba49c | Bin 0 -> 66 bytes .../verify_name_match_normalizename_fuzzer.cc | 10 +++--- .../37924c444319c3e53f946bfecb9619f49feac82c | Bin 0 -> 4 bytes .../42ddf23c41b1cd18d91ee88cbf4ce16691c26ccf | Bin 0 -> 6 bytes .../471f1dd828dbff86838a550fd418921eb694739b | 1 + .../50feeb838ca58e5faaba45e34db5ebe95fc79d90 | 1 + .../7bbf4751b9c581ae33c572f5313728414c598fdf | Bin 0 -> 297 bytes .../81ea9ea4435b0dffc2df539aa81fe1baa9c1bab3 | 1 + .../897be1df5da3a82bb30a3c3cfe6e737c791e7a64 | Bin 0 -> 207 bytes .../8c8d92335b0dd8916648af9298a03be29c47cb3b | 1 + .../a716b31050528102348026757fa7f5637da9e8b6 | Bin 0 -> 34 bytes .../f26c509626316176ed2d9ad0d8df8bd53a66f5a1 | 1 + .../f944dcd635f9801f7ac90a407fbc479964dec024 | Bin 0 -> 2 bytes ...y_name_match_verifynameinsubtree_fuzzer.cc | 10 +++--- .../1b016c1840c8e898f9ff55e637fafb3cf3ead130 | Bin 0 -> 48 bytes .../4294e32c0898747dbab77e9305416adb00507c4f | Bin 0 -> 14 bytes .../8e747a3d570ba8af6fd8a086363be7c7ff129717 | Bin 0 -> 10 bytes .../a530be31dc772f5da83827396e2db7f3530dbd63 | Bin 0 -> 6 bytes .../b010e4b4f94f13421176001e854c198d659cdbc6 | Bin 0 -> 64 bytes .../c100b87975cddf2b5ba2dc5c79cf19be094ba49c | Bin 0 -> 66 bytes pki/IMPORT | 6 ++++ pki/asn1_util.cc | 2 +- pki/asn1_util.h | 2 +- pki/cert_status_flags.h | 4 +-- pki/common_cert_errors.cc | 2 +- pki/common_cert_errors.h | 2 +- pki/import_spec.json | 14 ++------ pki/nist_pkits_unittest.h | 4 +-- pki/parse_certificate_fuzzer.cc | 25 --------------- pki/parsed_certificate.cc | 2 +- pki/parsed_certificate.h | 2 +- ...e-constraint-limit-to-resemble-Borin.patch | 16 +++++----- ...lder-tests-with-unsupported-dependen.patch | 30 +++++++++--------- pki/path_builder.cc | 2 +- pki/path_builder_pkits_unittest.cc | 2 +- pki/string_util.cc | 2 +- pki/string_util.h | 2 +- 182 files changed, 150 insertions(+), 128 deletions(-) rename {pki => fuzz}/crl_getcrlstatusforcert_fuzzer.cc (77%) create mode 100644 fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_extensions create mode 100644 fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_sequence create mode 100644 fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good create mode 100644 fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good_no_extensions rename {pki => fuzz}/crl_parse_crl_certificatelist_fuzzer.cc (84%) create mode 100644 fuzz/crl_parse_crl_certificatelist_fuzzer_corpus/good_minimal rename {pki => fuzz}/crl_parse_crl_tbscertlist_fuzzer.cc (67%) create mode 100644 fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good create mode 100644 fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_noextensions create mode 100644 fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nonextupdate create mode 100644 fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nooptionals create mode 100644 fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_norevokedcerts rename {pki => fuzz}/crl_parse_issuing_distribution_point_fuzzer.cc (57%) create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/empty_sequence create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_fullName_uri create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_nameRelativeToCRLIssuer create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_dpname_onlyca_reasons_and_indirectcrl create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_indirectCrl create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsAttributeCerts create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsCaCerts create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsUserCerts create mode 100644 fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlySomeReasons rename {pki => fuzz}/ocsp_parse_ocsp_cert_id_fuzzer.cc (71%) create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_issuer_key_hash_type create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_name_hash_type create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_params create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_serial_number_type create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_hash create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_hash_oid create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_sequence create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/empty_serial_number create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/good create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/hash_as_integer create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/hash_oid_as_integer create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/md4_params create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/negative_serial create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/non_minimal_serial create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/not_sequence create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/null_params create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/overlong_serial create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_inner_data create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/unknown_hash_oid create mode 100644 fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/zero_serial rename {pki => fuzz}/ocsp_parse_ocsp_response_data_fuzzer.cc (67%) create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_produced_at_type create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_length create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_type create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responses_data create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responses_type create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_extensions create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responder_id_name create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responses create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_version create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/null_responses_data create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_junk create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_outer_data create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_explicit_default create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_large create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_new create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/wrong_outer_type create mode 100644 fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/wrong_responder_id_type rename {pki => fuzz}/ocsp_parse_ocsp_response_fuzzer.cc (70%) create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/baisc_response_bad_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/baisc_response_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_inner_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_bad_params create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_bad_sha1_non_empty_params create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_bad_sha1_params create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_data_trailing_params create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_empty_oid create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_oid_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_empty_certs create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_empty_sig create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_null_certs create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_inner_junk create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_junk create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_outer_junk create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_bad_oid_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_bad_response_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_empty_oid create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_empty_response create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_status_type_out_of_range create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_status_type_too_large create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/trailing_inner_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/trailing_outer_data create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/try_later create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/unused create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_basic_response_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_outer_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_bytes create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_bytes_type create mode 100644 fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_status_type rename {pki => fuzz}/ocsp_parse_ocsp_single_response_fuzzer.cc (66%) create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_cert_status_context create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_cert_status_type create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_extensions create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_next_update create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_next_update_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_next_update_type create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_outer_type create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_date_offset create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_date_type create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_date_value create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_integer create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_primitive create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_out_of_range create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_too_large create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_type create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_unused create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_trailing_data create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_this_update_type create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/empty_extensions create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/empty_next_update create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/no_extensions create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/trailing_inner_data create mode 100644 fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/trailing_outer_data rename {pki => fuzz}/parse_authority_key_identifier_fuzzer.cc (63%) create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/empty_sequence create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/extra_contents_after_issuer_and_serial create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/invalid_contents create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_and_serial create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_only create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier_and_issuer_and_serial create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/serial_only create mode 100644 fuzz/parse_authority_key_identifier_fuzzer_corpus/url_issuer_and_serial rename {pki => fuzz}/verify_name_match_fuzzer.cc (84%) create mode 100644 fuzz/verify_name_match_fuzzer_corpus/1b016c1840c8e898f9ff55e637fafb3cf3ead130 create mode 100644 fuzz/verify_name_match_fuzzer_corpus/4294e32c0898747dbab77e9305416adb00507c4f create mode 100644 fuzz/verify_name_match_fuzzer_corpus/8e747a3d570ba8af6fd8a086363be7c7ff129717 create mode 100644 fuzz/verify_name_match_fuzzer_corpus/a530be31dc772f5da83827396e2db7f3530dbd63 create mode 100644 fuzz/verify_name_match_fuzzer_corpus/b010e4b4f94f13421176001e854c198d659cdbc6 create mode 100644 fuzz/verify_name_match_fuzzer_corpus/c100b87975cddf2b5ba2dc5c79cf19be094ba49c rename {pki => fuzz}/verify_name_match_normalizename_fuzzer.cc (76%) create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/37924c444319c3e53f946bfecb9619f49feac82c create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/42ddf23c41b1cd18d91ee88cbf4ce16691c26ccf create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/471f1dd828dbff86838a550fd418921eb694739b create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/50feeb838ca58e5faaba45e34db5ebe95fc79d90 create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/7bbf4751b9c581ae33c572f5313728414c598fdf create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/81ea9ea4435b0dffc2df539aa81fe1baa9c1bab3 create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/897be1df5da3a82bb30a3c3cfe6e737c791e7a64 create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/8c8d92335b0dd8916648af9298a03be29c47cb3b create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/a716b31050528102348026757fa7f5637da9e8b6 create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/f26c509626316176ed2d9ad0d8df8bd53a66f5a1 create mode 100644 fuzz/verify_name_match_normalizename_fuzzer_corpus/f944dcd635f9801f7ac90a407fbc479964dec024 rename {pki => fuzz}/verify_name_match_verifynameinsubtree_fuzzer.cc (80%) create mode 100644 fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/1b016c1840c8e898f9ff55e637fafb3cf3ead130 create mode 100644 fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/4294e32c0898747dbab77e9305416adb00507c4f create mode 100644 fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/8e747a3d570ba8af6fd8a086363be7c7ff129717 create mode 100644 fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/a530be31dc772f5da83827396e2db7f3530dbd63 create mode 100644 fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/b010e4b4f94f13421176001e854c198d659cdbc6 create mode 100644 fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/c100b87975cddf2b5ba2dc5c79cf19be094ba49c delete mode 100644 pki/parse_certificate_fuzzer.cc diff --git a/fuzz/CMakeLists.txt b/fuzz/CMakeLists.txt index d9b898dec..3905f5590 100644 --- a/fuzz/CMakeLists.txt +++ b/fuzz/CMakeLists.txt @@ -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) diff --git a/pki/crl_getcrlstatusforcert_fuzzer.cc b/fuzz/crl_getcrlstatusforcert_fuzzer.cc similarity index 77% rename from pki/crl_getcrlstatusforcert_fuzzer.cc rename to fuzz/crl_getcrlstatusforcert_fuzzer.cc index 9f0fd144f..a9825fe0d 100644 --- a/pki/crl_getcrlstatusforcert_fuzzer.cc +++ b/fuzz/crl_getcrlstatusforcert_fuzzer.cc @@ -6,8 +6,8 @@ #include #include -#include "crl.h" -#include "input.h" +#include "../pki/crl.h" +#include "../pki/input.h" #include 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(data_hash + 2), serial_len); - net::GetCRLStatusForCert(cert_serial, crl_version, + bssl::GetCRLStatusForCert(cert_serial, crl_version, std::make_optional(input_der)); return 0; diff --git a/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_extensions b/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_extensions new file mode 100644 index 0000000000000000000000000000000000000000..53e222412be7df6c155c5105dd4f4324036b784a GIT binary patch literal 39 vcmXp|HBe>};Q88QAt5<0?1%QXpttI8UyAb@S{ND_nHriI8X8+f8883<`SlCq literal 0 HcmV?d00001 diff --git a/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_sequence b/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/bad_empty_sequence new file mode 100644 index 0000000000000000000000000000000000000000..def7fcb589b94b3707b9d3cb4d4825487a7fa402 GIT binary patch literal 2 JcmXqD0001D05Jdn literal 0 HcmV?d00001 diff --git a/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good b/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good new file mode 100644 index 0000000000000000000000000000000000000000..cdfccaa12550f30b27ecbee906ac91e066960155 GIT binary patch literal 51 zcmXpoG|*=f;Q88QAt5<0?1%QXpttI8UyAb@S{ND_nHriI8X8+f8Sofzu`!3rin1_s HF){!El@bi& literal 0 HcmV?d00001 diff --git a/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good_no_extensions b/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good_no_extensions new file mode 100644 index 000000000..ccfb1214d --- /dev/null +++ b/fuzz/crl_getcrlstatusforcert_fuzzer_corpus/good_no_extensions @@ -0,0 +1 @@ +0#0! 8V+R' 181025161138Z \ No newline at end of file diff --git a/pki/crl_parse_crl_certificatelist_fuzzer.cc b/fuzz/crl_parse_crl_certificatelist_fuzzer.cc similarity index 84% rename from pki/crl_parse_crl_certificatelist_fuzzer.cc rename to fuzz/crl_parse_crl_certificatelist_fuzzer.cc index 2c6c571d9..508f7dad0 100644 --- a/pki/crl_parse_crl_certificatelist_fuzzer.cc +++ b/fuzz/crl_parse_crl_certificatelist_fuzzer.cc @@ -7,8 +7,8 @@ #include -#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; diff --git a/fuzz/crl_parse_crl_certificatelist_fuzzer_corpus/good_minimal b/fuzz/crl_parse_crl_certificatelist_fuzzer_corpus/good_minimal new file mode 100644 index 0000000000000000000000000000000000000000..b159c95e18956490e57095dca7a84ad6986f3777 GIT binary patch literal 10 RcmXruFkmoXU}j=a2LJ^N0L1_R literal 0 HcmV?d00001 diff --git a/pki/crl_parse_crl_tbscertlist_fuzzer.cc b/fuzz/crl_parse_crl_tbscertlist_fuzzer.cc similarity index 67% rename from pki/crl_parse_crl_tbscertlist_fuzzer.cc rename to fuzz/crl_parse_crl_tbscertlist_fuzzer.cc index dae0ea6f9..845bfbdbf 100644 --- a/pki/crl_parse_crl_tbscertlist_fuzzer.cc +++ b/fuzz/crl_parse_crl_tbscertlist_fuzzer.cc @@ -7,14 +7,14 @@ #include -#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; } diff --git a/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good b/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good new file mode 100644 index 0000000000000000000000000000000000000000..1963fe21b7ac8dbe08af137ec88bdfdb5788676c GIT binary patch literal 45 qcmXreW@2PCU@%}1=QXr6Ff}$XGBPwZHHiXq&5U4N1BL}m1`Gh1^aqFl literal 0 HcmV?d00001 diff --git a/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_noextensions b/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_noextensions new file mode 100644 index 0000000000000000000000000000000000000000..ee3f2168366bd151a2354ed7086ef964f7990f2c GIT binary patch literal 41 mcmXp|XJTYDU@%}1=QXr6Ff}$XGBPwZHHiXq&5U4N0|o$lmIkr_ literal 0 HcmV?d00001 diff --git a/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nonextupdate b/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nonextupdate new file mode 100644 index 0000000000000000000000000000000000000000..d64fb9ef036f4acc47af95f01a3bc4b3e9fbc3bb GIT binary patch literal 30 lcmXqzVPa%7U@%}1=QXr6Ff}$XGBPwZHHk7{Sioe!002A)1eO2* literal 0 HcmV?d00001 diff --git a/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nooptionals b/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_nooptionals new file mode 100644 index 0000000000000000000000000000000000000000..f3b31109e2c4324ebc277978696c698a7033ef9c GIT binary patch literal 24 fcmXpIV`5}9U@%}1=QXr6Ff}$XGBPwZHHiWMA^-!9 literal 0 HcmV?d00001 diff --git a/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_norevokedcerts b/fuzz/crl_parse_crl_tbscertlist_fuzzer_corpus/good_norevokedcerts new file mode 100644 index 0000000000000000000000000000000000000000..66aab9a3399eac9d8c4d45b778b0dcecfec5194d GIT binary patch literal 43 ocmXreWMX7AU@%}1=QXr6Ff}$XGBPwZHHiXq&5U5&1xyAE0E=`7RsaA1 literal 0 HcmV?d00001 diff --git a/pki/crl_parse_issuing_distribution_point_fuzzer.cc b/fuzz/crl_parse_issuing_distribution_point_fuzzer.cc similarity index 57% rename from pki/crl_parse_issuing_distribution_point_fuzzer.cc rename to fuzz/crl_parse_issuing_distribution_point_fuzzer.cc index d262c6c11..1239f4deb 100644 --- a/pki/crl_parse_issuing_distribution_point_fuzzer.cc +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer.cc @@ -6,22 +6,22 @@ #include #include -#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 distribution_point_names; - net::ContainedCertsType only_contains_cert_type; + std::unique_ptr 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(); } } diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/empty_sequence b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/empty_sequence new file mode 100644 index 0000000000000000000000000000000000000000..def7fcb589b94b3707b9d3cb4d4825487a7fa402 GIT binary patch literal 2 JcmXqD0001D05Jdn literal 0 HcmV?d00001 diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_fullName_uri b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_fullName_uri new file mode 100644 index 000000000..2f742346d --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_fullName_uri @@ -0,0 +1 @@ +0 http://example.com/foo.crl \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_nameRelativeToCRLIssuer b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_nameRelativeToCRLIssuer new file mode 100644 index 000000000..a45d02428 --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_distributionPoint_nameRelativeToCRLIssuer @@ -0,0 +1 @@ +0 1 0 UUS \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_dpname_onlyca_reasons_and_indirectcrl b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_dpname_onlyca_reasons_and_indirectcrl new file mode 100644 index 000000000..d5954c71b --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_dpname_onlyca_reasons_and_indirectcrl @@ -0,0 +1 @@ +0+http://example.com/foo.crl \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_indirectCrl b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_indirectCrl new file mode 100644 index 000000000..fe8256cb7 --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_indirectCrl @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsAttributeCerts b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsAttributeCerts new file mode 100644 index 000000000..4195f6ef2 --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsAttributeCerts @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsCaCerts b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsCaCerts new file mode 100644 index 000000000..e38a636df --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsCaCerts @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsUserCerts b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsUserCerts new file mode 100644 index 000000000..91d56bd9c --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlyContainsUserCerts @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlySomeReasons b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlySomeReasons new file mode 100644 index 000000000..fdedbe99a --- /dev/null +++ b/fuzz/crl_parse_issuing_distribution_point_fuzzer_corpus/idp_with_onlySomeReasons @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/pki/ocsp_parse_ocsp_cert_id_fuzzer.cc b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer.cc similarity index 71% rename from pki/ocsp_parse_ocsp_cert_id_fuzzer.cc rename to fuzz/ocsp_parse_ocsp_cert_id_fuzzer.cc index 49f7c905d..77d0a2024 100644 --- a/pki/ocsp_parse_ocsp_cert_id_fuzzer.cc +++ b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer.cc @@ -5,13 +5,13 @@ #include #include -#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; } diff --git a/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_issuer_key_hash_type b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/bad_issuer_key_hash_type new file mode 100644 index 0000000000000000000000000000000000000000..8b001aab31418ccabfe5907f167d2a62409fadae GIT binary patch literal 16 XcmXruGhk<9)#hVnl44pHc>rtx literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/md4_params b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/md4_params new file mode 100644 index 000000000..8448edbc6 --- /dev/null +++ b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/md4_params @@ -0,0 +1,2 @@ +0 0 +*H  \ No newline at end of file diff --git a/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/negative_serial b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/negative_serial new file mode 100644 index 0000000000000000000000000000000000000000..009e7f45cb338fb61a851e63862a3872d185ee6d GIT binary patch literal 18 ZcmXpIFkok6)#hVnl44k literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_data b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_data new file mode 100644 index 0000000000000000000000000000000000000000..85075971a7fb7465322e84a1b4dbcd290f046820 GIT binary patch literal 5 McmXqDU}9td008{}Gynhq literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_inner_data b/fuzz/ocsp_parse_ocsp_cert_id_fuzzer_corpus/trailing_inner_data new file mode 100644 index 0000000000000000000000000000000000000000..13f1aec4158b0fd592c636882e37808fd0427edb GIT binary patch literal 40 fcmXp|Ghk<9)#hVnl44 #include -#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; } diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_produced_at_type b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_produced_at_type new file mode 100644 index 0000000000000000000000000000000000000000..033c54b089426937d329ce28cfb206737bca9dfd GIT binary patch literal 28 ScmXqzS|r9I@*fLeWdHyb{}l`X literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_length b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_length new file mode 100644 index 000000000..302c64b63 --- /dev/null +++ b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_length @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_trailing_data b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_trailing_data new file mode 100644 index 0000000000000000000000000000000000000000..42906d037d6cc9de625af72f0a986b30fa3cc070 GIT binary patch literal 8 PcmXqDTg1Y`z{&ss1*`z( literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_type b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responder_id_key_hash_type new file mode 100644 index 0000000000000000000000000000000000000000..5b667cc9ee463c36dda1d112485ffb574226d36b GIT binary patch literal 6 NcmXqDS;WN3000Bh0Nwxq literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responses_data b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responses_data new file mode 100644 index 0000000000000000000000000000000000000000..6638cbfc32c82e34cb933b5e11e5acbec8c7b9a7 GIT binary patch literal 44 dcmXreS|r9I@*fM3;5D=~Fa$y{h%#Vg004#h7!v>h literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responses_type b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/bad_responses_type new file mode 100644 index 0000000000000000000000000000000000000000..4b09b3c4a05c678bd97706e0fc4704461536ec86 GIT binary patch literal 43 ccmXreTqMRK@*fM3;5D=~Fa$y{h+<^`0BvR$<^TWy literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_extensions b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_extensions new file mode 100644 index 0000000000000000000000000000000000000000..c46e843c6cd21175c365cad97f5b6557ecc7e6a7 GIT binary patch literal 49 gcmXreUnIsN@*fM3;5D=~Fa$y{h%#U@U|0ym00U_m8~^|S literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responder_id_name b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responder_id_name new file mode 100644 index 0000000000000000000000000000000000000000..7cb619dcd6355c15108a6558777e518d7f852896 GIT binary patch literal 4 LcmXqDTF3wZ0t^7u literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responses b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_responses new file mode 100644 index 0000000000000000000000000000000000000000..62840b944d5abcdb33e39c52de239425e3d7b1f8 GIT binary patch literal 43 ccmXreTqMRK@*fM3;5D=~Fa$y{h%#UR0ByV&5dZ)H literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_version b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/empty_version new file mode 100644 index 0000000000000000000000000000000000000000..fa20e449bfa6d9cacd26cf580eeacfa54e48772a GIT binary patch literal 4 LcmXqDTEGAR0tx`r literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/null_responses_data b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/null_responses_data new file mode 100644 index 0000000000000000000000000000000000000000..29bbc444f14fc81a1693709d36c1d3517fbd70de GIT binary patch literal 45 ecmXreUL?jM@*fM3;5D=~Fa$y{h%#VeWdH!4Mi?3Z literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_junk b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_junk new file mode 100644 index 0000000000000000000000000000000000000000..d69f701a4297011db45c56063d2495a3496003a9 GIT binary patch literal 47 gcmXreT_naL@*fM3;5D=~Fa$y{h%#U@U|?kc0MCpVOaK4? literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_outer_data b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/trailing_outer_data new file mode 100644 index 0000000000000000000000000000000000000000..3b7358766b675d3005d20157cece5988a8d4c5e5 GIT binary patch literal 4 LcmXqDU}XRR0L}n5 literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_explicit_default b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_explicit_default new file mode 100644 index 0000000000000000000000000000000000000000..15c89fbb5f251c6fb8f24d38a31c4ff53df7008a GIT binary patch literal 7 OcmXqDUBJx5$N&HYsQ}yn literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_large b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_large new file mode 100644 index 000000000..4c5e70371 --- /dev/null +++ b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_large @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_new b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_new new file mode 100644 index 000000000..6dfd6ad0b --- /dev/null +++ b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_too_new @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_trailing_data b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/version_trailing_data new file mode 100644 index 0000000000000000000000000000000000000000..75412ad8db86384f8ad382291b48130c4d200a8c GIT binary patch literal 9 QcmXqDU%<-5$jHh700xQx<^TWy literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/wrong_outer_type b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/wrong_outer_type new file mode 100644 index 0000000000000000000000000000000000000000..19b3e940af55e37df01b2a2b4598ef47944da756 GIT binary patch literal 2 JcmZQ&0000C00sa6 literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/wrong_responder_id_type b/fuzz/ocsp_parse_ocsp_response_data_fuzzer_corpus/wrong_responder_id_type new file mode 100644 index 0000000000000000000000000000000000000000..df0dd6d7051a9834ae8dcd9d9f1e95c030a93f7d GIT binary patch literal 4 LcmXqDVr2jT0Mr0D literal 0 HcmV?d00001 diff --git a/pki/ocsp_parse_ocsp_response_fuzzer.cc b/fuzz/ocsp_parse_ocsp_response_fuzzer.cc similarity index 70% rename from pki/ocsp_parse_ocsp_response_fuzzer.cc rename to fuzz/ocsp_parse_ocsp_response_fuzzer.cc index df6c8803d..148612c25 100644 --- a/pki/ocsp_parse_ocsp_response_fuzzer.cc +++ b/fuzz/ocsp_parse_ocsp_response_fuzzer.cc @@ -5,13 +5,13 @@ #include #include -#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; } diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/baisc_response_bad_data b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/baisc_response_bad_data new file mode 100644 index 0000000000000000000000000000000000000000..418147d1f846c004c5e4dcd46da8978c0f201ae4 GIT binary patch literal 25 gcmXpI=VD}7AY>rG#;MK5$jZuYz{tqLY{19>03fvj0RR91 literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/baisc_response_trailing_data b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/baisc_response_trailing_data new file mode 100644 index 0000000000000000000000000000000000000000..6e5c0fe33e196f7e98e952d3e5d6aa37960e228c GIT binary patch literal 26 hcmXqz;9_K0AZ#GW#;MK5$jZuYz{tqLV!*)4001Ka0to;B literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs new file mode 100644 index 0000000000000000000000000000000000000000..0460e1af0fb43e80b0ecd42f3728719759a2a943 GIT binary patch literal 45 zcmXre=3-=6pk|=L#;MK5$jZuYz{toVZXn9aV8G4BsnzDu_MMlJk(HV8{{lt^0DyP~ A;Q#;t literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_inner_data b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_inner_data new file mode 100644 index 0000000000000000000000000000000000000000..eb4dd03adc2ee2605963cafe36b56c2daee1d4eb GIT binary patch literal 47 zcmXrel3plP7a#;MK5$jZuYz{toVWgx-IV8G4BsnzDu_MMlJk(HV8{{j{R237_D Dm=gym literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_certs_type new file mode 100644 index 0000000000000000000000000000000000000000..61fd3a20e02c7faafafba2349294f87cc5b92660 GIT binary patch literal 46 zcmXre;bLT1pl+bb#;MK5$jZuYz{toVVIaoJV8G4BsnzDu_MMlJk(HV8{{kjf1^|c= B2J8R; literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_alg new file mode 100644 index 0000000000000000000000000000000000000000..2b501de323150b0c4eb5d7920436e120596e608e GIT binary patch literal 27 icmXqzaD literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_bad_sig_type new file mode 100644 index 0000000000000000000000000000000000000000..a0d96169743f2bcf878c885e18fad3cfed911c9a GIT binary patch literal 42 xcmXre;9_K0plqPX#;MK5$jZuYz{toVVj#rIV8G4BsnzDu_MMlJk(G&&0RU+a1u*~s literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_empty_certs b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_empty_certs new file mode 100644 index 0000000000000000000000000000000000000000..6da3aa01397dc06a06ec32e1690f1280af31f5d2 GIT binary patch literal 44 zcmXre;$mc2plYDZ#;MK5$jZuYz{toVW+1}KV8G4BsnzDu_MMlJk(HV8{{jX8c=ZO` literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_empty_sig b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_empty_sig new file mode 100644 index 0000000000000000000000000000000000000000..97ef6a9a296f84929fe416a32614e4db768f2967 GIT binary patch literal 41 wcmXp|=VD}7pk$!H#;MK5$jZuYz{toVY#_+WV8G4BsnzDu_MMlJk(HSN0Ao!BEC2ui literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_null_certs b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_null_certs new file mode 100644 index 0000000000000000000000000000000000000000..73ff9c0102b69178223484381cd4b9464a01fbf6 GIT binary patch literal 48 zcmXre<6>l3plP7a#;MK5$jZuYz{toVWgx-IV8G4BsnzDu_MMlJk(HV8{{j{RCRPRj Dm>CBu literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_inner_junk b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_inner_junk new file mode 100644 index 0000000000000000000000000000000000000000..169dbeaaa49410d67bc3dc6407de771eae31d523 GIT binary patch literal 50 zcmXpo;9_K0plzVZ#;MK5$jZuYz{toVV<5%KV8G4BsnzDu_MMlJk(HV8{{j{RCRPSk F1^}n^2RQ%$ literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_junk b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_junk new file mode 100644 index 0000000000000000000000000000000000000000..3ce548d3608531986f83d114428bd9b123c62235 GIT binary patch literal 44 zcmXre;$mc2plYDZ#;MK5$jZuYz{toVW+1}KV8G4BsnzDu_MMlJk(HV8KPv+OcfSTe literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_outer_junk b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/basic_response_trailing_outer_junk new file mode 100644 index 0000000000000000000000000000000000000000..52eb0f86fba0ea408553167f7a320a6c669eda8f GIT binary patch literal 50 zcmXpo;9_K0plzVZ#;MK5$jZuYz{toVV<5rGV8G4BsnzDu_MMlJk(HV8{{j{RCRPSk F1^}nO2R8r! literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_bad_oid_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_bad_oid_type new file mode 100644 index 0000000000000000000000000000000000000000..a821342cf2deb045e82b6812e924989b724f7dab GIT binary patch literal 12 TcmXru;$mc2z-qwE#K-^u2&n-f literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_bad_response_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_bad_response_type new file mode 100644 index 0000000000000000000000000000000000000000..cd6df83c0a0677b47e052b800d8e861dc6ec9103 GIT binary patch literal 22 dcmXpI;bLT1z;D3I#;MK5$jZuYz{tqT000^p0mT3S literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_empty_oid b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/response_bytes_empty_oid new file mode 100644 index 0000000000000000000000000000000000000000..63152f73a4efee339026938516c35bc774fc6baa GIT binary patch literal 11 ScmXrul3AZWnP#;MK5$jZuYz{tqL#KZsq9vcD9 literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_outer_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_outer_type new file mode 100644 index 0000000000000000000000000000000000000000..bbfb76b9d33ea5e7fdd2d8e33ee8660b9063da24 GIT binary patch literal 3 KcmZQ#WB>pF3jhQF literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_bytes b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_bytes new file mode 100644 index 0000000000000000000000000000000000000000..0b7768bca761618ae6c71b3b18e4f542184e0df5 GIT binary patch literal 8 PcmXqD<6>lBVq^dS0s8<& literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_bytes_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_bytes_type new file mode 100644 index 0000000000000000000000000000000000000000..5bd1e9887dbed7d94f88d1c61f26a84e58063857 GIT binary patch literal 9 QcmXqD=VD}7z{JV`00hkd>Hq)$ literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_status_type b/fuzz/ocsp_parse_ocsp_response_fuzzer_corpus/wrong_response_status_type new file mode 100644 index 0000000000000000000000000000000000000000..7b407dbd97f9fdd0f77e69a36a0096c4a04c84a2 GIT binary patch literal 5 McmXqDW@2Oj009XAHvj+t literal 0 HcmV?d00001 diff --git a/pki/ocsp_parse_ocsp_single_response_fuzzer.cc b/fuzz/ocsp_parse_ocsp_single_response_fuzzer.cc similarity index 66% rename from pki/ocsp_parse_ocsp_single_response_fuzzer.cc rename to fuzz/ocsp_parse_ocsp_single_response_fuzzer.cc index 9c079187c..3c7861dc6 100644 --- a/pki/ocsp_parse_ocsp_single_response_fuzzer.cc +++ b/fuzz/ocsp_parse_ocsp_single_response_fuzzer.cc @@ -5,13 +5,13 @@ #include #include -#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 single_response_der(data, size); - net::OCSPSingleResponse single_response; - net::ParseOCSPSingleResponse(single_response_der, &single_response); + bssl::OCSPSingleResponse single_response; + bssl::ParseOCSPSingleResponse(single_response_der, &single_response); return 0; } diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_cert_status_context b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_cert_status_context new file mode 100644 index 0000000000000000000000000000000000000000..610d53373cbd2364714eb6423cb6042354a4258d GIT binary patch literal 6 NcmXqDVP$A$000710KEVJ literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_cert_status_type b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_cert_status_type new file mode 100644 index 0000000000000000000000000000000000000000..f3ca9af890a6deb618ddfda9a9597414b04c573e GIT binary patch literal 6 NcmXqDVP!C2000550BQgL literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_extensions b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_extensions new file mode 100644 index 0000000000000000000000000000000000000000..e654d41830f382521e8649effa26e5f3fce1f5d1 GIT binary patch literal 59 lcmXr8WMx<=BEf5DX^ literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_next_update b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_next_update new file mode 100644 index 0000000000000000000000000000000000000000..b04f3adc52d170ac21183256588fdaa8c35653f5 GIT binary patch literal 43 gcmXreWMx<=BEf5DXpF3jhQF literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_date_offset b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_date_offset new file mode 100644 index 0000000000000000000000000000000000000000..85b7ccf3344685d56e036eb1bdd33f64f342463b GIT binary patch literal 21 XcmXpIW@T8&FTrbQXD8XxJX7001sL1V{h? literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_out_of_range b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_out_of_range new file mode 100644 index 0000000000000000000000000000000000000000..a31531c192892e303894495c5aa0bf7d360b7db1 GIT binary patch literal 26 ccmXqzU}ab+BEf5DXq=n?gWhh literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_type b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_reason_value_type new file mode 100644 index 0000000000000000000000000000000000000000..144078bc244883b7932d8992fc9b4018623c7ecb GIT binary patch literal 26 ccmXqzU}ab+BEf5DXk literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_trailing_data b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_revoked_info_trailing_data new file mode 100644 index 0000000000000000000000000000000000000000..5e5bcbc9645759d7e565471fa4fe7901a286a995 GIT binary patch literal 28 ecmXqzVr5t;Cc$fHXq=n;slET literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_this_update_type b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/bad_this_update_type new file mode 100644 index 0000000000000000000000000000000000000000..0d82e23017f04233bf9c3133c5dfdf76d6812921 GIT binary patch literal 29 fcmXqzW@T6?BEf5DXT)f literal 0 HcmV?d00001 diff --git a/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/empty_extensions b/fuzz/ocsp_parse_ocsp_single_response_fuzzer_corpus/empty_extensions new file mode 100644 index 0000000000000000000000000000000000000000..457a329590f086e47ef273f91913df3b2f3f0cb0 GIT binary patch literal 60 mcmXr8Vr5t;BEf5DX -#include "parse_certificate.h" -#include "input.h" +#include "../pki/parse_certificate.h" +#include "../pki/input.h" extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { bssl::der::Input der(data, size); - net::ParsedAuthorityKeyIdentifier authority_key_identifier; + bssl::ParsedAuthorityKeyIdentifier authority_key_identifier; std::ignore = - net::ParseAuthorityKeyIdentifier(der, &authority_key_identifier); + bssl::ParseAuthorityKeyIdentifier(der, &authority_key_identifier); return 0; } diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/empty_sequence b/fuzz/parse_authority_key_identifier_fuzzer_corpus/empty_sequence new file mode 100644 index 0000000000000000000000000000000000000000..def7fcb589b94b3707b9d3cb4d4825487a7fa402 GIT binary patch literal 2 JcmXqD0001D05Jdn literal 0 HcmV?d00001 diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/extra_contents_after_issuer_and_serial b/fuzz/parse_authority_key_identifier_fuzzer_corpus/extra_contents_after_issuer_and_serial new file mode 100644 index 000000000..0861b744d --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/extra_contents_after_issuer_and_serial @@ -0,0 +1 @@ +001 0 U Root'O4 \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/invalid_contents b/fuzz/parse_authority_key_identifier_fuzzer_corpus/invalid_contents new file mode 100644 index 000000000..bde072ea5 --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/invalid_contents @@ -0,0 +1 @@ +04 \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_and_serial b/fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_and_serial new file mode 100644 index 000000000..b92ee5007 --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_and_serial @@ -0,0 +1 @@ +001 0 U Root'O \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_only b/fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_only new file mode 100644 index 000000000..8576644b0 --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/issuer_only @@ -0,0 +1 @@ +001 0 U Root \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier b/fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier new file mode 100644 index 000000000..07d6612f5 --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier @@ -0,0 +1 @@ +0ޭ \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier_and_issuer_and_serial b/fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier_and_issuer_and_serial new file mode 100644 index 000000000..23b4b37ac --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/key_identifier_and_issuer_and_serial @@ -0,0 +1 @@ +0ޭ01 0 U Root'O \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/serial_only b/fuzz/parse_authority_key_identifier_fuzzer_corpus/serial_only new file mode 100644 index 000000000..b0fbe47b8 --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/serial_only @@ -0,0 +1 @@ +0'O \ No newline at end of file diff --git a/fuzz/parse_authority_key_identifier_fuzzer_corpus/url_issuer_and_serial b/fuzz/parse_authority_key_identifier_fuzzer_corpus/url_issuer_and_serial new file mode 100644 index 000000000..e5f1579b8 --- /dev/null +++ b/fuzz/parse_authority_key_identifier_fuzzer_corpus/url_issuer_and_serial @@ -0,0 +1 @@ +0http://example.com'O \ No newline at end of file diff --git a/pki/verify_name_match_fuzzer.cc b/fuzz/verify_name_match_fuzzer.cc similarity index 84% rename from pki/verify_name_match_fuzzer.cc rename to fuzz/verify_name_match_fuzzer.cc index 5b2b1599e..e5e2c21fa 100644 --- a/pki/verify_name_match_fuzzer.cc +++ b/fuzz/verify_name_match_fuzzer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "verify_name_match.h" +#include "../pki/verify_name_match.h" #include #include @@ -12,7 +12,7 @@ #include -#include "input.h" +#include "../pki/input.h" // Entry point for LibFuzzer. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { @@ -27,8 +27,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { bssl::der::Input in1(first_part); bssl::der::Input in2(second_part); - bool match = net::VerifyNameMatch(in1, in2); - bool reverse_order_match = net::VerifyNameMatch(in2, in1); + bool match = bssl::VerifyNameMatch(in1, in2); + bool reverse_order_match = bssl::VerifyNameMatch(in2, in1); // Result should be the same regardless of argument order. if (match != reverse_order_match) { abort(); diff --git a/fuzz/verify_name_match_fuzzer_corpus/1b016c1840c8e898f9ff55e637fafb3cf3ead130 b/fuzz/verify_name_match_fuzzer_corpus/1b016c1840c8e898f9ff55e637fafb3cf3ead130 new file mode 100644 index 0000000000000000000000000000000000000000..c6b3045aec53c4928bcb352d14514dbc00e9d2ad GIT binary patch literal 48 icmWev6?!;774~y0cwwzPie9n~39nXw;)RW`?sjT)bS!v_* z7>HMAZ1HuBYKk5(!ehu(-zooB=N2sgXJ#o;rb3ln_Solu8iyQl%!#1SIOl>(>RjP+ z%?-Cw;@&*%(V$67pdB9Q(xWfso&+}(=!h37`^p>de8?9jg8wo}g~K`Om((nb literal 0 HcmV?d00001 diff --git a/fuzz/verify_name_match_normalizename_fuzzer_corpus/81ea9ea4435b0dffc2df539aa81fe1baa9c1bab3 b/fuzz/verify_name_match_normalizename_fuzzer_corpus/81ea9ea4435b0dffc2df539aa81fe1baa9c1bab3 new file mode 100644 index 000000000..c9bf44b6a --- /dev/null +++ b/fuzz/verify_name_match_normalizename_fuzzer_corpus/81ea9ea4435b0dffc2df539aa81fe1baa9c1bab3 @@ -0,0 +1 @@ +0 1 1 UUS \ No newline at end of file diff --git a/fuzz/verify_name_match_normalizename_fuzzer_corpus/897be1df5da3a82bb30a3c3cfe6e737c791e7a64 b/fuzz/verify_name_match_normalizename_fuzzer_corpus/897be1df5da3a82bb30a3c3cfe6e737c791e7a64 new file mode 100644 index 0000000000000000000000000000000000000000..ca074fdb4515fc9c85300ece92896d70204a94a3 GIT binary patch literal 207 zcmXqLJY(26*MO6aIh2J>n90%6KnTQS=iydRa7=nOcjJ>?YZMHGL1G*tJRmXW6a@v> zGzA3%Q8q5lNot*wKk1|}N{X?kMkM+c_@o-hgVb`#NiZldBr-SwNrm)6zcnD5A(_F2 zLBT*Dq<~vSgMk4k#CQcr0ci+!L}Dia+0G!op|k-P#7)eOK=<*2*>Y?^(}B>C*MJ)= LAk32Noa_t$p6w!x literal 0 HcmV?d00001 diff --git a/fuzz/verify_name_match_normalizename_fuzzer_corpus/8c8d92335b0dd8916648af9298a03be29c47cb3b b/fuzz/verify_name_match_normalizename_fuzzer_corpus/8c8d92335b0dd8916648af9298a03be29c47cb3b new file mode 100644 index 000000000..28fc0fdd3 --- /dev/null +++ b/fuzz/verify_name_match_normalizename_fuzzer_corpus/8c8d92335b0dd8916648af9298a03be29c47cb3b @@ -0,0 +1 @@ +1 1 0 UUS \ No newline at end of file diff --git a/fuzz/verify_name_match_normalizename_fuzzer_corpus/a716b31050528102348026757fa7f5637da9e8b6 b/fuzz/verify_name_match_normalizename_fuzzer_corpus/a716b31050528102348026757fa7f5637da9e8b6 new file mode 100644 index 0000000000000000000000000000000000000000..fcacff8374d3bc8cd3bc183db179a89c67caa159 GIT binary patch literal 34 ncmXp|FyuDiWMd9xVH0NZ3NREj;0JNoWjGiZ(hC_F{MG;fM+^kL literal 0 HcmV?d00001 diff --git a/fuzz/verify_name_match_normalizename_fuzzer_corpus/f26c509626316176ed2d9ad0d8df8bd53a66f5a1 b/fuzz/verify_name_match_normalizename_fuzzer_corpus/f26c509626316176ed2d9ad0d8df8bd53a66f5a1 new file mode 100644 index 000000000..2c430e9c6 --- /dev/null +++ b/fuzz/verify_name_match_normalizename_fuzzer_corpus/f26c509626316176ed2d9ad0d8df8bd53a66f5a1 @@ -0,0 +1 @@ +01 0 UUS10U  New York 1_0]U V ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 '()+,-./:=? \ No newline at end of file diff --git a/fuzz/verify_name_match_normalizename_fuzzer_corpus/f944dcd635f9801f7ac90a407fbc479964dec024 b/fuzz/verify_name_match_normalizename_fuzzer_corpus/f944dcd635f9801f7ac90a407fbc479964dec024 new file mode 100644 index 0000000000000000000000000000000000000000..def7fcb589b94b3707b9d3cb4d4825487a7fa402 GIT binary patch literal 2 JcmXqD0001D05Jdn literal 0 HcmV?d00001 diff --git a/pki/verify_name_match_verifynameinsubtree_fuzzer.cc b/fuzz/verify_name_match_verifynameinsubtree_fuzzer.cc similarity index 80% rename from pki/verify_name_match_verifynameinsubtree_fuzzer.cc rename to fuzz/verify_name_match_verifynameinsubtree_fuzzer.cc index bfc70d331..226d23d02 100644 --- a/pki/verify_name_match_verifynameinsubtree_fuzzer.cc +++ b/fuzz/verify_name_match_verifynameinsubtree_fuzzer.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "verify_name_match.h" +#include "../pki/verify_name_match.h" #include #include @@ -11,7 +11,7 @@ #include -#include "input.h" +#include "../pki/input.h" // Entry point for LibFuzzer. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { @@ -26,11 +26,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { bssl::der::Input in1(first_part); bssl::der::Input in2(second_part); - bool match = net::VerifyNameInSubtree(in1, in2); - bool reverse_order_match = net::VerifyNameInSubtree(in2, in1); + bool match = bssl::VerifyNameInSubtree(in1, in2); + bool reverse_order_match = bssl::VerifyNameInSubtree(in2, in1); // If both InSubtree matches are true, then in1 == in2 (modulo normalization). if (match && reverse_order_match) { - if (!net::VerifyNameMatch(in1, in2)) { + if (!bssl::VerifyNameMatch(in1, in2)) { abort(); } } diff --git a/fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/1b016c1840c8e898f9ff55e637fafb3cf3ead130 b/fuzz/verify_name_match_verifynameinsubtree_fuzzer_corpus/1b016c1840c8e898f9ff55e637fafb3cf3ead130 new file mode 100644 index 0000000000000000000000000000000000000000..c6b3045aec53c4928bcb352d14514dbc00e9d2ad GIT binary patch literal 48 icmWe net::Error -> net::CertStatus, +// Note: It is not safe to go bssl::CertStatus -> bssl::Error -> bssl::CertStatus, // as the CertStatus contains more information. Conversely, going from -// net::Error -> net::CertStatus -> net::Error is not a lossy function, for the +// bssl::Error -> bssl::CertStatus -> bssl::Error is not a lossy function, for the // same reason. // To avoid incorrect use, this is only exported for unittest helpers. OPENSSL_EXPORT CertStatus MapNetErrorToCertStatus(int error); diff --git a/pki/common_cert_errors.cc b/pki/common_cert_errors.cc index 4807ae0fb..b13bc9421 100644 --- a/pki/common_cert_errors.cc +++ b/pki/common_cert_errors.cc @@ -82,4 +82,4 @@ DEFINE_CERT_ERROR_ID(kDeadlineExceeded, "Deadline exceeded"); DEFINE_CERT_ERROR_ID(kIterationLimitExceeded, "Iteration limit exceeded"); DEFINE_CERT_ERROR_ID(kDepthLimitExceeded, "Depth limit exceeded"); -} // namespace net::cert_errors +} // namespace bssl::cert_errors diff --git a/pki/common_cert_errors.h b/pki/common_cert_errors.h index c6cb33734..5e3f1b993 100644 --- a/pki/common_cert_errors.h +++ b/pki/common_cert_errors.h @@ -159,6 +159,6 @@ OPENSSL_EXPORT extern const CertErrorId kIterationLimitExceeded; // Depth limit was reached during path building. OPENSSL_EXPORT extern const CertErrorId kDepthLimitExceeded; -} // namespace net::cert_errors +} // namespace bssl::cert_errors #endif // BSSL_PKI_COMMON_CERT_ERRORS_H_ diff --git a/pki/import_spec.json b/pki/import_spec.json index f6617cd5a..8fcfa524c 100644 --- a/pki/import_spec.json +++ b/pki/import_spec.json @@ -189,18 +189,8 @@ "replace": ""}, {"match": "friend class base::RefCountedThreadSafe<.+>;", "replace": ""}, - {"match": "net::string_util::", - "replace": "bssl::string_util::"}, - {"match": "net::x509_util::", - "replace": "x509_util::"}, - {"match": " net::der", - "replace": " bssl::der"}, - {"match": "net::ParsedCertificate", - "replace": "ParsedCertificate"}, - {"match": "net::CertPathBuilderResultPath", - "replace": "CertPathBuilderResultPath"}, - {"match": "net::CertErrors", - "replace": "bssl::CertErrors"}, + {"match": "\\bnet::", + "replace": "bssl::"}, {"match": "base::Time::Exploded", "replace": "fillins::Exploded", "include": "fillins/time.h"}, diff --git a/pki/nist_pkits_unittest.h b/pki/nist_pkits_unittest.h index c6b91d62a..279fb295d 100644 --- a/pki/nist_pkits_unittest.h +++ b/pki/nist_pkits_unittest.h @@ -90,12 +90,12 @@ class PkitsTest : public ::testing::Test { const PkitsTestInfo& info) { std::vector cert_ders; for (const std::string s : cert_names) { - cert_ders.push_back(ReadTestFileToString( + cert_ders.push_back(bssl::ReadTestFileToString( "testdata/nist-pkits/certs/" + s + ".crt")); } std::vector crl_ders; for (const std::string s : crl_names) { - crl_ders.push_back(ReadTestFileToString( + crl_ders.push_back(bssl::ReadTestFileToString( "testdata/nist-pkits/crls/" + s + ".crl")); } diff --git a/pki/parse_certificate_fuzzer.cc b/pki/parse_certificate_fuzzer.cc deleted file mode 100644 index caf0c0ebb..000000000 --- a/pki/parse_certificate_fuzzer.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include -#include - -#include "cert_errors.h" -#include "parsed_certificate.h" -#include - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { - bssl::CertErrors errors; - std::shared_ptr cert = - ParsedCertificate::Create( - bssl::UniquePtr( - CRYPTO_BUFFER_new(data, size, nullptr)), - {}, &errors); - - // Severe errors must be provided iff the parsing failed. - CHECK_EQ(errors.ContainsAnyErrorWithSeverity(net::CertError::SEVERITY_HIGH), - cert == nullptr); - - return 0; -} diff --git a/pki/parsed_certificate.cc b/pki/parsed_certificate.cc index 5a5039c55..028bdadd2 100644 --- a/pki/parsed_certificate.cc +++ b/pki/parsed_certificate.cc @@ -282,7 +282,7 @@ std::shared_ptr ParsedCertificate::Create( bool ParsedCertificate::CreateAndAddToVector( bssl::UniquePtr cert_data, const ParseCertificateOptions& options, - std::vector>* chain, + std::vector>* chain, CertErrors* errors) { std::shared_ptr cert( Create(std::move(cert_data), options, errors)); diff --git a/pki/parsed_certificate.h b/pki/parsed_certificate.h index 5fbef8291..1f2083f46 100644 --- a/pki/parsed_certificate.h +++ b/pki/parsed_certificate.h @@ -70,7 +70,7 @@ class OPENSSL_EXPORT ParsedCertificate { static bool CreateAndAddToVector( bssl::UniquePtr cert_data, const ParseCertificateOptions& options, - std::vector>* chain, + std::vector>* chain, CertErrors* errors); explicit ParsedCertificate(PrivateConstructor); diff --git a/pki/patches/0001-Simplify-the-name-constraint-limit-to-resemble-Borin.patch b/pki/patches/0001-Simplify-the-name-constraint-limit-to-resemble-Borin.patch index 1917779e6..e786b3a6e 100644 --- a/pki/patches/0001-Simplify-the-name-constraint-limit-to-resemble-Borin.patch +++ b/pki/patches/0001-Simplify-the-name-constraint-limit-to-resemble-Borin.patch @@ -1,4 +1,4 @@ -From 6218984931c841f8e2939a94d58e7315a967fe68 Mon Sep 17 00:00:00 2001 +From 78f16e55f9d5cae7cf4b4bcf45c4af53db231cd9 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Wed, 17 May 2023 10:37:22 -0600 Subject: [PATCH 1/2] Simplify the name constraint limit to resemble @@ -45,7 +45,7 @@ index e9d834e1b51fa..ecf528b6e10a5 100644 "+base/supports_user_data.h", ] diff --git a/net/cert/pki/name_constraints.cc b/net/cert/pki/name_constraints.cc -index f6415dfbfec94..27d8638df87a7 100644 +index b1f4aa44e54e1..06703db78fb5b 100644 --- a/net/cert/pki/name_constraints.cc +++ b/net/cert/pki/name_constraints.cc @@ -8,7 +8,6 @@ @@ -139,10 +139,10 @@ index f6415dfbfec94..27d8638df87a7 100644 // Subject Alternative Name handling: diff --git a/net/cert/pki/verify_certificate_chain_typed_unittest.h b/net/cert/pki/verify_certificate_chain_typed_unittest.h -index fffb5c0339df9..d4090be9b604c 100644 +index a1af7849ebcc1..32a5be319d00d 100644 --- a/net/cert/pki/verify_certificate_chain_typed_unittest.h +++ b/net/cert/pki/verify_certificate_chain_typed_unittest.h -@@ -276,10 +276,9 @@ TYPED_TEST_P(VerifyCertificateChainSingleRootTest, Policies) { +@@ -275,10 +275,9 @@ TYPED_TEST_P(VerifyCertificateChainSingleRootTest, Policies) { } TYPED_TEST_P(VerifyCertificateChainSingleRootTest, ManyNames) { @@ -155,7 +155,7 @@ index fffb5c0339df9..d4090be9b604c 100644 this->RunTest("many-names/toomany-all-types.test"); this->RunTest("many-names/toomany-dns-excluded.test"); this->RunTest("many-names/toomany-dns-permitted.test"); -@@ -287,6 +286,7 @@ TYPED_TEST_P(VerifyCertificateChainSingleRootTest, ManyNames) { +@@ -286,6 +285,7 @@ TYPED_TEST_P(VerifyCertificateChainSingleRootTest, ManyNames) { this->RunTest("many-names/toomany-ips-permitted.test"); this->RunTest("many-names/toomany-dirnames-excluded.test"); this->RunTest("many-names/toomany-dirnames-permitted.test"); @@ -164,10 +164,10 @@ index fffb5c0339df9..d4090be9b604c 100644 TYPED_TEST_P(VerifyCertificateChainSingleRootTest, TargetOnly) { diff --git a/net/data/test_bundle_data.filelist b/net/data/test_bundle_data.filelist -index 3eccfcb4a981a..baa64c0a92171 100644 +index a33bdbe30a0eb..00c635befd873 100644 --- a/net/data/test_bundle_data.filelist +++ b/net/data/test_bundle_data.filelist -@@ -751,12 +751,6 @@ data/verify_certificate_chain_unittest/key-rollover/rolloverchain.pem +@@ -753,12 +753,6 @@ data/verify_certificate_chain_unittest/key-rollover/rolloverchain.pem data/verify_certificate_chain_unittest/key-rollover/rolloverchain.test data/verify_certificate_chain_unittest/many-names/ok-all-types.pem data/verify_certificate_chain_unittest/many-names/ok-all-types.test @@ -41105,5 +41105,5 @@ index efdbd5eaca095..56bc9c89c4c42 100644 Validity Not Before: Oct 5 12:00:00 2021 GMT -- -2.41.0.162.gfafddb0af9-goog +2.41.0.694.ge786442a9b-goog diff --git a/pki/patches/0002-disable-path-builder-tests-with-unsupported-dependen.patch b/pki/patches/0002-disable-path-builder-tests-with-unsupported-dependen.patch index 6565afae6..6abbe752a 100644 --- a/pki/patches/0002-disable-path-builder-tests-with-unsupported-dependen.patch +++ b/pki/patches/0002-disable-path-builder-tests-with-unsupported-dependen.patch @@ -1,4 +1,4 @@ -From 0a1d630dbc33f63009aabb4907a1dbeb4c934415 Mon Sep 17 00:00:00 2001 +From 0c4866b5b94854983697ebc362efba8d05e5cb86 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Fri, 2 Jun 2023 11:08:50 +0200 Subject: [PATCH 2/2] disable path builder tests with unsupported dependencies @@ -8,10 +8,10 @@ Subject: [PATCH 2/2] disable path builder tests with unsupported dependencies 1 file changed, 12 insertions(+) diff --git a/net/cert/pki/path_builder_unittest.cc b/net/cert/pki/path_builder_unittest.cc -index d2cf0626cd474..112d0cafd811b 100644 +index 2ee48ce3f5ecc..3a9ead52f0d54 100644 --- a/net/cert/pki/path_builder_unittest.cc +++ b/net/cert/pki/path_builder_unittest.cc -@@ -34,6 +34,7 @@ namespace net { +@@ -32,6 +32,7 @@ namespace net { namespace { @@ -19,7 +19,7 @@ index d2cf0626cd474..112d0cafd811b 100644 using ::testing::_; using ::testing::ElementsAre; using ::testing::Exactly; -@@ -43,6 +44,7 @@ using ::testing::Return; +@@ -41,6 +42,7 @@ using ::testing::Return; using ::testing::SaveArg; using ::testing::SetArgPointee; using ::testing::StrictMock; @@ -27,7 +27,7 @@ index d2cf0626cd474..112d0cafd811b 100644 class TestPathBuilderDelegate : public SimplePathBuilderDelegate { public: -@@ -161,6 +163,7 @@ class AsyncCertIssuerSourceStatic : public CertIssuerSource { +@@ -159,6 +161,7 @@ class AsyncCertIssuerSourceStatic : public CertIssuerSource { } const void* kKey = &kKey; @@ -35,7 +35,7 @@ index d2cf0626cd474..112d0cafd811b 100644 class TrustStoreThatStoresUserData : public TrustStore { public: class Data : public base::SupportsUserData::Data { -@@ -202,6 +205,7 @@ TEST(PathBuilderResultUserDataTest, ModifyUserDataInConstructor) { +@@ -200,6 +203,7 @@ TEST(PathBuilderResultUserDataTest, ModifyUserDataInConstructor) { ASSERT_TRUE(data); EXPECT_EQ(1234, data->value); } @@ -43,7 +43,7 @@ index d2cf0626cd474..112d0cafd811b 100644 class PathBuilderMultiRootTest : public ::testing::Test { public: -@@ -1566,6 +1570,7 @@ TEST_F(PathBuilderKeyRolloverTest, TestDuplicateIntermediateAndRoot) { +@@ -1564,6 +1568,7 @@ TEST_F(PathBuilderKeyRolloverTest, TestDuplicateIntermediateAndRoot) { EXPECT_EQ(newroot_->der_cert(), path.certs[2]->der_cert()); } @@ -51,7 +51,7 @@ index d2cf0626cd474..112d0cafd811b 100644 class MockCertIssuerSourceRequest : public CertIssuerSource::Request { public: MOCK_METHOD2(GetNext, void(ParsedCertificateList*, base::SupportsUserData*)); -@@ -1578,6 +1583,7 @@ class MockCertIssuerSource : public CertIssuerSource { +@@ -1576,6 +1581,7 @@ class MockCertIssuerSource : public CertIssuerSource { MOCK_METHOD2(AsyncGetIssuersOf, void(const ParsedCertificate*, std::unique_ptr*)); }; @@ -59,7 +59,7 @@ index d2cf0626cd474..112d0cafd811b 100644 // Helper class to pass the Request to the PathBuilder when it calls // AsyncGetIssuersOf. (GoogleMock has a ByMove helper, but it apparently can -@@ -1613,6 +1619,7 @@ class AppendCertToList { +@@ -1611,6 +1617,7 @@ class AppendCertToList { std::shared_ptr cert_; }; @@ -67,7 +67,7 @@ index d2cf0626cd474..112d0cafd811b 100644 // Test that a single CertIssuerSource returning multiple async batches of // issuers is handled correctly. Due to the StrictMocks, it also tests that path // builder does not request issuers of certs that it shouldn't. -@@ -1782,6 +1789,7 @@ TEST_F(PathBuilderKeyRolloverTest, TestDuplicateAsyncIntermediates) { +@@ -1780,6 +1787,7 @@ TEST_F(PathBuilderKeyRolloverTest, TestDuplicateAsyncIntermediates) { EXPECT_EQ(newintermediate_, path1.certs[1]); EXPECT_EQ(newroot_, path1.certs[2]); } @@ -75,7 +75,7 @@ index d2cf0626cd474..112d0cafd811b 100644 class PathBuilderSimpleChainTest : public ::testing::Test { public: -@@ -1936,6 +1944,7 @@ class CertPathBuilderDelegateBase : public SimplePathBuilderDelegate { +@@ -1934,6 +1942,7 @@ class CertPathBuilderDelegateBase : public SimplePathBuilderDelegate { } }; @@ -83,7 +83,7 @@ index d2cf0626cd474..112d0cafd811b 100644 class MockPathBuilderDelegate : public CertPathBuilderDelegateBase { public: MOCK_METHOD2(CheckPathAfterVerification, -@@ -1951,6 +1960,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, NoOpToValidPath) { +@@ -1949,6 +1958,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, NoOpToValidPath) { CertPathBuilder::Result result = RunPathBuilder(nullptr, &delegate); EXPECT_TRUE(result.HasValidPath()); } @@ -91,7 +91,7 @@ index d2cf0626cd474..112d0cafd811b 100644 DEFINE_CERT_ERROR_ID(kWarningFromDelegate, "Warning from delegate"); -@@ -2002,6 +2012,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, AddsErrorToValidPath) { +@@ -2000,6 +2010,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, AddsErrorToValidPath) { EXPECT_TRUE(cert2_errors->ContainsError(kErrorFromDelegate)); } @@ -99,7 +99,7 @@ index d2cf0626cd474..112d0cafd811b 100644 TEST_F(PathBuilderCheckPathAfterVerificationTest, NoopToAlreadyInvalidPath) { StrictMock delegate; // Just verify that the hook is called (on an invalid path). -@@ -2034,6 +2045,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, SetsDelegateData) { +@@ -2032,6 +2043,7 @@ TEST_F(PathBuilderCheckPathAfterVerificationTest, SetsDelegateData) { EXPECT_EQ(0xB33F, data->value); } @@ -108,5 +108,5 @@ index d2cf0626cd474..112d0cafd811b 100644 TEST(PathBuilderPrioritizationTest, DatePrioritization) { std::string test_dir = -- -2.41.0.162.gfafddb0af9-goog +2.41.0.694.ge786442a9b-goog diff --git a/pki/path_builder.cc b/pki/path_builder.cc index 9f4b7e98f..2aa1c2171 100644 --- a/pki/path_builder.cc +++ b/pki/path_builder.cc @@ -32,7 +32,7 @@ namespace { using CertIssuerSources = std::vector; // Returns a hex-encoded sha256 of the DER-encoding of |cert|. -std::string FingerPrintParsedCertificate(const ParsedCertificate* cert) { +std::string FingerPrintParsedCertificate(const bssl::ParsedCertificate* cert) { uint8_t digest[SHA256_DIGEST_LENGTH]; SHA256(cert->der_cert().UnsafeData(), cert->der_cert().Length(), digest); return bssl::string_util::HexEncode(digest, sizeof(digest)); diff --git a/pki/path_builder_pkits_unittest.cc b/pki/path_builder_pkits_unittest.cc index 620205ce2..b797cd498 100644 --- a/pki/path_builder_pkits_unittest.cc +++ b/pki/path_builder_pkits_unittest.cc @@ -234,7 +234,7 @@ class PathBuilderPkitsTestDelegate { if (info.should_validate != result.HasValidPath()) { for (size_t i = 0; i < result.paths.size(); ++i) { - const CertPathBuilderResultPath* result_path = + const bssl::CertPathBuilderResultPath* result_path = result.paths[i].get(); LOG(ERROR) << "path " << i << " errors:\n" << result_path->errors.ToDebugString(result_path->certs); diff --git a/pki/string_util.cc b/pki/string_util.cc index 9f1b15d2d..5e97eb589 100644 --- a/pki/string_util.cc +++ b/pki/string_util.cc @@ -114,4 +114,4 @@ std::vector SplitString(std::string_view str, return out; } -} // namespace net::string_util +} // namespace bssl::string_util diff --git a/pki/string_util.h b/pki/string_util.h index 08bb2b754..635f9ea1e 100644 --- a/pki/string_util.h +++ b/pki/string_util.h @@ -60,6 +60,6 @@ OPENSSL_EXPORT std::vector SplitString( std::string_view str, char split_char); -} // namespace net::string_util +} // namespace bssl::string_util #endif // BSSL_PKI_STRING_UTIL_H_