diff options
author | fanquake <fanquake@gmail.com> | 2023-10-20 15:08:59 +0100 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-10-20 15:30:16 +0100 |
commit | abfc8c901df6853c1a52b7350f4c18dc70269ec9 (patch) | |
tree | 2bfbfd010f6899b3b8828d97ddb9bbe43d326dc0 /src | |
parent | 3c856e2fe86ae7d245de09921bd1df15f02c93a3 (diff) | |
parent | dd4dcbd4cda31f67d014a93340a6d1ba1c245b0f (diff) |
Merge bitcoin/bitcoin#28692: fuzz: Delete i2p fuzz test
dd4dcbd4cda31f67d014a93340a6d1ba1c245b0f [fuzz] Delete i2p target (dergoegge)
Pull request description:
closes #28665
The target is buggy and doesn't reach basic coverage.
ACKs for top commit:
maflcko:
lgtm ACK dd4dcbd4cda31f67d014a93340a6d1ba1c245b0f
glozow:
ACK dd4dcbd4cda31f67d014a93340a6d1ba1c245b0f, agree it's better to delete this test until somebody wants to write a better one
Tree-SHA512: b6ca6cad1773b1ceb6e5ac0fd501ea615f66507ef811745799deaaa4460f1700d96ae03cf55b740a96ed8cd2283b3d6738cd580ba97f2af619197d6c4414ca21
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.test.include | 1 | ||||
-rw-r--r-- | src/test/fuzz/i2p.cpp | 58 |
2 files changed, 0 insertions, 59 deletions
diff --git a/src/Makefile.test.include b/src/Makefile.test.include index d66f5bf53a..b610dabd07 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -280,7 +280,6 @@ test_fuzz_fuzz_SOURCES = \ test/fuzz/headerssync.cpp \ test/fuzz/hex.cpp \ test/fuzz/http_request.cpp \ - test/fuzz/i2p.cpp \ test/fuzz/integer.cpp \ test/fuzz/key.cpp \ test/fuzz/key_io.cpp \ diff --git a/src/test/fuzz/i2p.cpp b/src/test/fuzz/i2p.cpp deleted file mode 100644 index 943595f8a4..0000000000 --- a/src/test/fuzz/i2p.cpp +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2020-2022 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include <common/args.h> -#include <i2p.h> -#include <netaddress.h> -#include <netbase.h> -#include <test/fuzz/FuzzedDataProvider.h> -#include <test/fuzz/fuzz.h> -#include <test/fuzz/util.h> -#include <test/fuzz/util/net.h> -#include <test/util/setup_common.h> -#include <util/threadinterrupt.h> - -void initialize_i2p() -{ - static const auto testing_setup = MakeNoLogFileContext<>(); -} - -FUZZ_TARGET(i2p, .init = initialize_i2p) -{ - FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()}; - - // Mock CreateSock() to create FuzzedSock. - auto CreateSockOrig = CreateSock; - CreateSock = [&fuzzed_data_provider](const CService&) { - return std::make_unique<FuzzedSock>(fuzzed_data_provider); - }; - - const CService sam_proxy; - CThreadInterrupt interrupt; - - i2p::sam::Session sess{gArgs.GetDataDirNet() / "fuzzed_i2p_private_key", sam_proxy, &interrupt}; - - i2p::Connection conn; - - if (sess.Listen(conn)) { - if (sess.Accept(conn)) { - try { - (void)conn.sock->RecvUntilTerminator('\n', 10ms, interrupt, i2p::sam::MAX_MSG_SIZE); - } catch (const std::runtime_error&) { - } - } - } - - const CService to; - bool proxy_error; - - if (sess.Connect(to, conn, proxy_error)) { - try { - conn.sock->SendComplete("verack\n", 10ms, interrupt); - } catch (const std::runtime_error&) { - } - } - - CreateSock = CreateSockOrig; -} |