summaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authormmoroz <mmoroz@chromium.org>2015-12-11 07:51:25 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-11 15:52:32 +0000
commit4617e91a29d423fc85827a9f6bb769620c11d9fd (patch)
tree8f99f4e3a12b42ad8abd52ef6c5575e3cec38f4a /testing
parent62a1e0e7fdf42f9f0f49b877bb883eeff5d588f4 (diff)
downloadchromium_src-4617e91a29d423fc85827a9f6bb769620c11d9fd.zip
chromium_src-4617e91a29d423fc85827a9f6bb769620c11d9fd.tar.gz
chromium_src-4617e91a29d423fc85827a9f6bb769620c11d9fd.tar.bz2
fuzzer for QUIC net::CryptoFramer::ParseMessage implemented
R=aizatsky@chromium.org, inferno@chromium.org, krasin@chromium.org BUG=566504 Review URL: https://codereview.chromium.org/1508343005 Cr-Commit-Position: refs/heads/master@{#364708}
Diffstat (limited to 'testing')
-rw-r--r--testing/libfuzzer/fuzzers/BUILD.gn11
-rw-r--r--testing/libfuzzer/fuzzers/quic_crypto_framer_parse_message_fuzzer.cc17
2 files changed, 28 insertions, 0 deletions
diff --git a/testing/libfuzzer/fuzzers/BUILD.gn b/testing/libfuzzer/fuzzers/BUILD.gn
index 881ea1d..c708a45 100644
--- a/testing/libfuzzer/fuzzers/BUILD.gn
+++ b/testing/libfuzzer/fuzzers/BUILD.gn
@@ -262,3 +262,14 @@ test("http_chunked_decoder_fuzzer") {
"//testing/libfuzzer:libfuzzer_main",
]
}
+
+test("quic_crypto_framer_parse_message_fuzzer") {
+ sources = [
+ "quic_crypto_framer_parse_message_fuzzer.cc",
+ ]
+ deps = [
+ "//base",
+ "//net",
+ "//testing/libfuzzer:libfuzzer_main",
+ ]
+}
diff --git a/testing/libfuzzer/fuzzers/quic_crypto_framer_parse_message_fuzzer.cc b/testing/libfuzzer/fuzzers/quic_crypto_framer_parse_message_fuzzer.cc
new file mode 100644
index 0000000..c5725ba
--- /dev/null
+++ b/testing/libfuzzer/fuzzers/quic_crypto_framer_parse_message_fuzzer.cc
@@ -0,0 +1,17 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <vector>
+
+#include "base/strings/string_piece.h"
+#include "net/quic/crypto/crypto_framer.h"
+
+// Entry point for LibFuzzer.
+extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size) {
+ base::StringPiece crypto_input(reinterpret_cast<const char *>(data), size);
+ std::unique_ptr<net::CryptoHandshakeMessage> handshake_message(
+ net::CryptoFramer::ParseMessage(crypto_input));
+
+ return 0;
+}