fuzzers: add DTLS fuzzer

to fuzz the code parsing DTLS packets for DTLS-STUN piggybacking

BUG=webrtc:367395350

Change-Id: Ifa1a52ef56b322e465604e8d49ae18e5dc27613f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371360
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#43562}
This commit is contained in:
Philipp Hancke 2024-12-13 07:46:49 -08:00 committed by WebRTC LUCI CQ
parent 316d93b415
commit adacadb678
3 changed files with 33 additions and 0 deletions

View File

@ -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 = [

View File

@ -2,4 +2,5 @@ include_rules = [
"+audio",
"+pc",
"+net/dcsctp",
"+p2p",
]

View File

@ -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 <cstddef>
#include <cstdint>
#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