Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,10 @@ case $host in

dnl We require Windows 7 (NT 6.1) or later
AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"], [], [$LDFLAG_WERROR])

dnl Avoid the use of aligned vector instructions when building for Windows.
dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
AX_CHECK_COMPILE_FLAG([-Wa,-muse-unaligned-vector-move], [CORE_CXXFLAGS="$CORE_CXXFLAGS -Wa,-muse-unaligned-vector-move"], [], [$CXXFLAG_WERROR])
;;
*darwin*)
TARGET_OS=darwin
Expand Down Expand Up @@ -1006,12 +1010,6 @@ if test "$use_hardening" != "no"; then
AX_CHECK_LINK_FLAG([-Wl,-z,now], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"], [], [$LDFLAG_WERROR])
AX_CHECK_LINK_FLAG([-Wl,-z,separate-code], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,separate-code"], [], [$LDFLAG_WERROR])
AX_CHECK_LINK_FLAG([-fPIE -pie], [PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"], [], [$CXXFLAG_WERROR])

case $host in
*mingw*)
AC_CHECK_LIB([ssp], [main], [], [AC_MSG_ERROR([libssp missing])])
;;
esac
fi

dnl These flags are specific to ld64, and may cause issues with other linkers.
Expand All @@ -1023,7 +1021,7 @@ if test "$TARGET_OS" = "darwin"; then
AX_CHECK_LINK_FLAG([-Wl,-fixup_chains], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [$LDFLAG_WERROR])
fi

AC_CHECK_HEADERS([sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])
AC_CHECK_HEADERS([sys/select.h sys/prctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h])

AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],,
[#include <sys/types.h>
Expand Down
8 changes: 2 additions & 6 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,8 @@ inspecting signatures in Mach-O binaries.")
`(append ,flags
;; https://gcc.gnu.org/install/configure.html
(list "--enable-threads=posix",
building-on)))
((#:make-flags flags)
;; Uses the SSP functions from glibc instead of from libssp.so.
;; Our 'symbol-check' script will complain if we link against libssp.so,
;; and thus will ensure that this works properly.
`(cons "gcc_cv_libc_provides_ssp=yes" ,flags))))))
"--enable-default-ssp=yes",
building-on)))))))

