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
575 changes: 299 additions & 276 deletions Makefile.am

Large diffs are not rendered by default.

393 changes: 117 additions & 276 deletions builds/cmake/CMakeLists.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions builds/msvc/vs2022/libbitcoin-network.import.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@

<ItemDefinitionGroup>
<ClCompile>
<!-- include\bitcoin\ssl\ is a directory clone of a subset of wolfssl sources, plus config. -->
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\..\libbitcoin-network\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<PreprocessorDefinitions Condition="'$(Linkage-libbitcoin-network)' == 'static' Or '$(Linkage-libbitcoin-network)' == 'ltcg'">BCT_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- WOLFSSL_USER_SETTINGS enables import of "user_settings.h" into wolfssl without source modification. -->
<PreprocessorDefinitions>WOLFSSL_USER_SETTINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies Condition="'$(Linkage-libbitcoin-network)' != ''">libbitcoin-network.lib;%(AdditionalDependencies)</AdditionalDependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<ItemDefinitionGroup>
<ClCompile>
<!-- src\wolfssl\ is a directory clone of a subset of wolfssl sources. -->
<AdditionalIncludeDirectories>$(RepoRoot)src\wolfssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<!-- include\bitcoin\ssl\ is a directory clone of a subset of wolfssl sources, plus config. -->
<AdditionalIncludeDirectories>$(RepoRoot)include\bitcoin\ssl\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(RepoRoot)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
<EnablePREfast>false</EnablePREfast>
Expand Down
557 changes: 283 additions & 274 deletions builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj

Large diffs are not rendered by default.

1,217 changes: 628 additions & 589 deletions builds/msvc/vs2022/libbitcoin-network/libbitcoin-network.vcxproj.filters

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ AC_ARG_ENABLE([isystem],
AC_MSG_RESULT([$enable_isystem])


# Set preprocessor defines.
#==============================================================================
# Unconditionally define the preprocessor symbol WOLFSSL_USER_SETTINGS.
#------------------------------------------------------------------------------
AC_DEFINE([WOLFSSL_USER_SETTINGS])


# Set flags.
#==============================================================================
# Require c++20 for all c++ products.
Expand Down
16 changes: 15 additions & 1 deletion include/bitcoin/network/async/asio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,24 @@ typedef asio::acceptor::reuse_address reuse_address;
/// connect
typedef tcp::socket socket;
typedef std::shared_ptr<socket> socket_ptr;

constexpr auto max_connections =
boost::asio::socket_base::max_listen_connections;

/// ssl
namespace ssl {

typedef boost::asio::ssl::context context;
typedef boost::asio::ssl::stream<asio::socket> socket;

// Just testing out the ssl socket compile.
inline void foobar() THROWS
{
io_context my_io_context{};
context my_ssl_context{ context::tlsv12_server };
socket my_ssl_socket{ my_io_context, my_ssl_context };
}

} // namespace ssl
} // namespace asio
} // namespace network
} // namespace libbitcoin
Expand Down
7 changes: 7 additions & 0 deletions include/bitcoin/network/boost.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@

#include <bitcoin/network/version.hpp>

// See <boost/asio/ssl/detail/openssl_types.hpp> for wolf/openssl includes.
#define BOOST_ASIO_USE_WOLFSSL
#define BOOST_ASIO_NO_DEPRECATED

// The /ssl/openssl/ directory is provided for direct ssl import by boost,
// which is required because <boost/asio/ssl.hpp> is included.
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/bimap.hpp>
#include <boost/bimap/set_of.hpp>
#include <boost/bimap/multiset_of.hpp>
Expand Down
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/conf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_CONF_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_CONF_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/conf.h>.
#include <wolfssl/openssl/conf.h>

#endif
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/dh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_DH_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_DH_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/dh.h>.
#include <wolfssl/openssl/dh.h>

#endif
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/err.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_ERR_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_ERR_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/err.h>.
#include <wolfssl/openssl/err.h>

#endif
26 changes: 26 additions & 0 deletions include/bitcoin/ssl/openssl/openssl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_OPENSSL_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_OPENSSL_H

// This directory is defined by libbitcoin to provide the expected path for
// boost::asio to #include the contained headers. Each header forwards to:
// #include <wolfssl/openssl/*.h>

#endif
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/rsa.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_RSA_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_RSA_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/rsa.h>.
#include <wolfssl/openssl/rsa.h>

#endif
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/ssl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_SSL_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_SSL_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/ssl.h>.
#include <wolfssl/openssl/ssl.h>

#endif
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/x509.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_X509_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_X509_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/x509.h>.
#include <wolfssl/openssl/x509.h>

#endif
25 changes: 25 additions & 0 deletions include/bitcoin/ssl/openssl/x509v3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_OPENSSL_X509V3_H
#define LIBBITCOIN_NETWORK_SSL_OPENSSL_X509V3_H

// Forward <boost/asio/ssl/detail/openssl_types.hpp> load of <openssl/x509v3.h>.
#include <wolfssl/openssl/x509v3.h>

#endif
26 changes: 26 additions & 0 deletions include/bitcoin/ssl/wolfcrypt/wolfcrypt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_WOLFCRYPT_WOLFCRYPT_H
#define LIBBITCOIN_NETWORK_SSL_WOLFCRYPT_WOLFCRYPT_H

// This directory is defined by libbitcoin to provide the expected path so that
// wolfssl sources may remain unmodified and specify:
// #include <wolfcrypt/src/misc.c>

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions include/bitcoin/ssl/wolfssl/options.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Copyright (c) 2011-2025 libbitcoin developers (see AUTHORS)
*
* This file is part of libbitcoin.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBBITCOIN_NETWORK_SSL_WOLFSSL_OPTIONS_H
#define LIBBITCOIN_NETWORK_SSL_WOLFSSL_OPTIONS_H

// This ensures boost sees all configuration, but probably not used.
#include <wolfssl/wolfcrypt/user_settings.h>

// Boost ASIO pulls in this file when BOOST_ASIO_USE_WOLFSSL is defined.
////#if defined(BOOST_ASIO_USE_WOLFSSL)
//// #include <wolfssl/options.h>
////#endif

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading