diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 65e460a303..8e3bdcd423 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -102,6 +102,17 @@ webrtc_fuzzer_test("vp9_depacketizer_fuzzer") { ] } +webrtc_fuzzer_test("dtls_utils_fuzzer") { + sources = [ "dtls_utils_fuzzer.cc" ] + deps = [ + "../../api:array_view", + "../../p2p:dtls_utils", + ] + + # Seed from boringssl DTLS corpus. + seed_corpus = "../../third_party/boringssl/src/fuzz/dtls_client_corpus" +} + webrtc_fuzzer_test("vp8_qp_parser_fuzzer") { sources = [ "vp8_qp_parser_fuzzer.cc" ] deps = [ diff --git a/test/fuzzers/DEPS b/test/fuzzers/DEPS index 50b1c8adce..ce07bcbe6c 100644 --- a/test/fuzzers/DEPS +++ b/test/fuzzers/DEPS @@ -2,4 +2,5 @@ include_rules = [ "+audio", "+pc", "+net/dcsctp", + "+p2p", ] diff --git a/test/fuzzers/dtls_utils_fuzzer.cc b/test/fuzzers/dtls_utils_fuzzer.cc new file mode 100644 index 0000000000..8a4f9e074a --- /dev/null +++ b/test/fuzzers/dtls_utils_fuzzer.cc @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ +#include +#include + +#include "api/array_view.h" +#include "p2p/dtls/dtls_utils.h" + +namespace webrtc { +void FuzzOneInput(const uint8_t* data, size_t size) { + cricket::GetDtlsHandshakeAcks(rtc::MakeArrayView(data, size)); +} + +} // namespace webrtc