(define-public linux-base-gcc
(package
Expand Down
2 changes: 0 additions & 2 deletions doc/multisig-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ This tutorial also uses the default PKH derivation path to get the xpubs and doe

At the time of writing, there is no way to extract a specific path from wallets in Dash Core. For this, an external signer/xpub can be used.

[PR #22341](https://github.com/bitcoin/bitcoin/pull/22341), which is still under development, introduces a new wallet RPC `getxpub`. It takes a BIP32 path as an argument and returns the xpub, along with the master key fingerprint.

## 1.1 Basic Multisig Workflow

### 1.1 Create the Descriptor Wallets
Expand Down
8 changes: 2 additions & 6 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,16 +589,12 @@ void SetupServerArgs(ArgsManager& argsman)
argsman.AddArg("-torcontrol=<ip>:<port>", strprintf("Tor control port to use if onion listening enabled (default: %s)", DEFAULT_TOR_CONTROL), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
argsman.AddArg("-torpassword=<pass>", "Tor control port password (default: empty)", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::CONNECTION);
#ifdef USE_UPNP
#if USE_UPNP
argsman.AddArg("-upnp", "Use UPnP to map the listening port (default: 1 when listening and no -proxy)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
#else
argsman.AddArg("-upnp", strprintf("Use UPnP to map the listening port (default: %u)", 0), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
#endif
argsman.AddArg("-upnp", strprintf("Use UPnP to map the listening port (default: %u)", DEFAULT_UPNP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
#else
hidden_args.emplace_back("-upnp");
#endif
#ifdef USE_NATPMP
argsman.AddArg("-natpmp", strprintf("Use NAT-PMP to map the listening port (default: %s)", DEFAULT_NATPMP ? "1 when listening and no -proxy" : "0"), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
argsman.AddArg("-natpmp", strprintf("Use NAT-PMP to map the listening port (default: %u)", DEFAULT_NATPMP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
#else
hidden_args.emplace_back("-natpmp");
#endif // USE_NATPMP
Expand Down
22 changes: 22 additions & 0 deletions src/test/fuzz/fuzz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ void FuzzFrameworkRegisterTarget(std::string_view name, TypeTestOneInput target,
static std::string_view g_fuzz_target;
static const TypeTestOneInput* g_test_one_input{nullptr};


#if defined(__clang__) && defined(__linux__)
extern "C" void __llvm_profile_reset_counters(void) __attribute__((weak));
extern "C" void __gcov_reset(void) __attribute__((weak));

void ResetCoverageCounters()
{
if (__llvm_profile_reset_counters) {
__llvm_profile_reset_counters();
}

if (__gcov_reset) {
__gcov_reset();
}
}
#else
void ResetCoverageCounters() {}
#endif


void initialize()
{
// Terminate immediately if a fuzzing harness ever tries to create a TCP socket.
Expand Down Expand Up @@ -126,6 +146,8 @@ void initialize()
Assert(!g_test_one_input);
g_test_one_input = &it->second.test_one_input;
it->second.opts.init();

ResetCoverageCounters();
}

#if defined(PROVIDE_FUZZ_MAIN_FUNCTION)
Expand Down
24 changes: 23 additions & 1 deletion test/functional/p2p_add_connections.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2020-2021 The Bitcoin Core developers
# Copyright (c) 2020-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test add_outbound_p2p_connection test framework functionality"""
Expand All @@ -11,6 +11,14 @@
check_node_connections,
)


class VersionSender(P2PInterface):
def on_open(self):
assert self.on_connection_send_msg is not None
self.send_version()
assert self.on_connection_send_msg is None


class P2PFeelerReceiver(P2PInterface):
def on_version(self, message):
# The bitcoind node closes feeler connections as soon as a version
Expand Down Expand Up @@ -107,5 +115,19 @@ def run_test(self):
# Feeler connections do not request tx relay
assert_equal(feeler_conn.last_message["version"].relay, 0)

self.log.info("Send version message early to node")
# Normally the test framework would be shy and send the version message
# only after it received one. See the on_version method. Check that
# bitcoind behaves properly when a version is sent unexpectedly (but
# tolerably) early.
#
# This checks that bitcoind sends its own version prior to processing
# the remote version (and replying with a verack). Otherwise it would
# be violating its own rules, such as "non-version message before
# version handshake".
ver_conn = self.nodes[0].add_outbound_p2p_connection(VersionSender(), p2p_idx=6, connection_type="outbound-full-relay", supports_v2_p2p=False, advertise_v2_p2p=False)
ver_conn.sync_with_ping()


if __name__ == '__main__':
P2PAddConnections().main()
6 changes: 6 additions & 0 deletions test/sanitizer_suppressions/ubsan
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ unsigned-integer-overflow:bench/bench.h
unsigned-integer-overflow:FuzzedDataProvider.h
unsigned-integer-overflow:leveldb/
unsigned-integer-overflow:minisketch/
unsigned-integer-overflow:secp256k1/
unsigned-integer-overflow:test/fuzz/crypto_diff_fuzz_chacha20.cpp
implicit-integer-sign-change:*/include/boost/
implicit-integer-sign-change:*/include/c++/
Expand All @@ -27,15 +28,20 @@ implicit-integer-sign-change:crc32c/
# implicit-integer-sign-change in FuzzedDataProvider's ConsumeIntegralInRange
implicit-integer-sign-change:FuzzedDataProvider.h
implicit-integer-sign-change:minisketch/
implicit-integer-sign-change:secp256k1/
implicit-signed-integer-truncation:*/include/c++/
implicit-signed-integer-truncation:leveldb/
implicit-signed-integer-truncation:secp256k1/
implicit-unsigned-integer-truncation:*/include/c++/
implicit-unsigned-integer-truncation:leveldb/
implicit-unsigned-integer-truncation:secp256k1/
implicit-unsigned-integer-truncation:test/fuzz/crypto_diff_fuzz_chacha20.cpp
# std::variant warning fixed in https://github.com/gcc-mirror/gcc/commit/074436cf8cdd2a9ce75cadd36deb8301f00e55b9
implicit-unsigned-integer-truncation:std::__detail::__variant::_Variant_storage
shift-base:*/include/c++/
shift-base:leveldb/
shift-base:minisketch/
shift-base:secp256k1/
shift-base:test/fuzz/crypto_diff_fuzz_chacha20.cpp
# Unsigned integer overflow occurs when the result of an unsigned integer
# computation cannot be represented in its type. Unlike signed integer overflow,
Expand Down
Loading