Landing these in WebRTC under a guard so they don't build in
Chromium. The guard can be removed once Chromium has migrated to use the
new GN targets.

BUG=webrtc:6081
NOTRY=true

Review-Url: https://codereview.webrtc.org/2117183005
Cr-Commit-Position: refs/heads/master@{#13397}
This commit is contained in:
katrielc 2016-07-06 08:02:00 -07:00 committed by Commit bot
parent 44abcb5e41
commit 1d4fefbbaf
4 changed files with 108 additions and 0 deletions

View File

@ -189,4 +189,36 @@ if (!build_with_chromium) {
"../../media:media",
]
}
webrtc_fuzzer_test("sdp_parser_fuzzer") {
sources = [
"sdp_parser_fuzzer.cc",
]
deps = [
"../../api:libjingle_peerconnection",
]
seed_corpus = "corpora/sdp-corpus"
}
webrtc_fuzzer_test("stun_parser_fuzzer") {
sources = [
"stun_parser_fuzzer.cc",
]
deps = [
"../../p2p:rtc_p2p",
]
seed_corpus = "corpora/stun-corpus"
dict = "corpora/stun.tokens"
}
webrtc_fuzzer_test("stun_validator_fuzzer") {
sources = [
"stun_validator_fuzzer.cc",
]
deps = [
"../../p2p:rtc_p2p",
]
seed_corpus = "corpora/stun-corpus"
dict = "corpora/stun.tokens"
}
}

View File

@ -0,0 +1,25 @@
/*
* Copyright (c) 2016 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 <stddef.h>
#include <stdint.h>
#include "webrtc/api/jsepsessiondescription.h"
namespace webrtc {
void FuzzOneInput(const uint8_t* data, size_t size) {
std::string message(reinterpret_cast<const char*>(data), size);
webrtc::SdpParseError error;
std::unique_ptr<webrtc::SessionDescriptionInterface> sdp(
CreateSessionDescription("offer", message, &error));
}
} // namespace webrtc

View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2016 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 <stddef.h>
#include <stdint.h>
#include "webrtc/p2p/base/stun.h"
namespace webrtc {
void FuzzOneInput(const uint8_t* data, size_t size) {
const char* message = reinterpret_cast<const char*>(data);
// Normally we'd check the integrity first, but those checks are
// fuzzed separately in stun_validator_fuzzer.cc. We still want to
// fuzz this target since the integrity checks could be forged by a
// malicious adversary who receives a call.
std::unique_ptr<cricket::IceMessage> stun_msg(new cricket::IceMessage());
rtc::ByteBufferReader buf(message, size);
stun_msg->Read(&buf);
}
} // namespace webrtc

View File

@ -0,0 +1,23 @@
/*
* Copyright (c) 2016 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 <stddef.h>
#include <stdint.h>
#include "webrtc/p2p/base/stun.h"
namespace webrtc {
void FuzzOneInput(const uint8_t* data, size_t size) {
const char* message = reinterpret_cast<const char*>(data);
cricket::StunMessage::ValidateFingerprint(message, size);
cricket::StunMessage::ValidateMessageIntegrity(message, size, "");
}
} // namespace webrtc