From 838b58bc50faef66d4b6897dc7cc6ef304bc7b99 Mon Sep 17 00:00:00 2001 From: Kasper Laudrup Date: Fri, 2 Feb 2024 19:37:14 +0100 Subject: [PATCH] Move library out of boost namespace This library is now called asio.wintls instead of boost.wintls as it no longer depends on boost. Since this library does not require boost remove the boost namespace and simply use the wintls namespace. Update the documentation to reflect that change and refer to asio instead of boost asio where it makes most sense. --- CMakeLists.txt | 4 +- README.md | 53 +++++---- doc/CMakeLists.txt | 6 +- doc/classes.rst | 4 +- doc/conf.py | 6 +- doc/enumerations.rst | 6 +- doc/functions.rst | 8 +- doc/index.rst | 19 +-- doc/static/{boost-wintls.css => wintls.css} | 0 doc/type_aliases.rst | 2 +- doc/usage.rst | 14 +-- examples/CMakeLists.txt | 8 +- examples/async_https_client.cpp | 8 +- examples/certificate.hpp | 6 +- examples/echo_client.cpp | 24 ++-- examples/echo_server.cpp | 44 +++---- examples/https_client.cpp | 8 +- include/boost/wintls.hpp | 21 ---- include/wintls.hpp | 21 ++++ include/{boost => }/wintls/certificate.hpp | 18 ++- include/{boost => }/wintls/context.hpp | 14 +-- include/{boost => }/wintls/detail/assert.hpp | 6 +- .../wintls/detail/async_handshake.hpp | 16 ++- .../{boost => }/wintls/detail/async_read.hpp | 14 +-- .../wintls/detail/async_shutdown.hpp | 14 +-- .../{boost => }/wintls/detail/async_write.hpp | 14 +-- include/{boost => }/wintls/detail/config.hpp | 8 +- .../wintls/detail/context_certificates.hpp | 14 +-- .../wintls/detail/context_flags.hpp | 8 +- .../{boost => }/wintls/detail/coroutine.hpp | 8 +- .../wintls/detail/decrypt_buffers.hpp | 10 +- .../wintls/detail/decrypted_data_buffer.hpp | 10 +- .../wintls/detail/encrypt_buffers.hpp | 14 +-- include/{boost => }/wintls/detail/error.hpp | 6 +- .../wintls/detail/handshake_input_buffers.hpp | 10 +- .../detail/handshake_output_buffers.hpp | 10 +- .../wintls/detail/shutdown_buffers.hpp | 10 +- .../wintls/detail/sspi_buffer_sequence.hpp | 12 +- .../wintls/detail/sspi_context_buffer.hpp | 12 +- .../wintls/detail/sspi_decrypt.hpp | 18 ++- .../wintls/detail/sspi_encrypt.hpp | 14 +-- .../wintls/detail/sspi_functions.hpp | 12 +- .../wintls/detail/sspi_handshake.hpp | 26 ++--- .../wintls/detail/sspi_sec_handle.hpp | 10 +- .../wintls/detail/sspi_shutdown.hpp | 20 ++-- .../{boost => }/wintls/detail/sspi_stream.hpp | 18 ++- .../{boost => }/wintls/detail/sspi_types.hpp | 18 +-- .../wintls/detail/win32_crypto.hpp | 12 +- include/{boost => }/wintls/error.hpp | 14 +-- include/{boost => }/wintls/file_format.hpp | 8 +- include/{boost => }/wintls/handshake_type.hpp | 8 +- include/{boost => }/wintls/method.hpp | 10 +- include/{boost => }/wintls/stream.hpp | 24 ++-- test/CMakeLists.txt | 2 +- test/asio_ssl_client_stream.hpp | 6 +- test/asio_ssl_server_stream.hpp | 6 +- test/async_echo_client.hpp | 6 +- test/async_echo_server.hpp | 6 +- test/certificate.hpp | 8 +- test/certificate_test.cpp | 58 ++++----- test/decrypted_data_buffer_test.cpp | 4 +- test/echo_client.hpp | 6 +- test/echo_server.hpp | 6 +- test/echo_test.cpp | 2 +- test/error_test.cpp | 6 +- test/handshake_test.cpp | 110 +++++++++--------- test/main.cpp | 8 +- test/ocsp_responder.hpp | 6 +- test/sspi_buffer_sequence_test.cpp | 10 +- test/stream_test.cpp | 36 +++--- test/test_stream/allocator.hpp | 8 +- test/test_stream/config.hpp | 6 +- test/test_stream/empty_value.hpp | 18 ++- test/test_stream/error.hpp | 8 +- test/test_stream/fail_count.hpp | 8 +- test/test_stream/flat_buffer.hpp | 16 ++- test/test_stream/impl/error.hpp | 12 +- test/test_stream/impl/error.ipp | 12 +- test/test_stream/impl/fail_count.ipp | 8 +- test/test_stream/impl/flat_buffer.hpp | 8 +- test/test_stream/impl/is_invocable.hpp | 8 +- test/test_stream/impl/service_base.hpp | 8 +- test/test_stream/impl/stream.hpp | 12 +- test/test_stream/impl/stream.ipp | 8 +- test/test_stream/role.hpp | 8 +- test/test_stream/stream.hpp | 16 ++- test/tls_record.cpp | 2 +- test/tls_record.hpp | 6 +- test/unittest.hpp | 12 +- test/wintls_client_stream.hpp | 28 ++--- test/wintls_server_stream.hpp | 26 ++--- 91 files changed, 573 insertions(+), 653 deletions(-) rename doc/static/{boost-wintls.css => wintls.css} (100%) delete mode 100644 include/boost/wintls.hpp create mode 100644 include/wintls.hpp rename include/{boost => }/wintls/certificate.hpp (96%) rename include/{boost => }/wintls/context.hpp (94%) rename include/{boost => }/wintls/detail/assert.hpp (80%) rename include/{boost => }/wintls/detail/async_handshake.hpp (90%) rename include/{boost => }/wintls/detail/async_read.hpp (85%) rename include/{boost => }/wintls/detail/async_shutdown.hpp (82%) rename include/{boost => }/wintls/detail/async_write.hpp (79%) rename include/{boost => }/wintls/detail/config.hpp (90%) rename include/{boost => }/wintls/detail/context_certificates.hpp (94%) rename include/{boost => }/wintls/detail/context_flags.hpp (88%) rename include/{boost => }/wintls/detail/coroutine.hpp (76%) rename include/{boost => }/wintls/detail/decrypt_buffers.hpp (70%) rename include/{boost => }/wintls/detail/decrypted_data_buffer.hpp (81%) rename include/{boost => }/wintls/detail/encrypt_buffers.hpp (84%) rename include/{boost => }/wintls/detail/error.hpp (88%) rename include/{boost => }/wintls/detail/handshake_input_buffers.hpp (67%) rename include/{boost => }/wintls/detail/handshake_output_buffers.hpp (65%) rename include/{boost => }/wintls/detail/shutdown_buffers.hpp (73%) rename include/{boost => }/wintls/detail/sspi_buffer_sequence.hpp (86%) rename include/{boost => }/wintls/detail/sspi_context_buffer.hpp (81%) rename include/{boost => }/wintls/detail/sspi_decrypt.hpp (87%) rename include/{boost => }/wintls/detail/sspi_encrypt.hpp (76%) rename include/{boost => }/wintls/detail/sspi_functions.hpp (95%) rename include/{boost => }/wintls/detail/sspi_handshake.hpp (95%) rename include/{boost => }/wintls/detail/sspi_sec_handle.hpp (81%) rename include/{boost => }/wintls/detail/sspi_shutdown.hpp (81%) rename include/{boost => }/wintls/detail/sspi_stream.hpp (65%) rename include/{boost => }/wintls/detail/sspi_types.hpp (53%) rename include/{boost => }/wintls/detail/win32_crypto.hpp (89%) rename include/{boost => }/wintls/error.hpp (63%) rename include/{boost => }/wintls/file_format.hpp (71%) rename include/{boost => }/wintls/handshake_type.hpp (73%) rename include/{boost => }/wintls/method.hpp (92%) rename include/{boost => }/wintls/stream.hpp (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b8983f1..4e160b38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,9 +6,9 @@ include(VersionFromGit) version_from_git() -project(boost-wintls +project(wintls VERSION ${VERSION} - DESCRIPTION "Native Windows TLS stream for Boost.Asio" + DESCRIPTION "Native Windows TLS stream for Asio" HOMEPAGE_URL "https://wintls.dev/" LANGUAGES CXX ) diff --git a/README.md b/README.md index 98f15ba8..9116ead9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -Boost.Wintls Logo +Asio.Wintls Logo -# Native Windows TLS stream for Boost.Asio +# Native Windows TLS stream for Asio - Support Ukraine + Support Ukraine [wintls.dev](https://wintls.dev/) @@ -25,9 +25,10 @@ Build | Coverage | Coverity Analysis | ## Introduction Implements a TLS stream wrapper for use with +[Asio](https://think-async.com/Asio/) or [Boost.Asio](https://www.boost.org/doc/libs/release/doc/html/boost_asio.html) similar to -[Boost.Asio.SSL](https://www.boost.org/doc/libs/release/doc/html/boost_asio/overview/ssl.html) +[Asio.SSL](https://www.boost.org/doc/libs/release/doc/html/boost_asio/overview/ssl.html) but using native Windows API ([SSPI/Schannel](https://docs.microsoft.com/en-us/windows-server/security/tls/tls-ssl-schannel-ssp-overview)) functionality instead of OpenSSL for providing TLS encrypted stream functionality. @@ -36,13 +37,18 @@ functionality instead of OpenSSL for providing TLS encrypted stream functionalit As this library uses Windows specific libraries, it is only supported on Microsoft Windows although it is intended to be used alongside the -existing Boost.Asio.SSL implementation. +existing Asio.SSL implementation. -[Boost](https://www.boost.org) is required. Currently tested with -Boost 1.80 to 1.83 but most newer versions ought to work. +Code using this library must target at least +[Windows 7 (NT 6.1)](https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers). -A working C++ compiler supporting the C++14 standard is required. -Currently tested compilers are: +Either [Asio](https://think-async.com/Asio/) or the [Boost +libraries](https://www.boost.org) are required. Currently tested with +Boost 1.80 to 1.83 and Asio 1.28 to 1.29 but at least most newer +versions ought to work. + +A working C++ compiler supporting at least the C++14 standard is +required. Currently tested compilers are: - MSVC for Visual Studio 2022 - MSVC for Visual Studio 2019 @@ -51,10 +57,10 @@ Currently tested compilers are: ## Building -Boost.Wintls is header-only. To use it just add the necessary `#include` line +Asio.Wintls is header-only. To use it just add the necessary `#include` line to your source files, like this: ```C++ -#include +#include ``` CMake may be used to generate a Visual Studio solution for building @@ -71,21 +77,26 @@ If the provided CMake scripts are not used and you are using the MinGW64 compiler the `crypt32`, `secur32`, `ws2_32` and `wsock32` libraries needs to be linked with your libraries/executables. +Currently this library expects the Boost libraries to be available +(i.e. found in the include path). If standalone Asio is to be used +instead, define `#WINTLS_USE_STANDALONE_ASIO` before including +`wintls.hpp` and make sure that Asio is found in the include path +instead. ## Quickstart -Similar to Boost.Asio.SSL a -[boost::wintls::context](https://laudrup.github.io/boost-wintls/classes.html#context) +Similar to Asio.SSL a +[wintls::context](https://wintls.dev/classes.html#context) is required to hold certificates and options to use for the TLS stream: ```C++ // Set up context to use the systems default TLS methods (e.g. TLS 1.2) - boost::wintls::context ctx{boost::wintls::method::system_default}; + wintls::context ctx{wintls::method::system_default}; ``` Using that context a -[boost::wintls::stream](https://laudrup.github.io/boost-wintls/classes.html#stream) +[wintls::stream](https://wintls.dev/classes.html#stream) can be constructed using a [boost::asio::io_context](https://www.boost.org/doc/libs/release/doc/html/boost_asio/reference/io_context.html) specifying the underlying stream type (most often a TCP stream): @@ -93,7 +104,7 @@ specifying the underlying stream type (most often a TCP stream): ```C++ boost::asio::io_context ioc; - boost::wintls::stream stream(ioc, ctx); + wintls::stream stream(ioc, ctx); ``` Although that is all that is required to construct a stream that fully @@ -106,18 +117,20 @@ to be performed and most likely, certificates and keys has to be handled as well. For details on how to do that, please see the -[documentation](https://laudrup.github.io/boost-wintls) and the -[examples](https://laudrup.github.io/boost-wintls/examples.html) +[documentation](https://wintls.dev) and the +[examples](https://wintls.dev/examples.html) ## Documentation -Documentation is available [here](https://laudrup.github.io/boost-wintls). +Documentation is available [here](https://wintls.dev/). ## Contributing Pull requests, issue reporting etc. are very much welcome. -If you use this library and find it useful, I would love to know. You should also consider donating to one of the funds that help victims of the war in Ukraine: +If you use this library and find it useful, I would love to know. You +should also consider donating to one of the funds that help victims of +the war in Ukraine: [https://www.stopputin.net/](https://www.stopputin.net/) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 2bc52290..5df0468f 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,7 +1,7 @@ find_package(Doxygen REQUIRED) find_package(Sphinx REQUIRED) -set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/include/boost/wintls/) +set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/include/wintls/) set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen) set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/index.xml) set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) @@ -50,12 +50,12 @@ set(SPHINX_SOURCE_FILES add_custom_command(OUTPUT ${SPHINX_INDEX_FILE} COMMAND ${SPHINX_EXECUTABLE} -b html - -D breathe_projects.boost-wintls=${DOXYGEN_OUTPUT_DIR} + -D breathe_projects.wintls=${DOXYGEN_OUTPUT_DIR} -D version=${PROJECT_VERSION} ${SPHINX_SOURCE} ${SPHINX_BUILD} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/static/boost-wintls.css + ${CMAKE_CURRENT_SOURCE_DIR}/static/wintls.css ${CMAKE_CURRENT_SOURCE_DIR}/templates/layout.html ${CMAKE_CURRENT_SOURCE_DIR}/templates/navbar.html ${CMAKE_CURRENT_SOURCE_DIR}/extensions/toctree_elements.py diff --git a/doc/classes.rst b/doc/classes.rst index 9fbef46e..519a00e6 100644 --- a/doc/classes.rst +++ b/doc/classes.rst @@ -3,10 +3,10 @@ Classes context ------- -.. doxygenclass:: boost::wintls::context +.. doxygenclass:: wintls::context :members: stream ------ -.. doxygenclass:: boost::wintls::stream +.. doxygenclass:: wintls::stream :members: diff --git a/doc/conf.py b/doc/conf.py index ccc7d834..94d6a607 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -4,7 +4,7 @@ sys.path.append(os.path.abspath("./extensions")) -project = 'boost-wintls' +project = 'wintls' copyright = '2021, Kasper Laudrup' author = 'Kasper Laudrup' @@ -24,7 +24,7 @@ html_static_path = ['static'] -html_title = 'boost.wintls' +html_title = 'asio.wintls' html_css_files = [ project + '.css', @@ -40,4 +40,4 @@ html_last_updated_fmt = '' -breathe_default_project = 'boost-wintls' +breathe_default_project = 'wintls' diff --git a/doc/enumerations.rst b/doc/enumerations.rst index 57d97285..d60e1b64 100644 --- a/doc/enumerations.rst +++ b/doc/enumerations.rst @@ -3,12 +3,12 @@ Enumerations handshake_type -------------- -.. doxygenenum:: boost::wintls::handshake_type +.. doxygenenum:: wintls::handshake_type method ------ -.. doxygenenum:: boost::wintls::method +.. doxygenenum:: wintls::method file_format ----------- -.. doxygenenum:: boost::wintls::file_format +.. doxygenenum:: wintls::file_format diff --git a/doc/functions.rst b/doc/functions.rst index cd2eb085..8b977288 100644 --- a/doc/functions.rst +++ b/doc/functions.rst @@ -3,13 +3,13 @@ Functions x509_to_cert_context -------------------- -.. doxygenfunction:: boost::wintls::x509_to_cert_context(const net::const_buffer &x509, file_format format) -.. doxygenfunction:: boost::wintls::x509_to_cert_context(const net::const_buffer &x509, file_format format, boost::system::error_code& ec) +.. doxygenfunction:: wintls::x509_to_cert_context(const net::const_buffer &x509, file_format format) +.. doxygenfunction:: wintls::x509_to_cert_context(const net::const_buffer &x509, file_format format, boost::system::error_code& ec) import_private_key ------------------ -.. doxygenfunction:: boost::wintls::import_private_key(const net::const_buffer& private_key, file_format format, const std::string& name) -.. doxygenfunction:: boost::wintls::import_private_key(const net::const_buffer& private_key, file_format format, const std::string& name, boost::system::error_code& ec) +.. doxygenfunction:: wintls::import_private_key(const net::const_buffer& private_key, file_format format, const std::string& name) +.. doxygenfunction:: wintls::import_private_key(const net::const_buffer& private_key, file_format format, const std::string& name, boost::system::error_code& ec) delete_private_key ------------------ diff --git a/doc/index.rst b/doc/index.rst index 694e2199..fef640dd 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,24 +1,24 @@ .. figure:: logo.jpg - :alt: Boost.Wintls logo + :alt: Wintls logo Overview ======== -This library implements TLS stream functionality for `boost::asio`_ -using native Windows `SSPI/Schannel`_ implementation. +This library implements TLS stream functionality for `asio`_ or +`boost::asio`_ using native Windows `SSPI/Schannel`_ implementation. To the extend possible it provides the same functionality as the -`OpenSSL`_ implementation used by `boost::asio`_ and provides some -helper :ref:`functions` for converting and managing certificates and keys in -standard formats used by `OpenSSL`_. +`OpenSSL`_ implementation used by `asio`_ and provides some helper +:ref:`functions` for converting and managing certificates +and keys in standard formats used by `OpenSSL`_. Released under the `Boost Software License`_. Source code available on `GitHub`_. Motivation ---------- -`boost::asio`_ uses `OpenSSL`_ for TLS encryption which has a few -downsides when used on Windows: +`asio`_ uses `OpenSSL`_ for TLS encryption which has a few downsides +when used on Windows: * Requires maintaining a separate copy of trusted certificate authorities although the operating system already ships with and @@ -32,7 +32,7 @@ downsides when used on Windows: * Installing third party libraries and software in general on Windows is often a complicated process since no central packaging system exists, so any security updates to `OpenSSL`_ would have to be - maintained by the software using the `boost::asio`_ library. + maintained by the software using the `asio`_ library. This library avoids these issues by using the native Windows TLS implementation (`SSPI/SChannel`_) which uses the methods for storing @@ -48,6 +48,7 @@ Contents API +.. _asio: https://think-async.com/Asio/ .. _SSPI/Schannel: https://docs.microsoft.com/en-us/windows-server/security/tls/tls-ssl-schannel-ssp-overview/ .. _OpenSSL: https://www.openssl.org/ .. _boost::asio: https://www.boost.org/doc/libs/release/doc/html/boost_asio.html diff --git a/doc/static/boost-wintls.css b/doc/static/wintls.css similarity index 100% rename from doc/static/boost-wintls.css rename to doc/static/wintls.css diff --git a/doc/type_aliases.rst b/doc/type_aliases.rst index f920a365..e7c24210 100644 --- a/doc/type_aliases.rst +++ b/doc/type_aliases.rst @@ -3,6 +3,6 @@ Type aliases cert_context_ptr ---------------- -.. doxygentypedef:: boost::wintls::cert_context_ptr +.. doxygentypedef:: wintls::cert_context_ptr .. _CERT_CONTEXT: https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/ns-wincrypt-cert_context diff --git a/doc/usage.rst b/doc/usage.rst index 4b6367a8..d5ea52dd 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -1,4 +1,4 @@ -.. cpp:namespace:: boost::wintls +.. cpp:namespace:: wintls Usage ===== @@ -21,9 +21,9 @@ to support. To construct a context using the operating system default methods: :: - #include + #include - boost::wintls::context ctx(boost::wintls::method::system_default); + wintls::context ctx(wintls::method::system_default); While that is all which is required to construct a context for client-side operations, most users would at least want to enable @@ -37,9 +37,9 @@ provided by the operating system and verify the server certificate, would look something like: :: - #include + #include - boost::wintls::context ctx(boost::wintls::method::system_default); + wintls::context ctx(wintls::method::system_default); ctx.use_default_certificates(true); ctx.verify_server_certificate(true); @@ -64,7 +64,7 @@ Assuming an underlying TCP stream, once the context has been setup a :class:`stream` can be constructed like: :: - boost::wintls::stream my_stream(my_io_service, ctx); + wintls::stream my_stream(my_io_service, ctx); In the case of a TCP stream, the underlying stream needs to be connected before it can be used. To access the underlying stream use @@ -87,7 +87,7 @@ like: :: strean.set_server_hostname("wintls.dev"); - stream.handshake(boost::wintls::handshake_type::client); + stream.handshake(wintls::handshake_type::client); Similar to the `boost::asio`_ functions, this library provides overloads for accepting a `boost::system`_::error_codes. diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index ef79b549..3bc3f439 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,11 +2,11 @@ add_executable(echo_client echo_client.cpp) add_executable(echo_server echo_server.cpp) target_link_libraries(echo_server PRIVATE - boost-wintls + wintls ) target_link_libraries(echo_client PRIVATE - boost-wintls + wintls ) if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") @@ -19,11 +19,11 @@ if(NOT ENABLE_WINTLS_STANDALONE_ASIO) add_executable(async_https_client async_https_client.cpp) target_link_libraries(https_client PRIVATE - boost-wintls + wintls ) target_link_libraries(async_https_client PRIVATE - boost-wintls + wintls ) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") diff --git a/examples/async_https_client.cpp b/examples/async_https_client.cpp index b203c36e..eacb8e0f 100644 --- a/examples/async_https_client.cpp +++ b/examples/async_https_client.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include @@ -22,7 +22,7 @@ namespace beast = boost::beast; // from namespace http = beast::http; // from namespace net = boost::asio; // from -namespace ssl = boost::wintls; // from +namespace ssl = wintls; // from using tcp = boost::asio::ip::tcp; // from @@ -82,7 +82,7 @@ class session : public std::enable_shared_from_this { return fail(ec, "connect"); // Perform the SSL handshake - stream_.async_handshake(boost::wintls::handshake_type::client, beast::bind_front_handler(&session::on_handshake, shared_from_this())); + stream_.async_handshake(wintls::handshake_type::client, beast::bind_front_handler(&session::on_handshake, shared_from_this())); } void on_handshake(beast::error_code ec) { @@ -169,7 +169,7 @@ int main(int argc, char** argv) { net::io_context ioc; // The SSL context is required, and holds certificates - ssl::context ctx{boost::wintls::method::system_default}; + ssl::context ctx{wintls::method::system_default}; // Use the operating systems default certificates for verification ctx.use_default_certificates(true); diff --git a/examples/certificate.hpp b/examples/certificate.hpp index 430e0a4e..edc04d7d 100644 --- a/examples/certificate.hpp +++ b/examples/certificate.hpp @@ -7,8 +7,8 @@ #include -#ifndef BOOST_WINTLS_EXAMPLES_CERTIFICATE_HPP -#define BOOST_WINTLS_EXAMPLES_CERTIFICATE_HPP +#ifndef WINTLS_EXAMPLES_CERTIFICATE_HPP +#define WINTLS_EXAMPLES_CERTIFICATE_HPP const std::string x509_certificate = "-----BEGIN CERTIFICATE-----\n" @@ -63,4 +63,4 @@ const std::string rsa_key = "hSWgRxNM62fdbmxZ+JrxHCE=\n" "-----END PRIVATE KEY-----\n"; -#endif // BOOST_WINTLS_EXAMPLES_CERTIFICATE_HPP +#endif // WINTLS_EXAMPLES_CERTIFICATE_HPP diff --git a/examples/echo_client.cpp b/examples/echo_client.cpp index f616fd9b..7b062112 100644 --- a/examples/echo_client.cpp +++ b/examples/echo_client.cpp @@ -7,7 +7,7 @@ #include "certificate.hpp" -#include +#include #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -33,7 +33,7 @@ constexpr std::size_t max_length = 1024; class client { public: client(net::io_context& io_context, - boost::wintls::context& context, + wintls::context& context, const tcp::resolver::results_type& endpoints) : stream_(io_context, context) { connect(endpoints); @@ -42,7 +42,7 @@ class client { private: void connect(const tcp::resolver::results_type& endpoints) { net::async_connect( - stream_.next_layer(), endpoints, [this](const boost::wintls::error_code& error, + stream_.next_layer(), endpoints, [this](const wintls::error_code& error, const tcp::endpoint& /*endpoint*/) { if (!error) { handshake(); @@ -53,8 +53,8 @@ class client { } void handshake() { - stream_.async_handshake(boost::wintls::handshake_type::client, - [this](const boost::wintls::error_code& error) { + stream_.async_handshake(wintls::handshake_type::client, + [this](const wintls::error_code& error) { if (!error) { send_request(); } else { @@ -70,7 +70,7 @@ class client { net::async_write( stream_, net::buffer(request_, request_length), - [this](const boost::wintls::error_code& error, std::size_t length) { + [this](const wintls::error_code& error, std::size_t length) { if (!error) { receive_response(length); } else { @@ -82,12 +82,12 @@ class client { void receive_response(std::size_t size) { net::async_read( stream_, net::buffer(reply_, size), - [this](const boost::wintls::error_code& ec, std::size_t length) { + [this](const wintls::error_code& ec, std::size_t length) { if (!ec) { std::cout << "Reply: "; std::cout.write(reply_, static_cast(length)); std::cout << "\n"; - stream_.async_shutdown([](const boost::wintls::error_code& error) { + stream_.async_shutdown([](const wintls::error_code& error) { if(error) { std::cerr << "Shutdown failed: " << error.message() << "\n"; } @@ -98,7 +98,7 @@ class client { }); } - boost::wintls::stream stream_; + wintls::stream stream_; char request_[max_length]; char reply_[max_length]; }; @@ -115,11 +115,11 @@ int main(int argc, char* argv[]) { tcp::resolver resolver(io_context); auto endpoints = resolver.resolve(argv[1], argv[2]); - boost::wintls::context ctx(boost::wintls::method::system_default); + wintls::context ctx(wintls::method::system_default); // Convert X509 PEM bytes to Windows CERT_CONTEXT - auto certificate = boost::wintls::x509_to_cert_context(net::buffer(x509_certificate), - boost::wintls::file_format::pem); + auto certificate = wintls::x509_to_cert_context(net::buffer(x509_certificate), + wintls::file_format::pem); // Add certifcate as a trusted certifcate authority and verify it on handshake ctx.add_certificate_authority(certificate.get()); diff --git a/examples/echo_server.cpp b/examples/echo_server.cpp index 559ded1e..8c725dc7 100644 --- a/examples/echo_server.cpp +++ b/examples/echo_server.cpp @@ -7,7 +7,7 @@ #include "certificate.hpp" -#include +#include #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -29,7 +29,7 @@ using net::ip::tcp; class session : public std::enable_shared_from_this { public: - session(boost::wintls::stream stream) + session(wintls::stream stream) : stream_(std::move(stream)) { } @@ -40,8 +40,8 @@ class session : public std::enable_shared_from_this { private: void do_handshake() { auto self(shared_from_this()); - stream_.async_handshake(boost::wintls::handshake_type::server, - [this, self](const boost::wintls::error_code& ec) { + stream_.async_handshake(wintls::handshake_type::server, + [this, self](const wintls::error_code& ec) { if (!ec) { do_read(); } else { @@ -53,7 +53,7 @@ class session : public std::enable_shared_from_this { void do_read() { auto self(shared_from_this()); stream_.async_read_some(net::buffer(data_), - [this, self](const boost::wintls::error_code& ec, std::size_t length) { + [this, self](const wintls::error_code& ec, std::size_t length) { if (!ec) { do_write(length); } else { @@ -67,7 +67,7 @@ class session : public std::enable_shared_from_this { void do_write(std::size_t length) { auto self(shared_from_this()); net::async_write(stream_, net::buffer(data_, length), - [this, self](const boost::wintls::error_code& ec, std::size_t /*length*/) { + [this, self](const wintls::error_code& ec, std::size_t /*length*/) { if (!ec) { do_read(); } else { @@ -76,7 +76,7 @@ class session : public std::enable_shared_from_this { }); } - boost::wintls::stream stream_; + wintls::stream stream_; char data_[1024]; }; @@ -84,28 +84,28 @@ class server { public: server(net::io_context& io_context, unsigned short port) : acceptor_(io_context, tcp::endpoint(tcp::v4(), port)) - , context_(boost::wintls::method::system_default) + , context_(wintls::method::system_default) , private_key_name_("wintls-echo-server-example") { // Convert X509 PEM bytes to Windows CERT_CONTEXT - auto certificate = boost::wintls::x509_to_cert_context(net::buffer(x509_certificate), - boost::wintls::file_format::pem); + auto certificate = wintls::x509_to_cert_context(net::buffer(x509_certificate), + wintls::file_format::pem); // Import RSA private key into the default cryptographic provider - boost::wintls::error_code ec; - boost::wintls::import_private_key(net::buffer(rsa_key), - boost::wintls::file_format::pem, - private_key_name_, - ec); + wintls::error_code ec; + wintls::import_private_key(net::buffer(rsa_key), + wintls::file_format::pem, + private_key_name_, + ec); // If the key already exists, assume it's the one already imported // and ignore that error if (ec && ec.value() != NTE_EXISTS) { - throw boost::wintls::system_error(ec); + throw wintls::system_error(ec); } // Use the imported private key for the certificate - boost::wintls::assign_private_key(certificate.get(), private_key_name_); + wintls::assign_private_key(certificate.get(), private_key_name_); // Use the certificate for encrypting TLS messages context_.use_certificate(certificate.get()); @@ -117,15 +117,15 @@ class server { // Remove the imported private key. Most real applications // probably only want to import the key once and most likely not // in the server code. This is just for demonstration purposesq. - boost::wintls::error_code ec; - boost::wintls::delete_private_key(private_key_name_, ec); + wintls::error_code ec; + wintls::delete_private_key(private_key_name_, ec); } private: void do_accept() { - acceptor_.async_accept([this](const boost::wintls::error_code& ec, tcp::socket socket) { + acceptor_.async_accept([this](const wintls::error_code& ec, tcp::socket socket) { if (!ec) { - std::make_shared(boost::wintls::stream(std::move(socket), context_))->start(); + std::make_shared(wintls::stream(std::move(socket), context_))->start(); } else { std::cerr << "Read failed: " << ec.message() << "\n"; } @@ -135,7 +135,7 @@ class server { } tcp::acceptor acceptor_; - boost::wintls::context context_; + wintls::context context_; std::string private_key_name_; }; diff --git a/examples/https_client.cpp b/examples/https_client.cpp index e77ec5c2..b4c12993 100644 --- a/examples/https_client.cpp +++ b/examples/https_client.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include @@ -18,7 +18,7 @@ namespace beast = boost::beast; // from namespace http = beast::http; // from namespace net = boost::asio; // from -namespace ssl = boost::wintls; // from +namespace ssl = wintls; // from using tcp = boost::asio::ip::tcp; // from @@ -58,7 +58,7 @@ int main(int argc, char** argv) { net::io_context ioc; // The SSL context is required, and holds certificates - ssl::context ctx{boost::wintls::method::system_default}; + ssl::context ctx{wintls::method::system_default}; // Use the operating systems default certificates for verification ctx.use_default_certificates(true); @@ -83,7 +83,7 @@ int main(int argc, char** argv) { beast::get_lowest_layer(stream).connect(results); // Perform the TLS handshake - stream.handshake(boost::wintls::handshake_type::client); + stream.handshake(wintls::handshake_type::client); // Set up an HTTP GET request message http::request req{http::verb::get, path, version}; diff --git a/include/boost/wintls.hpp b/include/boost/wintls.hpp deleted file mode 100644 index 1d5821b1..00000000 --- a/include/boost/wintls.hpp +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) 2020 Kasper Laudrup (laudrup at stacktrace dot dk) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_WINTLS_HPP -#define BOOST_WINTLS_HPP - -#include - -#include -#include -#include -#include -#include -#include -#include - -#endif // BOOST_WINTLS_HPP diff --git a/include/wintls.hpp b/include/wintls.hpp new file mode 100644 index 00000000..6a054309 --- /dev/null +++ b/include/wintls.hpp @@ -0,0 +1,21 @@ +// +// Copyright (c) 2020 Kasper Laudrup (laudrup at stacktrace dot dk) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#ifndef WINTLS_HPP +#define WINTLS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include + +#endif // WINTLS_HPP diff --git a/include/boost/wintls/certificate.hpp b/include/wintls/certificate.hpp similarity index 96% rename from include/boost/wintls/certificate.hpp rename to include/wintls/certificate.hpp index 1d4b8160..358036b9 100644 --- a/include/boost/wintls/certificate.hpp +++ b/include/wintls/certificate.hpp @@ -5,19 +5,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_CERTIFICATE_HPP -#define BOOST_WINTLS_CERTIFICATE_HPP +#ifndef WINTLS_CERTIFICATE_HPP +#define WINTLS_CERTIFICATE_HPP -#include -#include +#include +#include -#include -#include -#include +#include +#include +#include #include -namespace boost { namespace wintls { namespace detail { @@ -283,6 +282,5 @@ inline void assign_private_key(const CERT_CONTEXT* cert, const std::string& name } } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_CERTIFICATE_HPP +#endif // WINTLS_CERTIFICATE_HPP diff --git a/include/boost/wintls/context.hpp b/include/wintls/context.hpp similarity index 94% rename from include/boost/wintls/context.hpp rename to include/wintls/context.hpp index 1a41c4bf..9f61c1d1 100644 --- a/include/boost/wintls/context.hpp +++ b/include/wintls/context.hpp @@ -5,17 +5,16 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_CONTEXT_HPP -#define BOOST_WINTLS_CONTEXT_HPP +#ifndef WINTLS_CONTEXT_HPP +#define WINTLS_CONTEXT_HPP -#include +#include -#include -#include +#include +#include #include -namespace boost { namespace wintls { namespace detail { @@ -155,6 +154,5 @@ class context { }; } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_CONTEXT_HPP +#endif // WINTLS_CONTEXT_HPP diff --git a/include/boost/wintls/detail/assert.hpp b/include/wintls/detail/assert.hpp similarity index 80% rename from include/boost/wintls/detail/assert.hpp rename to include/wintls/detail/assert.hpp index 98cc54fd..dea3a241 100644 --- a/include/boost/wintls/detail/assert.hpp +++ b/include/wintls/detail/assert.hpp @@ -3,8 +3,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_ASSERT_HPP -#define BOOST_WINTLS_DETAIL_ASSERT_HPP +#ifndef WINTLS_DETAIL_ASSERT_HPP +#define WINTLS_DETAIL_ASSERT_HPP #include @@ -20,4 +20,4 @@ #define WINTLS_VERIFY_MSG(expr, msg) assert((expr) && (msg)) #endif // !NDEBUG -#endif // BOOST_WINTLS_DETAIL_ASSERT_HPP +#endif // WINTLS_DETAIL_ASSERT_HPP diff --git a/include/boost/wintls/detail/async_handshake.hpp b/include/wintls/detail/async_handshake.hpp similarity index 90% rename from include/boost/wintls/detail/async_handshake.hpp rename to include/wintls/detail/async_handshake.hpp index 98138724..cb43f1a0 100644 --- a/include/boost/wintls/detail/async_handshake.hpp +++ b/include/wintls/detail/async_handshake.hpp @@ -5,16 +5,15 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_ASYNC_HANDSHAKE_HPP -#define BOOST_WINTLS_DETAIL_ASYNC_HANDSHAKE_HPP +#ifndef WINTLS_DETAIL_ASYNC_HANDSHAKE_HPP +#define WINTLS_DETAIL_ASYNC_HANDSHAKE_HPP -#include +#include -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -132,6 +131,5 @@ struct async_handshake : net::coroutine { } // namespace detail } // namespace wintls -} // namespace boost -#endif //BOOST_WINTLS_DETAIL_ASYNC_HANDSHAKE_HPP +#endif // WINTLS_DETAIL_ASYNC_HANDSHAKE_HPP diff --git a/include/boost/wintls/detail/async_read.hpp b/include/wintls/detail/async_read.hpp similarity index 85% rename from include/boost/wintls/detail/async_read.hpp rename to include/wintls/detail/async_read.hpp index be79abc7..c4f8bfdd 100644 --- a/include/boost/wintls/detail/async_read.hpp +++ b/include/wintls/detail/async_read.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_ASYNC_READ_HPP -#define BOOST_WINTLS_DETAIL_ASYNC_READ_HPP +#ifndef WINTLS_DETAIL_ASYNC_READ_HPP +#define WINTLS_DETAIL_ASYNC_READ_HPP -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -72,6 +71,5 @@ struct async_read : net::coroutine { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_ASYNC_READ_HPP +#endif // WINTLS_DETAIL_ASYNC_READ_HPP diff --git a/include/boost/wintls/detail/async_shutdown.hpp b/include/wintls/detail/async_shutdown.hpp similarity index 82% rename from include/boost/wintls/detail/async_shutdown.hpp rename to include/wintls/detail/async_shutdown.hpp index a40f03ea..c093d344 100644 --- a/include/boost/wintls/detail/async_shutdown.hpp +++ b/include/wintls/detail/async_shutdown.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_ASYNC_SHUTDOWN_HPP -#define BOOST_WINTLS_DETAIL_ASYNC_SHUTDOWN_HPP +#ifndef WINTLS_DETAIL_ASYNC_SHUTDOWN_HPP +#define WINTLS_DETAIL_ASYNC_SHUTDOWN_HPP -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -67,6 +66,5 @@ struct async_shutdown : net::coroutine { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_ASYNC_SHUTDOWN_HPP +#endif // WINTLS_DETAIL_ASYNC_SHUTDOWN_HPP diff --git a/include/boost/wintls/detail/async_write.hpp b/include/wintls/detail/async_write.hpp similarity index 79% rename from include/boost/wintls/detail/async_write.hpp rename to include/wintls/detail/async_write.hpp index 9abe85fe..ed11a5d8 100644 --- a/include/boost/wintls/detail/async_write.hpp +++ b/include/wintls/detail/async_write.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_ASYNC_WRITE_HPP -#define BOOST_WINTLS_DETAIL_ASYNC_WRITE_HPP +#ifndef WINTLS_DETAIL_ASYNC_WRITE_HPP +#define WINTLS_DETAIL_ASYNC_WRITE_HPP -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -50,6 +49,5 @@ struct async_write : net::coroutine { } // detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_ASYNC_WRITE_HPP +#endif // WINTLS_DETAIL_ASYNC_WRITE_HPP diff --git a/include/boost/wintls/detail/config.hpp b/include/wintls/detail/config.hpp similarity index 90% rename from include/boost/wintls/detail/config.hpp rename to include/wintls/detail/config.hpp index e49e993c..ed0b144e 100644 --- a/include/boost/wintls/detail/config.hpp +++ b/include/wintls/detail/config.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_CONFIG_HPP -#define BOOST_WINTLS_DETAIL_CONFIG_HPP +#ifndef WINTLS_DETAIL_CONFIG_HPP +#define WINTLS_DETAIL_CONFIG_HPP #ifdef __clang__ #pragma clang diagnostic push @@ -36,7 +36,6 @@ #define WINTLS_UNREACHABLE_RETURN(x) __builtin_unreachable(); #endif // !_MSC_VER -namespace boost { namespace wintls { #ifdef WINTLS_USE_STANDALONE_ASIO namespace net = asio; @@ -53,6 +52,5 @@ constexpr auto system_category = boost::system::system_category; #endif // !WINTLS_USE_STANDALONE_ASIO } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_CONFIG_HPP +#endif // WINTLS_DETAIL_CONFIG_HPP diff --git a/include/boost/wintls/detail/context_certificates.hpp b/include/wintls/detail/context_certificates.hpp similarity index 94% rename from include/boost/wintls/detail/context_certificates.hpp rename to include/wintls/detail/context_certificates.hpp index 4f15fa6b..fe1e0c71 100644 --- a/include/boost/wintls/detail/context_certificates.hpp +++ b/include/wintls/detail/context_certificates.hpp @@ -5,20 +5,19 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_CONTEXT_CERTIFICATES_HPP -#define BOOST_WINTLS_DETAIL_CONTEXT_CERTIFICATES_HPP +#ifndef WINTLS_DETAIL_CONTEXT_CERTIFICATES_HPP +#define WINTLS_DETAIL_CONTEXT_CERTIFICATES_HPP -#include +#include -#include -#include +#include +#include #include #include #include #include -namespace boost { namespace wintls { namespace detail { @@ -175,6 +174,5 @@ class context_certificates { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_CONTEXT_CERTIFICATES_HPP +#endif // WINTLS_DETAIL_CONTEXT_CERTIFICATES_HPP diff --git a/include/boost/wintls/detail/context_flags.hpp b/include/wintls/detail/context_flags.hpp similarity index 88% rename from include/boost/wintls/detail/context_flags.hpp rename to include/wintls/detail/context_flags.hpp index 4c6e9346..1dd2d0d8 100644 --- a/include/boost/wintls/detail/context_flags.hpp +++ b/include/wintls/detail/context_flags.hpp @@ -5,10 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_CONTEXT_FLAGS_HPP -#define BOOST_WINTLS_DETAIL_CONTEXT_FLAGS_HPP +#ifndef WINTLS_DETAIL_CONTEXT_FLAGS_HPP +#define WINTLS_DETAIL_CONTEXT_FLAGS_HPP -namespace boost { namespace wintls { namespace detail { @@ -32,6 +31,5 @@ constexpr DWORD server_context_flags = } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_CONTEXT_FLAGS_HPP +#endif // WINTLS_DETAIL_CONTEXT_FLAGS_HPP diff --git a/include/boost/wintls/detail/coroutine.hpp b/include/wintls/detail/coroutine.hpp similarity index 76% rename from include/boost/wintls/detail/coroutine.hpp rename to include/wintls/detail/coroutine.hpp index ca1f2cc6..bf6741f7 100644 --- a/include/boost/wintls/detail/coroutine.hpp +++ b/include/wintls/detail/coroutine.hpp @@ -3,10 +3,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_COROUTINE_HPP -#define BOOST_WINTLS_DETAIL_COROUTINE_HPP +#ifndef WINTLS_DETAIL_COROUTINE_HPP +#define WINTLS_DETAIL_COROUTINE_HPP -#include +#include #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -18,4 +18,4 @@ #define WINTLS_ASIO_CORO_REENTER BOOST_ASIO_CORO_REENTER #endif // !WINTLS_USE_STANDALONE_ASIO -#endif // BOOST_WINTLS_DETAIL_COROUTINE_HPP +#endif // WINTLS_DETAIL_COROUTINE_HPP diff --git a/include/boost/wintls/detail/decrypt_buffers.hpp b/include/wintls/detail/decrypt_buffers.hpp similarity index 70% rename from include/boost/wintls/detail/decrypt_buffers.hpp rename to include/wintls/detail/decrypt_buffers.hpp index f15665f4..3900296f 100644 --- a/include/boost/wintls/detail/decrypt_buffers.hpp +++ b/include/wintls/detail/decrypt_buffers.hpp @@ -5,12 +5,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_DECRYPT_BUFFERS_HPP -#define BOOST_WINTLS_DETAIL_DECRYPT_BUFFERS_HPP +#ifndef WINTLS_DETAIL_DECRYPT_BUFFERS_HPP +#define WINTLS_DETAIL_DECRYPT_BUFFERS_HPP -#include +#include -namespace boost { namespace wintls { namespace detail { @@ -28,6 +27,5 @@ class decrypt_buffers : public sspi_buffer_sequence<4> { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_DECRYPT_BUFFERS_HPP +#endif // WINTLS_DETAIL_DECRYPT_BUFFERS_HPP diff --git a/include/boost/wintls/detail/decrypted_data_buffer.hpp b/include/wintls/detail/decrypted_data_buffer.hpp similarity index 81% rename from include/boost/wintls/detail/decrypted_data_buffer.hpp rename to include/wintls/detail/decrypted_data_buffer.hpp index 7018ea13..47e756d4 100644 --- a/include/boost/wintls/detail/decrypted_data_buffer.hpp +++ b/include/wintls/detail/decrypted_data_buffer.hpp @@ -5,16 +5,15 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_DECRYPTED_DATA_BUFFER_HPP -#define BOOST_WINTLS_DETAIL_DECRYPTED_DATA_BUFFER_HPP +#ifndef WINTLS_DETAIL_DECRYPTED_DATA_BUFFER_HPP +#define WINTLS_DETAIL_DECRYPTED_DATA_BUFFER_HPP -#include +#include #include #include #include -namespace boost { namespace wintls { namespace detail { @@ -46,6 +45,5 @@ class decrypted_data_buffer { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_DECRYPTED_DATA_BUFFER_HPP +#endif // WINTLS_DETAIL_DECRYPTED_DATA_BUFFER_HPP diff --git a/include/boost/wintls/detail/encrypt_buffers.hpp b/include/wintls/detail/encrypt_buffers.hpp similarity index 84% rename from include/boost/wintls/detail/encrypt_buffers.hpp rename to include/wintls/detail/encrypt_buffers.hpp index 57daa195..d07edd48 100644 --- a/include/boost/wintls/detail/encrypt_buffers.hpp +++ b/include/wintls/detail/encrypt_buffers.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_ENCRYPT_BUFFERS_HPP -#define BOOST_WINTLS_DETAIL_ENCRYPT_BUFFERS_HPP +#ifndef WINTLS_DETAIL_ENCRYPT_BUFFERS_HPP +#define WINTLS_DETAIL_ENCRYPT_BUFFERS_HPP -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -60,6 +59,5 @@ class encrypt_buffers : public sspi_buffer_sequence<4> { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_ENCRYPT_BUFFERS_HPP +#endif // WINTLS_DETAIL_ENCRYPT_BUFFERS_HPP diff --git a/include/boost/wintls/detail/error.hpp b/include/wintls/detail/error.hpp similarity index 88% rename from include/boost/wintls/detail/error.hpp rename to include/wintls/detail/error.hpp index 7703edbf..6437b7e4 100644 --- a/include/boost/wintls/detail/error.hpp +++ b/include/wintls/detail/error.hpp @@ -8,9 +8,8 @@ #ifndef WINTLS_DETAIL_ERROR_HPP #define WINTLS_DETAIL_ERROR_HPP -#include +#include -namespace boost { namespace wintls { namespace detail { @@ -36,6 +35,5 @@ inline void throw_error(const wintls::error_code& ec, const char* msg) { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_ERROR_HPP +#endif // WINTLS_DETAIL_ERROR_HPP diff --git a/include/boost/wintls/detail/handshake_input_buffers.hpp b/include/wintls/detail/handshake_input_buffers.hpp similarity index 67% rename from include/boost/wintls/detail/handshake_input_buffers.hpp rename to include/wintls/detail/handshake_input_buffers.hpp index 2de324b7..af628c5f 100644 --- a/include/boost/wintls/detail/handshake_input_buffers.hpp +++ b/include/wintls/detail/handshake_input_buffers.hpp @@ -5,12 +5,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_HANDSHAKE_INPUT_BUFFERS_HPP -#define BOOST_WINTLS_DETAIL_HANDSHAKE_INPUT_BUFFERS_HPP +#ifndef WINTLS_DETAIL_HANDSHAKE_INPUT_BUFFERS_HPP +#define WINTLS_DETAIL_HANDSHAKE_INPUT_BUFFERS_HPP -#include +#include -namespace boost { namespace wintls { namespace detail { @@ -26,6 +25,5 @@ class handshake_input_buffers : public sspi_buffer_sequence<2> { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_HANDSHAKE_INPUT_BUFFERS_HPP +#endif // WINTLS_DETAIL_HANDSHAKE_INPUT_BUFFERS_HPP diff --git a/include/boost/wintls/detail/handshake_output_buffers.hpp b/include/wintls/detail/handshake_output_buffers.hpp similarity index 65% rename from include/boost/wintls/detail/handshake_output_buffers.hpp rename to include/wintls/detail/handshake_output_buffers.hpp index 9c04992e..36ec466f 100644 --- a/include/boost/wintls/detail/handshake_output_buffers.hpp +++ b/include/wintls/detail/handshake_output_buffers.hpp @@ -5,12 +5,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_HANDSHAKE_OUTPUT_BUFFERS_HPP -#define BOOST_WINTLS_DETAIL_HANDSHAKE_OUTPUT_BUFFERS_HPP +#ifndef WINTLS_DETAIL_HANDSHAKE_OUTPUT_BUFFERS_HPP +#define WINTLS_DETAIL_HANDSHAKE_OUTPUT_BUFFERS_HPP -#include +#include -namespace boost { namespace wintls { namespace detail { @@ -25,6 +24,5 @@ class handshake_output_buffers : public sspi_buffer_sequence<1> { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_HANDSHAKE_OUTPUT_BUFFERS_HPP +#endif // WINTLS_DETAIL_HANDSHAKE_OUTPUT_BUFFERS_HPP diff --git a/include/boost/wintls/detail/shutdown_buffers.hpp b/include/wintls/detail/shutdown_buffers.hpp similarity index 73% rename from include/boost/wintls/detail/shutdown_buffers.hpp rename to include/wintls/detail/shutdown_buffers.hpp index 193167e4..4eeb260c 100644 --- a/include/boost/wintls/detail/shutdown_buffers.hpp +++ b/include/wintls/detail/shutdown_buffers.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SHUTDOWN_BUFFERS_HPP -#define BOOST_WINTLS_DETAIL_SHUTDOWN_BUFFERS_HPP +#ifndef WINTLS_DETAIL_SHUTDOWN_BUFFERS_HPP +#define WINTLS_DETAIL_SHUTDOWN_BUFFERS_HPP -#include +#include #include -namespace boost { namespace wintls { namespace detail { @@ -33,6 +32,5 @@ class shutdown_buffers : public sspi_buffer_sequence<1> { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SHUTDOWN_BUFFERS_HPP +#endif // WINTLS_DETAIL_SHUTDOWN_BUFFERS_HPP diff --git a/include/boost/wintls/detail/sspi_buffer_sequence.hpp b/include/wintls/detail/sspi_buffer_sequence.hpp similarity index 86% rename from include/boost/wintls/detail/sspi_buffer_sequence.hpp rename to include/wintls/detail/sspi_buffer_sequence.hpp index 406197cf..ebc9612b 100644 --- a/include/boost/wintls/detail/sspi_buffer_sequence.hpp +++ b/include/wintls/detail/sspi_buffer_sequence.hpp @@ -4,11 +4,11 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_BUFFER_SEQUENCE_HPP -#define BOOST_WINTLS_DETAIL_SSPI_BUFFER_SEQUENCE_HPP +#ifndef WINTLS_DETAIL_SSPI_BUFFER_SEQUENCE_HPP +#define WINTLS_DETAIL_SSPI_BUFFER_SEQUENCE_HPP -#include -#include +#include +#include #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -18,7 +18,6 @@ #include -namespace boost { namespace wintls { namespace detail { @@ -89,6 +88,5 @@ class sspi_buffer_sequence { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_BUFFER_SEQUENCE_HPP +#endif // WINTLS_DETAIL_SSPI_BUFFER_SEQUENCE_HPP diff --git a/include/boost/wintls/detail/sspi_context_buffer.hpp b/include/wintls/detail/sspi_context_buffer.hpp similarity index 81% rename from include/boost/wintls/detail/sspi_context_buffer.hpp rename to include/wintls/detail/sspi_context_buffer.hpp index ee610bd5..3b62b26f 100644 --- a/include/boost/wintls/detail/sspi_context_buffer.hpp +++ b/include/wintls/detail/sspi_context_buffer.hpp @@ -5,13 +5,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_CONTEXT_BUFFER_HPP -#define BOOST_WINTLS_DETAIL_SSPI_CONTEXT_BUFFER_HPP +#ifndef WINTLS_DETAIL_SSPI_CONTEXT_BUFFER_HPP +#define WINTLS_DETAIL_SSPI_CONTEXT_BUFFER_HPP -#include -#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -60,6 +59,5 @@ class sspi_context_buffer { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_CONTEXT_BUFFER_HPP +#endif // WINTLS_DETAIL_SSPI_CONTEXT_BUFFER_HPP diff --git a/include/boost/wintls/detail/sspi_decrypt.hpp b/include/wintls/detail/sspi_decrypt.hpp similarity index 87% rename from include/boost/wintls/detail/sspi_decrypt.hpp rename to include/wintls/detail/sspi_decrypt.hpp index 866727eb..2894f2b0 100644 --- a/include/boost/wintls/detail/sspi_decrypt.hpp +++ b/include/wintls/detail/sspi_decrypt.hpp @@ -5,19 +5,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_DECRYPT_HPP -#define BOOST_WINTLS_DETAIL_SSPI_DECRYPT_HPP +#ifndef WINTLS_DETAIL_SSPI_DECRYPT_HPP +#define WINTLS_DETAIL_SSPI_DECRYPT_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -namespace boost { namespace wintls { namespace detail { @@ -111,6 +110,5 @@ class sspi_decrypt { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_DECRYPT_HPP +#endif // WINTLS_DETAIL_SSPI_DECRYPT_HPP diff --git a/include/boost/wintls/detail/sspi_encrypt.hpp b/include/wintls/detail/sspi_encrypt.hpp similarity index 76% rename from include/boost/wintls/detail/sspi_encrypt.hpp rename to include/wintls/detail/sspi_encrypt.hpp index c7bc886a..9ecb5ff5 100644 --- a/include/boost/wintls/detail/sspi_encrypt.hpp +++ b/include/wintls/detail/sspi_encrypt.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_ENCRYPT_HPP -#define BOOST_WINTLS_DETAIL_SSPI_ENCRYPT_HPP +#ifndef WINTLS_DETAIL_SSPI_ENCRYPT_HPP +#define WINTLS_DETAIL_SSPI_ENCRYPT_HPP -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -50,6 +49,5 @@ class sspi_encrypt { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_ENCRYPT_HPP +#endif // WINTLS_DETAIL_SSPI_ENCRYPT_HPP diff --git a/include/boost/wintls/detail/sspi_functions.hpp b/include/wintls/detail/sspi_functions.hpp similarity index 95% rename from include/boost/wintls/detail/sspi_functions.hpp rename to include/wintls/detail/sspi_functions.hpp index 25a04be6..cb8a0217 100644 --- a/include/boost/wintls/detail/sspi_functions.hpp +++ b/include/wintls/detail/sspi_functions.hpp @@ -5,13 +5,12 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_FUNCTIONS_HPP -#define BOOST_WINTLS_DETAIL_SSPI_FUNCTIONS_HPP +#ifndef WINTLS_DETAIL_SSPI_FUNCTIONS_HPP +#define WINTLS_DETAIL_SSPI_FUNCTIONS_HPP -#include -#include +#include +#include -namespace boost { namespace wintls { namespace detail { namespace sspi_functions { @@ -119,6 +118,5 @@ inline SECURITY_STATUS AcceptSecurityContext(PCredHandle phCredential, } // namespace sspi_functions } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_FUNCTIONS_HPP +#endif // WINTLS_DETAIL_SSPI_FUNCTIONS_HPP diff --git a/include/boost/wintls/detail/sspi_handshake.hpp b/include/wintls/detail/sspi_handshake.hpp similarity index 95% rename from include/boost/wintls/detail/sspi_handshake.hpp rename to include/wintls/detail/sspi_handshake.hpp index f1ac68bb..292f2c33 100644 --- a/include/boost/wintls/detail/sspi_handshake.hpp +++ b/include/wintls/detail/sspi_handshake.hpp @@ -5,25 +5,24 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_HANDSHAKE_HPP -#define BOOST_WINTLS_DETAIL_SSPI_HANDSHAKE_HPP +#ifndef WINTLS_DETAIL_SSPI_HANDSHAKE_HPP +#define WINTLS_DETAIL_SSPI_HANDSHAKE_HPP -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include -#include +#include #include #include #include -namespace boost { namespace wintls { namespace detail { @@ -312,6 +311,5 @@ class sspi_handshake { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_HANDSHAKE_HPP +#endif // WINTLS_DETAIL_SSPI_HANDSHAKE_HPP diff --git a/include/boost/wintls/detail/sspi_sec_handle.hpp b/include/wintls/detail/sspi_sec_handle.hpp similarity index 81% rename from include/boost/wintls/detail/sspi_sec_handle.hpp rename to include/wintls/detail/sspi_sec_handle.hpp index 51f293a3..108b7a34 100644 --- a/include/boost/wintls/detail/sspi_sec_handle.hpp +++ b/include/wintls/detail/sspi_sec_handle.hpp @@ -5,12 +5,11 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_SEC_HANDLE_HPP -#define BOOST_WINTLS_DETAIL_SSPI_SEC_HANDLE_HPP +#ifndef WINTLS_DETAIL_SSPI_SEC_HANDLE_HPP +#define WINTLS_DETAIL_SSPI_SEC_HANDLE_HPP -#include +#include -namespace boost { namespace wintls { namespace detail { @@ -54,6 +53,5 @@ class cred_handle : public sspi_sec_handle { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_SEC_HANDLE_HPP +#endif // WINTLS_DETAIL_SSPI_SEC_HANDLE_HPP diff --git a/include/boost/wintls/detail/sspi_shutdown.hpp b/include/wintls/detail/sspi_shutdown.hpp similarity index 81% rename from include/boost/wintls/detail/sspi_shutdown.hpp rename to include/wintls/detail/sspi_shutdown.hpp index c3e7b62c..2c8aba3e 100644 --- a/include/boost/wintls/detail/sspi_shutdown.hpp +++ b/include/wintls/detail/sspi_shutdown.hpp @@ -5,19 +5,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_SHUTDOWN_HPP -#define BOOST_WINTLS_DETAIL_SSPI_SHUTDOWN_HPP +#ifndef WINTLS_DETAIL_SSPI_SHUTDOWN_HPP +#define WINTLS_DETAIL_SSPI_SHUTDOWN_HPP -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -namespace boost { namespace wintls { namespace detail { @@ -75,6 +74,5 @@ class sspi_shutdown { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_SHUTDOWN_HPP +#endif // WINTLS_DETAIL_SSPI_SHUTDOWN_HPP diff --git a/include/boost/wintls/detail/sspi_stream.hpp b/include/wintls/detail/sspi_stream.hpp similarity index 65% rename from include/boost/wintls/detail/sspi_stream.hpp rename to include/wintls/detail/sspi_stream.hpp index 22c211ee..70e96cd8 100644 --- a/include/boost/wintls/detail/sspi_stream.hpp +++ b/include/wintls/detail/sspi_stream.hpp @@ -5,16 +5,15 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_STREAM_HPP -#define BOOST_WINTLS_DETAIL_SSPI_STREAM_HPP +#ifndef WINTLS_DETAIL_SSPI_STREAM_HPP +#define WINTLS_DETAIL_SSPI_STREAM_HPP -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -namespace boost { namespace wintls { namespace detail { @@ -43,6 +42,5 @@ class sspi_stream { } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_SSPI_STREAM_HPP +#endif // WINTLS_DETAIL_SSPI_STREAM_HPP diff --git a/include/boost/wintls/detail/sspi_types.hpp b/include/wintls/detail/sspi_types.hpp similarity index 53% rename from include/boost/wintls/detail/sspi_types.hpp rename to include/wintls/detail/sspi_types.hpp index 41fe0683..8aae48c9 100644 --- a/include/boost/wintls/detail/sspi_types.hpp +++ b/include/wintls/detail/sspi_types.hpp @@ -5,28 +5,28 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_SSPI_TYPES_HPP -#define BOOST_WINTLS_DETAIL_SSPI_TYPES_HPP +#ifndef WINTLS_DETAIL_SSPI_TYPES_HPP +#define WINTLS_DETAIL_SSPI_TYPES_HPP #ifndef SECURITY_WIN32 #define SECURITY_WIN32 -#define BOOST_WINTLS_SECURITY_WIN32_DEFINED +#define WINTLS_SECURITY_WIN32_DEFINED #endif // SECURITY_WIN32 #ifdef UNICODE #undef UNICODE -#define BOOST_WINTLS_UNICODE_UNDEFINED +#define WINTLS_UNICODE_UNDEFINED #endif // UNICODE #include #include -#ifdef BOOST_WINTLS_SECURITY_WIN32_DEFINED +#ifdef WINTLS_SECURITY_WIN32_DEFINED #undef SECURITY_WIN32 -#endif // BOOST_WINTLS_SECURITY_WIN32_DEFINED +#endif // WINTLS_SECURITY_WIN32_DEFINED -#ifdef BOOST_WINTLS_UNICODE_UNDEFINED +#ifdef WINTLS_UNICODE_UNDEFINED #define UNICODE -#endif // BOOST_WINTLS_UNICODE_UNDEFINED +#endif // WINTLS_UNICODE_UNDEFINED -#endif // BOOST_WINTLS_DETAIL_SSPI_TYPES_HPP +#endif // WINTLS_DETAIL_SSPI_TYPES_HPP diff --git a/include/boost/wintls/detail/win32_crypto.hpp b/include/wintls/detail/win32_crypto.hpp similarity index 89% rename from include/boost/wintls/detail/win32_crypto.hpp rename to include/wintls/detail/win32_crypto.hpp index cd256a5d..d06a85b3 100644 --- a/include/boost/wintls/detail/win32_crypto.hpp +++ b/include/wintls/detail/win32_crypto.hpp @@ -5,15 +5,14 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_DETAIL_WIN32_CRYPTO_HPP -#define BOOST_WINTLS_DETAIL_WIN32_CRYPTO_HPP +#ifndef WINTLS_DETAIL_WIN32_CRYPTO_HPP +#define WINTLS_DETAIL_WIN32_CRYPTO_HPP -#include -#include +#include +#include #include -namespace boost { namespace wintls { namespace detail { @@ -70,6 +69,5 @@ inline std::vector crypt_decode_object_ex(const net::const_buffer& crypt_o } // namespace detail } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_DETAIL_WIN32_CRYPTO_HPP +#endif // WINTLS_DETAIL_WIN32_CRYPTO_HPP diff --git a/include/boost/wintls/error.hpp b/include/wintls/error.hpp similarity index 63% rename from include/boost/wintls/error.hpp rename to include/wintls/error.hpp index f0ffe46e..febe7cdb 100644 --- a/include/boost/wintls/error.hpp +++ b/include/wintls/error.hpp @@ -5,14 +5,13 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_ERROR_HPP -#define BOOST_WINTLS_ERROR_HPP +#ifndef WINTLS_ERROR_HPP +#define WINTLS_ERROR_HPP -#include -#include -#include +#include +#include +#include -namespace boost { namespace wintls { namespace error { @@ -22,6 +21,5 @@ inline wintls::error_code make_error_code(SECURITY_STATUS sc) { } // namespace error } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_ERROR_HPP +#endif // WINTLS_ERROR_HPP diff --git a/include/boost/wintls/file_format.hpp b/include/wintls/file_format.hpp similarity index 71% rename from include/boost/wintls/file_format.hpp rename to include/wintls/file_format.hpp index 42de9757..a6f0a779 100644 --- a/include/boost/wintls/file_format.hpp +++ b/include/wintls/file_format.hpp @@ -5,10 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_FILE_FORMAT_HPP -#define BOOST_WINTLS_FILE_FORMAT_HPP +#ifndef WINTLS_FILE_FORMAT_HPP +#define WINTLS_FILE_FORMAT_HPP -namespace boost { namespace wintls { /// File format types. @@ -21,6 +20,5 @@ enum class file_format { }; } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_FILE_FORMAT_HPP +#endif // WINTLS_FILE_FORMAT_HPP diff --git a/include/boost/wintls/handshake_type.hpp b/include/wintls/handshake_type.hpp similarity index 73% rename from include/boost/wintls/handshake_type.hpp rename to include/wintls/handshake_type.hpp index 8eb8588b..f72c46c3 100644 --- a/include/boost/wintls/handshake_type.hpp +++ b/include/wintls/handshake_type.hpp @@ -5,10 +5,9 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_HANDSHAKE_TYPE_HPP -#define BOOST_WINTLS_HANDSHAKE_TYPE_HPP +#ifndef WINTLS_HANDSHAKE_TYPE_HPP +#define WINTLS_HANDSHAKE_TYPE_HPP -namespace boost { namespace wintls { /// Different handshake types. @@ -21,6 +20,5 @@ enum class handshake_type { }; } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_HANDSHAKE_TYPE_HPP +#endif // WINTLS_HANDSHAKE_TYPE_HPP diff --git a/include/boost/wintls/method.hpp b/include/wintls/method.hpp similarity index 92% rename from include/boost/wintls/method.hpp rename to include/wintls/method.hpp index f75657f9..ef2474de 100644 --- a/include/boost/wintls/method.hpp +++ b/include/wintls/method.hpp @@ -5,10 +5,10 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_METHOD_HPP -#define BOOST_WINTLS_METHOD_HPP +#ifndef WINTLS_METHOD_HPP +#define WINTLS_METHOD_HPP -#include +#include #ifndef SP_PROT_TLS1_1_SERVER #define SP_PROT_TLS1_1_SERVER 0x100 @@ -34,7 +34,6 @@ #define SP_PROT_TLS1_3_CLIENT 0x2000 #endif // SP_PROT_TLS1_3_CLIENT -namespace boost { namespace wintls { /// Different methods supported by a context. @@ -89,6 +88,5 @@ enum class method { }; } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_METHOD_HPP +#endif // WINTLS_METHOD_HPP diff --git a/include/boost/wintls/stream.hpp b/include/wintls/stream.hpp similarity index 97% rename from include/boost/wintls/stream.hpp rename to include/wintls/stream.hpp index 8e2a3fc8..d74f447c 100644 --- a/include/boost/wintls/stream.hpp +++ b/include/wintls/stream.hpp @@ -5,18 +5,18 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_STREAM_HPP -#define BOOST_WINTLS_STREAM_HPP +#ifndef WINTLS_STREAM_HPP +#define WINTLS_STREAM_HPP -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -28,7 +28,6 @@ #include -namespace boost { namespace wintls { /** Provides stream-oriented functionality using Windows SSPI/Schannel. @@ -479,6 +478,5 @@ class stream { }; } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_STREAM_HPP +#endif // WINTLS_STREAM_HPP diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b0ee540e..e8603401 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -60,7 +60,7 @@ target_link_libraries(unittest PRIVATE OpenSSL::Crypto Threads::Threads Catch2::Catch2 - boost-wintls + wintls ) if(${CMAKE_CXX_STANDARD} LESS 17 AND ENABLE_WINTLS_STANDALONE_ASIO) diff --git a/test/asio_ssl_client_stream.hpp b/test/asio_ssl_client_stream.hpp index 0632aa3a..00e3a8e8 100644 --- a/test/asio_ssl_client_stream.hpp +++ b/test/asio_ssl_client_stream.hpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_ASIO_SSL_CLIENT_STREAM_HPP -#define BOOST_WINTLS_TEST_ASIO_SSL_CLIENT_STREAM_HPP +#ifndef WINTLS_TEST_ASIO_SSL_CLIENT_STREAM_HPP +#define WINTLS_TEST_ASIO_SSL_CLIENT_STREAM_HPP #include "unittest.hpp" #include "certificate.hpp" @@ -51,4 +51,4 @@ struct asio_ssl_client_stream { asio_ssl::stream stream; }; -#endif // BOOST_WINTLS_TEST_ASIO_SSL_CLIENT_STREAM_HPP +#endif // WINTLS_TEST_ASIO_SSL_CLIENT_STREAM_HPP diff --git a/test/asio_ssl_server_stream.hpp b/test/asio_ssl_server_stream.hpp index d655fe11..3d82e088 100644 --- a/test/asio_ssl_server_stream.hpp +++ b/test/asio_ssl_server_stream.hpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_ASIO_SSL_SERVER_STREAM_HPP -#define BOOST_WINTLS_TEST_ASIO_SSL_SERVER_STREAM_HPP +#ifndef WINTLS_TEST_ASIO_SSL_SERVER_STREAM_HPP +#define WINTLS_TEST_ASIO_SSL_SERVER_STREAM_HPP #include "certificate.hpp" #include "unittest.hpp" @@ -37,4 +37,4 @@ struct asio_ssl_server_stream { asio_ssl::stream stream; }; -#endif // BOOST_WINTLS_TEST_ASIO_SSL_SERVER_STREAM_HPP +#endif // WINTLS_TEST_ASIO_SSL_SERVER_STREAM_HPP diff --git a/test/async_echo_client.hpp b/test/async_echo_client.hpp index 1405f84e..73b20fed 100644 --- a/test/async_echo_client.hpp +++ b/test/async_echo_client.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_ASYNC_ECHO_CLIENT_HPP -#define BOOST_WINTLS_TEST_ASYNC_ECHO_CLIENT_HPP +#ifndef WINTLS_TEST_ASYNC_ECHO_CLIENT_HPP +#define WINTLS_TEST_ASYNC_ECHO_CLIENT_HPP #include "unittest.hpp" @@ -64,4 +64,4 @@ struct async_echo_client : public Stream { net::streambuf recv_buffer_; }; -#endif // BOOST_WINTLS_TEST_ASYNC_ECHO_CLIENT_HPP +#endif // WINTLS_TEST_ASYNC_ECHO_CLIENT_HPP diff --git a/test/async_echo_server.hpp b/test/async_echo_server.hpp index 831bd7f4..f2ba1403 100644 --- a/test/async_echo_server.hpp +++ b/test/async_echo_server.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_ASYNC_ECHO_SERVER_HPP -#define BOOST_WINTLS_TEST_ASYNC_ECHO_SERVER_HPP +#ifndef WINTLS_TEST_ASYNC_ECHO_SERVER_HPP +#define WINTLS_TEST_ASYNC_ECHO_SERVER_HPP #include "unittest.hpp" @@ -58,4 +58,4 @@ class async_echo_server : public Stream { net::streambuf recv_buffer_; }; -#endif // BOOST_WINTLS_TEST_ASYNC_ECHO_SERVER_HPP +#endif // WINTLS_TEST_ASYNC_ECHO_SERVER_HPP diff --git a/test/certificate.hpp b/test/certificate.hpp index e1be05d8..8400f995 100644 --- a/test/certificate.hpp +++ b/test/certificate.hpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_CERTIFICATE_HPP -#define BOOST_WINTLS_TEST_CERTIFICATE_HPP +#ifndef WINTLS_TEST_CERTIFICATE_HPP +#define WINTLS_TEST_CERTIFICATE_HPP #include @@ -62,5 +62,5 @@ const std::string test_key = "hOHwm+u6yzjHKIsf0M/ATOru\n" "-----END PRIVATE KEY-----\n"; -const std::string test_key_name="boost-wintls-test-key"; -#endif // BOOST_WINTLS_TEST_CERTIFICATE_HPP +const std::string test_key_name="wintls-test-key"; +#endif // WINTLS_TEST_CERTIFICATE_HPP diff --git a/test/certificate_test.cpp b/test/certificate_test.cpp index 339ddf6f..78d013aa 100644 --- a/test/certificate_test.cpp +++ b/test/certificate_test.cpp @@ -9,9 +9,9 @@ #include "ocsp_responder.hpp" #include "unittest.hpp" -#include -#include -#include +#include +#include +#include #include #include @@ -50,30 +50,30 @@ bool container_exists(const std::string& name) { // Add a certificate from the PEM formatted string cert_str to the given store. // If get_handle is true, a handle to the certificate in the store is returned. // Otherwise, the certificate will be owned by the store and nullptr is returned. -boost::wintls::cert_context_ptr add_cert_str_to_store(HCERTSTORE store, - const net::const_buffer& cert_str, - bool get_handle) { +wintls::cert_context_ptr add_cert_str_to_store(HCERTSTORE store, + const net::const_buffer& cert_str, + bool get_handle) { PCCERT_CONTEXT cert_in_store = nullptr; - const auto cert_data = boost::wintls::detail::crypt_string_to_binary(cert_str); + const auto cert_data = wintls::detail::crypt_string_to_binary(cert_str); if (!CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, cert_data.data(), static_cast(cert_data.size()), CERT_STORE_ADD_ALWAYS, get_handle ? &cert_in_store : nullptr)) { - boost::wintls::detail::throw_last_error("CertAddEncodedCertificateToStore"); + wintls::detail::throw_last_error("CertAddEncodedCertificateToStore"); } if (get_handle) { - return boost::wintls::cert_context_ptr{cert_in_store}; + return wintls::cert_context_ptr{cert_in_store}; } - return boost::wintls::cert_context_ptr{}; + return wintls::cert_context_ptr{}; } // Load a PEM formatted certificate chain from the given file. // Assumes that the first certificate in the file is the leaf certificate // and returns a context for this certificate which internally holds a store // containing all remaining certificates from the file. -boost::wintls::cert_context_ptr load_chain_file(const std::string& path) { +wintls::cert_context_ptr load_chain_file(const std::string& path) { std::ifstream ifs(path); if (ifs.fail()) { throw std::runtime_error("Failed to open file " + path); @@ -90,7 +90,7 @@ boost::wintls::cert_context_ptr load_chain_file(const std::string& path) { } // Open a temporary store for the chain. // Use CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, so the context of the leaf certificate can take ownership. - const auto chain_store = boost::wintls::detail::cert_store_ptr{ + const auto chain_store = wintls::detail::cert_store_ptr{ CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG, nullptr)}; auto leaf_ctx = add_cert_str_to_store(chain_store.get(), net::buffer(&str[cert_begin], cert_end + end_cert_str_size - cert_begin), @@ -119,10 +119,10 @@ struct crl_ctx_deleter { using crl_ctx_ptr = std::unique_ptr; crl_ctx_ptr x509_to_crl_context(const net::const_buffer& x509) { - const auto data = boost::wintls::detail::crypt_string_to_binary(x509); + const auto data = wintls::detail::crypt_string_to_binary(x509); const auto crl = CertCreateCRLContext(X509_ASN_ENCODING, data.data(), static_cast(data.size())); if (!crl) { - boost::wintls::detail::throw_last_error("CertCreateCRLContext"); + wintls::detail::throw_last_error("CertCreateCRLContext"); } return crl_ctx_ptr{crl}; } @@ -132,48 +132,48 @@ crl_ctx_ptr crl_from_file(const std::string& path) { return x509_to_crl_context(net::buffer(crl_bytes)); } -boost::wintls::cert_context_ptr cert_from_file(const std::string& path) { +wintls::cert_context_ptr cert_from_file(const std::string& path) { const auto cert_bytes = bytes_from_file(path); - return boost::wintls::x509_to_cert_context(net::buffer(cert_bytes), boost::wintls::file_format::pem); + return wintls::x509_to_cert_context(net::buffer(cert_bytes), wintls::file_format::pem); } } TEST_CASE("certificate conversion") { SECTION("valid cert bytes") { - const auto cert = boost::wintls::x509_to_cert_context(net::buffer(test_certificate), boost::wintls::file_format::pem); + const auto cert = wintls::x509_to_cert_context(net::buffer(test_certificate), wintls::file_format::pem); CHECK(get_cert_name(cert.get()) == "localhost"); } SECTION("invalid cert bytes") { const std::vector cert_bytes; - CHECK_THROWS(boost::wintls::x509_to_cert_context(net::buffer(cert_bytes), boost::wintls::file_format::pem)); + CHECK_THROWS(wintls::x509_to_cert_context(net::buffer(cert_bytes), wintls::file_format::pem)); error_code error = {}; - const auto cert = boost::wintls::x509_to_cert_context(net::buffer(cert_bytes), boost::wintls::file_format::pem, error); + const auto cert = wintls::x509_to_cert_context(net::buffer(cert_bytes), wintls::file_format::pem, error); CHECK(error); CHECK_FALSE(cert); } } TEST_CASE("import private key") { - const std::string name{"boost::wintls crypto test container"}; + const std::string name{"wintls crypto test container"}; REQUIRE_FALSE(container_exists(name)); - boost::wintls::import_private_key(net::buffer(test_key), boost::wintls::file_format::pem, name); + wintls::import_private_key(net::buffer(test_key), wintls::file_format::pem, name); CHECK(container_exists(name)); error_code ec; - boost::wintls::import_private_key(net::buffer(test_key), boost::wintls::file_format::pem, name, ec); + wintls::import_private_key(net::buffer(test_key), wintls::file_format::pem, name, ec); CHECK(ec.value() == NTE_EXISTS); - boost::wintls::delete_private_key(name); + wintls::delete_private_key(name); CHECK_FALSE(container_exists(name)); - boost::wintls::delete_private_key(name, ec); + wintls::delete_private_key(name, ec); CHECK(ec.value() == NTE_BAD_KEYSET); } TEST_CASE("verify certificate host name") { - boost::wintls::detail::context_certificates ctx_certs; + wintls::detail::context_certificates ctx_certs; ctx_certs.add_certificate_authority(cert_from_file(TEST_CERTIFICATES_PATH "ca_root.crt").get()); const auto cert = load_chain_file(TEST_CERTIFICATES_PATH "leaf_chain.pem"); @@ -190,8 +190,8 @@ TEST_CASE("verify certificate host name") { TEST_CASE("check certificate revocation") { SECTION("single self signed certificate") { - const auto cert = boost::wintls::x509_to_cert_context(net::buffer(test_certificate), boost::wintls::file_format::pem); - boost::wintls::detail::context_certificates ctx_certs; + const auto cert = wintls::x509_to_cert_context(net::buffer(test_certificate), wintls::file_format::pem); + wintls::detail::context_certificates ctx_certs; ctx_certs.add_certificate_authority(cert.get()); // It appears that there is no revocation check done in this case, // otherwise this should fail with CRYPT_E_NO_REVOCATION_CHECK @@ -203,7 +203,7 @@ TEST_CASE("check certificate revocation") { } SECTION("certificate chain with CRLs") { - boost::wintls::detail::context_certificates ctx_certs; + wintls::detail::context_certificates ctx_certs; ctx_certs.add_certificate_authority(cert_from_file(TEST_CERTIFICATES_PATH "ca_root.crt").get()); const auto cert = load_chain_file(TEST_CERTIFICATES_PATH "leaf_chain.pem"); @@ -226,7 +226,7 @@ TEST_CASE("check certificate revocation") { // Therefore it is marked as integration test and not run by default. TEST_CASE("check certificate revocation (integration test)", "[.integration]") { SECTION("certificate chain with OCSP") { - boost::wintls::detail::context_certificates ctx_certs; + wintls::detail::context_certificates ctx_certs; ctx_certs.add_certificate_authority(cert_from_file(TEST_CERTIFICATES_PATH "ca_root.crt").get()); // fail case: OCSP responder is not running diff --git a/test/decrypted_data_buffer_test.cpp b/test/decrypted_data_buffer_test.cpp index 52c43ede..253c2b17 100644 --- a/test/decrypted_data_buffer_test.cpp +++ b/test/decrypted_data_buffer_test.cpp @@ -7,12 +7,12 @@ #include "unittest.hpp" -#include +#include #include TEST_CASE("decrypted data buffer") { - boost::wintls::detail::decrypted_data_buffer<25> test_buffer; + wintls::detail::decrypted_data_buffer<25> test_buffer; CHECK(test_buffer.empty()); std::string input_str{"abc"}; diff --git a/test/echo_client.hpp b/test/echo_client.hpp index fc31a2d6..dcf39857 100644 --- a/test/echo_client.hpp +++ b/test/echo_client.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_ECHO_CLIENT_HPP -#define BOOST_WINTLS_TEST_ECHO_CLIENT_HPP +#ifndef WINTLS_TEST_ECHO_CLIENT_HPP +#define WINTLS_TEST_ECHO_CLIENT_HPP #include "unittest.hpp" @@ -45,4 +45,4 @@ class echo_client : public Stream { net::streambuf buffer_; }; -#endif // BOOST_WINTLS_TEST_ECHO_CLIENT_HPP +#endif // WINTLS_TEST_ECHO_CLIENT_HPP diff --git a/test/echo_server.hpp b/test/echo_server.hpp index 1424554f..47c5983b 100644 --- a/test/echo_server.hpp +++ b/test/echo_server.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_ECHO_SERVER_HPP -#define BOOST_WINTLS_TEST_ECHO_SERVER_HPP +#ifndef WINTLS_TEST_ECHO_SERVER_HPP +#define WINTLS_TEST_ECHO_SERVER_HPP #include "unittest.hpp" @@ -49,4 +49,4 @@ class echo_server : public Stream { net::streambuf buffer_; }; -#endif // BOOST_WINTLS_TEST_ECHO_SERVER_HPP +#endif // WINTLS_TEST_ECHO_SERVER_HPP diff --git a/test/echo_test.cpp b/test/echo_test.cpp index f7265622..6ab82a0f 100644 --- a/test/echo_test.cpp +++ b/test/echo_test.cpp @@ -15,7 +15,7 @@ #include "wintls_server_stream.hpp" #include "unittest.hpp" -#include +#include #include #include diff --git a/test/error_test.cpp b/test/error_test.cpp index 09a19d38..6b2028e7 100644 --- a/test/error_test.cpp +++ b/test/error_test.cpp @@ -7,13 +7,13 @@ #include "unittest.hpp" -#include +#include extern "C" __declspec(dllimport) void __stdcall SetLastError(unsigned long); TEST_CASE("SECURITY_STATUS error code") { auto sc = static_cast(0x80090326); - auto ec = boost::wintls::error::make_error_code(sc); + auto ec = wintls::error::make_error_code(sc); CHECK(ec.value() == sc); // Boost will trim line breaks as well as periods from the original error message. std::string msg = "The message received was unexpected or badly formatted"; @@ -26,7 +26,7 @@ TEST_CASE("throw last error") { ::SetLastError(0x00000053); try { - boost::wintls::detail::throw_last_error("YetAnotherUglyWindowsAPIFunctionEx3"); + wintls::detail::throw_last_error("YetAnotherUglyWindowsAPIFunctionEx3"); } catch (const system_error& ex) { error = ex; } diff --git a/test/handshake_test.cpp b/test/handshake_test.cpp index 766c8011..99d03b0c 100644 --- a/test/handshake_test.cpp +++ b/test/handshake_test.cpp @@ -11,7 +11,7 @@ #include "tls_record.hpp" #include "unittest.hpp" -#include +#include #include "asio_ssl_server_stream.hpp" #include "asio_ssl_client_stream.hpp" #include "wintls_client_stream.hpp" @@ -29,7 +29,6 @@ const auto& get_system_category = boost::system::system_category; namespace err_help = boost::system::errc; #endif // !WINTLS_USE_STANDALONE_ASIO -namespace boost { namespace wintls { std::ostream& operator<<(std::ostream& os, const method meth) { @@ -71,7 +70,6 @@ std::ostream& operator<<(std::ostream& os, const method meth) { } } // namespace wintls -} // namespace boost namespace { @@ -80,13 +78,13 @@ std::string wchar_to_string(const wchar_t* input) { const auto size_needed = WideCharToMultiByte(CP_UTF8, 0, input, length, nullptr, 0, nullptr, nullptr); if (size_needed == 0) { - boost::wintls::detail::throw_last_error("WideCharToMultiByte"); + wintls::detail::throw_last_error("WideCharToMultiByte"); } std::string output(size_needed, '\0'); const auto size_written = WideCharToMultiByte(CP_UTF8, 0, input, length, &output[0], size_needed, nullptr, nullptr); if (size_written == 0) { - boost::wintls::detail::throw_last_error("WideCharToMultiByte"); + wintls::detail::throw_last_error("WideCharToMultiByte"); } return output; } @@ -95,11 +93,11 @@ std::vector string_to_x509_name(const std::string& str) { DWORD size = 0; std::vector ret; if (!CertStrToName(X509_ASN_ENCODING, str.c_str(), CERT_X500_NAME_STR, nullptr, nullptr, &size, nullptr)) { - boost::wintls::detail::throw_last_error("CertStrToName"); + wintls::detail::throw_last_error("CertStrToName"); } ret.resize(size); if (!CertStrToName(X509_ASN_ENCODING, str.c_str(), CERT_X500_NAME_STR, nullptr, ret.data(), &size, nullptr)) { - boost::wintls::detail::throw_last_error("CertStrToName"); + wintls::detail::throw_last_error("CertStrToName"); } return ret; } @@ -116,7 +114,7 @@ struct cert_name_blob { std::vector data_; }; -boost::wintls::cert_context_ptr create_self_signed_cert(const std::string& subject) { +wintls::cert_context_ptr create_self_signed_cert(const std::string& subject) { cert_name_blob cert_subject(subject); SYSTEMTIME expiry_date; GetSystemTime(&expiry_date); @@ -131,9 +129,9 @@ boost::wintls::cert_context_ptr create_self_signed_cert(const std::string& subje &expiry_date, 0); if (!cert) { - boost::wintls::detail::throw_last_error("CertCreateSelfSignCertificate"); + wintls::detail::throw_last_error("CertCreateSelfSignCertificate"); } - return boost::wintls::cert_context_ptr{cert}; + return wintls::cert_context_ptr{cert}; } std::string cert_container_name(const CERT_CONTEXT* cert) { @@ -142,7 +140,7 @@ std::string cert_container_name(const CERT_CONTEXT* cert) { CERT_KEY_PROV_INFO_PROP_ID, nullptr, &size)) { - boost::wintls::detail::throw_last_error("CertGetCertificateContextProperty"); + wintls::detail::throw_last_error("CertGetCertificateContextProperty"); } std::vector data(size); @@ -150,7 +148,7 @@ std::string cert_container_name(const CERT_CONTEXT* cert) { CERT_KEY_PROV_INFO_PROP_ID, data.data(), &size)) { - boost::wintls::detail::throw_last_error("CertGetCertificateContextProperty"); + wintls::detail::throw_last_error("CertGetCertificateContextProperty"); } const auto info = reinterpret_cast(data.data()); return wchar_to_string(info->pwszContainerName); @@ -162,8 +160,8 @@ TEST_CASE("certificates") { WINTLS_TEST_ERROR_NAMESPACE_ALIAS(); net::io_context io_context; - boost::wintls::context client_ctx(boost::wintls::method::system_default); - boost::wintls::stream client_stream(io_context, client_ctx); + wintls::context client_ctx(wintls::method::system_default); + wintls::stream client_stream(io_context, client_ctx); SECTION("invalid certificate data") { // TODO: Instead of returning an error when given a null pointer @@ -193,8 +191,8 @@ TEST_CASE("certificates") { } SECTION("server cert without private key") { - boost::wintls::context server_ctx(boost::wintls::method::system_default); - auto cert = x509_to_cert_context(net::buffer(test_certificate), boost::wintls::file_format::pem); + wintls::context server_ctx(wintls::method::system_default); + auto cert = x509_to_cert_context(net::buffer(test_certificate), wintls::file_format::pem); CHECK_THROWS_WITH(server_ctx.use_certificate(cert.get()), Catch::Matchers::Contains("Cannot find the certificate and private key for decryption")); @@ -206,23 +204,23 @@ TEST_CASE("certificates") { } SECTION("wintl server") { - boost::wintls::context server_ctx(boost::wintls::method::system_default); + wintls::context server_ctx(wintls::method::system_default); const auto cert = create_self_signed_cert("CN=WinTLS, T=Test"); server_ctx.use_certificate(cert.get()); - boost::wintls::stream server_stream(io_context, server_ctx); + wintls::stream server_stream(io_context, server_ctx); client_stream.next_layer().connect(server_stream.next_layer()); SECTION("no certificate validation") { auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error, &io_context](const error_code& ec) { client_error = ec; io_context.stop(); }); auto server_error = err_help::make_error_code(errc::not_supported); - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_error](const error_code& ec) { server_error = ec; }); @@ -235,13 +233,13 @@ TEST_CASE("certificates") { client_ctx.verify_server_certificate(true); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error](const error_code& ec) { client_error = ec; }); auto server_error = err_help::make_error_code(errc::not_supported); - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_error](const error_code& ec) { server_error = ec; }); @@ -257,14 +255,14 @@ TEST_CASE("certificates") { client_ctx.add_certificate_authority(cert.get()); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error, &io_context](const error_code& ec) { client_error = ec; io_context.stop(); }); auto server_error = err_help::make_error_code(errc::not_supported); - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_error](const error_code& ec) { server_error = ec; }); @@ -273,7 +271,7 @@ TEST_CASE("certificates") { CHECK_FALSE(server_error); } - boost::wintls::delete_private_key(cert_container_name(cert.get())); + wintls::delete_private_key(cert_container_name(cert.get())); } SECTION("asio::ssl server") { @@ -287,7 +285,7 @@ TEST_CASE("certificates") { SECTION("no certificate validation") { auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error, &io_context](const error_code& ec) { client_error = ec; io_context.stop(); @@ -307,7 +305,7 @@ TEST_CASE("certificates") { client_ctx.verify_server_certificate(true); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error](const error_code& ec) { client_error = ec; }); @@ -327,11 +325,11 @@ TEST_CASE("certificates") { SECTION("trusted certificate verified") { client_ctx.verify_server_certificate(true); - const auto cert_ptr = x509_to_cert_context(net::buffer(test_certificate), boost::wintls::file_format::pem); + const auto cert_ptr = x509_to_cert_context(net::buffer(test_certificate), wintls::file_format::pem); client_ctx.add_certificate_authority(cert_ptr.get()); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error, &io_context](const error_code& ec) { client_error = ec; io_context.stop(); @@ -360,13 +358,13 @@ TEST_CASE("client certificates") { server_ctx.enable_client_verify(); net::io_context io_context; - boost::wintls::stream client_stream(io_context, client_ctx); + wintls::stream client_stream(io_context, client_ctx); net::ssl::stream server_stream(io_context, server_ctx); client_stream.next_layer().connect(server_stream.next_layer()); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error](const error_code& ec) { client_error = ec; }); @@ -398,13 +396,13 @@ TEST_CASE("client certificates") { server_ctx.enable_client_verify(); net::io_context io_context; - boost::wintls::stream client_stream(io_context, client_ctx); + wintls::stream client_stream(io_context, client_ctx); net::ssl::stream server_stream(io_context, server_ctx); client_stream.next_layer().connect(server_stream.next_layer()); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error](const error_code& ec) { client_error = ec; }); @@ -463,7 +461,7 @@ TEST_CASE("client certificates") { net::io_context io_context; net::ssl::stream client_stream(io_context, client_ctx); - boost::wintls::stream server_stream(io_context, server_ctx); + wintls::stream server_stream(io_context, server_ctx); client_stream.next_layer().connect(server_stream.next_layer()); @@ -474,7 +472,7 @@ TEST_CASE("client certificates") { }); auto server_error = err_help::make_error_code(errc::not_supported); - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_error](const error_code& ec) { server_error = ec; }); @@ -493,7 +491,7 @@ TEST_CASE("client certificates") { net::io_context io_context; net::ssl::stream client_stream(io_context, client_ctx); - boost::wintls::stream server_stream(io_context, server_ctx); + wintls::stream server_stream(io_context, server_ctx); client_stream.next_layer().connect(server_stream.next_layer()); @@ -504,7 +502,7 @@ TEST_CASE("client certificates") { }); auto server_error = err_help::make_error_code(errc::not_supported); - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_error](const error_code& ec) { server_error = ec; }); @@ -524,19 +522,19 @@ TEST_CASE("client certificates") { server_ctx.enable_client_verify(); net::io_context io_context; - boost::wintls::stream client_stream(io_context, client_ctx); - boost::wintls::stream server_stream(io_context, server_ctx); + wintls::stream client_stream(io_context, client_ctx); + wintls::stream server_stream(io_context, server_ctx); client_stream.next_layer().connect(server_stream.next_layer()); auto client_error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_error](const error_code& ec) { client_error = ec; }); auto server_error = err_help::make_error_code(errc::not_supported); - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_error](const error_code& ec) { server_error = ec; }); @@ -547,9 +545,9 @@ TEST_CASE("client certificates") { } TEST_CASE("failing handshakes") { - boost::wintls::context client_ctx(boost::wintls::method::system_default); + wintls::context client_ctx(wintls::method::system_default); net::io_context io_context; - boost::wintls::stream client_stream(io_context, client_ctx); + wintls::stream client_stream(io_context, client_ctx); test_stream server_stream(io_context); client_stream.next_layer().connect(server_stream); @@ -558,7 +556,7 @@ TEST_CASE("failing handshakes") { WINTLS_TEST_ERROR_NAMESPACE_ALIAS(); auto error = err_help::make_error_code(errc::not_supported); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&error](const error_code& ec) { error = ec; }); @@ -581,29 +579,29 @@ TEST_CASE("failing handshakes") { } TEST_CASE("ssl/tls versions") { - const auto value = GENERATE(values>({ - { boost::wintls::method::tlsv1, tls_version::tls_1_0 }, - { boost::wintls::method::tlsv1_client, tls_version::tls_1_0 }, - { boost::wintls::method::tlsv11, tls_version::tls_1_1 }, - { boost::wintls::method::tlsv11_client, tls_version::tls_1_1 }, - { boost::wintls::method::tlsv12, tls_version::tls_1_2 }, - { boost::wintls::method::tlsv12_client, tls_version::tls_1_2 }, - { boost::wintls::method::tlsv13, tls_version::tls_1_3 }, - { boost::wintls::method::tlsv13_client, tls_version::tls_1_3 } + const auto value = GENERATE(values>({ + { wintls::method::tlsv1, tls_version::tls_1_0 }, + { wintls::method::tlsv1_client, tls_version::tls_1_0 }, + { wintls::method::tlsv11, tls_version::tls_1_1 }, + { wintls::method::tlsv11_client, tls_version::tls_1_1 }, + { wintls::method::tlsv12, tls_version::tls_1_2 }, + { wintls::method::tlsv12_client, tls_version::tls_1_2 }, + { wintls::method::tlsv13, tls_version::tls_1_3 }, + { wintls::method::tlsv13_client, tls_version::tls_1_3 } }) ); const auto method = value.first; const auto version = value.second; - boost::wintls::context client_ctx(method); + wintls::context client_ctx(method); net::io_context io_context; - boost::wintls::stream client_stream(io_context, client_ctx); + wintls::stream client_stream(io_context, client_ctx); test_stream server_stream(io_context); client_stream.next_layer().connect(server_stream); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [method, &io_context](const error_code& ec) { if (ec.value() == SEC_E_ALGORITHM_MISMATCH) { WARN("Protocol not supported: " << method); diff --git a/test/main.cpp b/test/main.cpp index 6d6309bd..2c2878f8 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -4,7 +4,7 @@ #include "certificate.hpp" #include "unittest.hpp" -#include +#include #include #include @@ -15,8 +15,8 @@ int main(int argc, char* argv[]) { SetThreadUILanguage(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)); error_code ec; - boost::wintls::delete_private_key(test_key_name, ec); - boost::wintls::import_private_key(net::buffer(test_key), boost::wintls::file_format::pem, test_key_name, ec); + wintls::delete_private_key(test_key_name, ec); + wintls::import_private_key(net::buffer(test_key), wintls::file_format::pem, test_key_name, ec); if (ec) { std::cerr << "Unable to import private test key: " << ec.message() << "\n"; return EXIT_FAILURE; @@ -24,7 +24,7 @@ int main(int argc, char* argv[]) { int result = Catch::Session().run(argc, argv); - boost::wintls::delete_private_key(test_key_name, ec); + wintls::delete_private_key(test_key_name, ec); if (ec) { std::cerr << "Unable to delete private test key: " << ec.message() << "\n"; return EXIT_FAILURE; diff --git a/test/ocsp_responder.hpp b/test/ocsp_responder.hpp index 81ecbe00..52166d97 100644 --- a/test/ocsp_responder.hpp +++ b/test/ocsp_responder.hpp @@ -5,8 +5,8 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_OCSP_RESPONDER_HPP -#define BOOST_WINTLS_TEST_OCSP_RESPONDER_HPP +#ifndef WINTLS_TEST_OCSP_RESPONDER_HPP +#define WINTLS_TEST_OCSP_RESPONDER_HPP class ocsp_responder { public: @@ -17,4 +17,4 @@ class ocsp_responder { void* proc_handle_ = nullptr; }; -#endif // BOOST_WINTLS_TEST_OCSP_RESPONDER_HPP +#endif // WINTLS_TEST_OCSP_RESPONDER_HPP diff --git a/test/sspi_buffer_sequence_test.cpp b/test/sspi_buffer_sequence_test.cpp index 7286ce54..44b45dd1 100644 --- a/test/sspi_buffer_sequence_test.cpp +++ b/test/sspi_buffer_sequence_test.cpp @@ -7,12 +7,12 @@ #include "unittest.hpp" -#include +#include #include -using boost::wintls::detail::sspi_buffer; -using boost::wintls::detail::sspi_buffer_sequence; +using wintls::detail::sspi_buffer; +using wintls::detail::sspi_buffer_sequence; class test_buffer_sequence : public sspi_buffer_sequence<4> { public: @@ -26,10 +26,10 @@ class test_buffer_sequence : public sspi_buffer_sequence<4> { } }; -static_assert(boost::wintls::net::is_const_buffer_sequence::value, +static_assert(wintls::net::is_const_buffer_sequence::value, "ConstBufferSequence type requirements not met"); -static_assert(boost::wintls::net::is_mutable_buffer_sequence::value, +static_assert(wintls::net::is_mutable_buffer_sequence::value, "MutableBufferSequence type requirements not met"); TEST_CASE("sspi buffer sequence") { diff --git a/test/stream_test.cpp b/test/stream_test.cpp index ec0d0f0c..92f21a25 100644 --- a/test/stream_test.cpp +++ b/test/stream_test.cpp @@ -14,8 +14,8 @@ #include "async_echo_client.hpp" #include "async_echo_server.hpp" -#include -#include +#include +#include #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -41,19 +41,19 @@ TEST_CASE("moved stream") { net::io_context ioc; wintls_server_context server_ctx; - boost::wintls::stream moved_server_stream(ioc, server_ctx); - boost::wintls::stream server_stream(std::move(moved_server_stream)); + wintls::stream moved_server_stream(ioc, server_ctx); + wintls::stream server_stream(std::move(moved_server_stream)); wintls_client_context client_ctx; - boost::wintls::stream moved_client_stream(ioc, client_ctx); - boost::wintls::stream client_stream(std::move(moved_client_stream)); + wintls::stream moved_client_stream(ioc, client_ctx); + wintls::stream client_stream(std::move(moved_client_stream)); client_stream.next_layer().connect(server_stream.next_layer()); error_code client_ec{}; error_code server_ec{}; - server_stream.async_handshake(boost::wintls::handshake_type::server, + server_stream.async_handshake(wintls::handshake_type::server, [&server_ec, &server_stream](const error_code& ec) { server_ec = ec; if (ec) { @@ -61,7 +61,7 @@ TEST_CASE("moved stream") { } }); - client_stream.async_handshake(boost::wintls::handshake_type::client, + client_stream.async_handshake(wintls::handshake_type::client, [&client_ec, &client_stream](const error_code& ec) { client_ec = ec; if (ec) { @@ -74,20 +74,20 @@ TEST_CASE("moved stream") { } TEST_CASE("handshake not done") { - boost::wintls::context ctx{boost::wintls::method::system_default}; + wintls::context ctx{wintls::method::system_default}; net::io_context ioc; std::array buf{}; - boost::wintls::stream stream(ioc, ctx); + wintls::stream stream(ioc, ctx); error_code ec{}; SECTION("write fails") { - boost::wintls::net::write(stream, boost::wintls::net::buffer(buf), ec); + wintls::net::write(stream, wintls::net::buffer(buf), ec); CHECK(ec); } SECTION("async_write fails") { - boost::wintls::net::async_write(stream, boost::wintls::net::buffer(buf), + wintls::net::async_write(stream, wintls::net::buffer(buf), [&ec](const error_code& error, std::size_t) { ec = error; }); @@ -96,12 +96,12 @@ TEST_CASE("handshake not done") { } SECTION("read fails") { - boost::wintls::net::read(stream, boost::wintls::net::buffer(buf), ec); + wintls::net::read(stream, wintls::net::buffer(buf), ec); CHECK(ec); } SECTION("async_read fails") { - boost::wintls::net::async_read(stream, boost::wintls::net::buffer(buf), + wintls::net::async_read(stream, wintls::net::buffer(buf), [&ec](const error_code& error, std::size_t) { ec = error; }); @@ -117,7 +117,7 @@ TEST_CASE("underlying stream errors") { error_code client_ec{}; SECTION("handshake error") { - boost::wintls::test::fail_count fc(4); + wintls::test::fail_count fc(4); wintls_client_stream client(io_context, fc); client.stream.next_layer().connect(server.stream.next_layer()); @@ -129,7 +129,7 @@ TEST_CASE("underlying stream errors") { } SECTION("failing read/write") { - boost::wintls::test::fail_count fc(5); + wintls::test::fail_count fc(5); wintls_client_stream client(io_context, fc); client.stream.next_layer().connect(server.stream.next_layer()); @@ -160,7 +160,7 @@ TEST_CASE("underlying stream errors") { test_server server(io_context); SECTION("handshake error") { - boost::wintls::test::fail_count fc(4); + wintls::test::fail_count fc(4); wintls_client_stream client(io_context, fc); client.stream.next_layer().connect(server.stream.next_layer()); server.run(); @@ -173,7 +173,7 @@ TEST_CASE("underlying stream errors") { } SECTION("failing read/write") { - boost::wintls::test::fail_count fc(5); + wintls::test::fail_count fc(5); wintls_client_stream client(io_context, fc); client.stream.next_layer().connect(server.stream.next_layer()); net::streambuf buffer; diff --git a/test/test_stream/allocator.hpp b/test/test_stream/allocator.hpp index d9d31da5..e8ec4f2d 100644 --- a/test/test_stream/allocator.hpp +++ b/test/test_stream/allocator.hpp @@ -7,12 +7,11 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_ALLOCATOR_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_ALLOCATOR_HPP +#ifndef WINTLS_TEST_TEST_STREAM_ALLOCATOR_HPP +#define WINTLS_TEST_TEST_STREAM_ALLOCATOR_HPP #include -namespace boost { namespace wintls { namespace test { @@ -24,6 +23,5 @@ using allocator_traits = std::allocator_traits; } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_ALLOCATOR_HPP +#endif // WINTLS_TEST_TEST_STREAM_ALLOCATOR_HPP diff --git a/test/test_stream/config.hpp b/test/test_stream/config.hpp index 62ebfa1b..9cd42ae6 100644 --- a/test/test_stream/config.hpp +++ b/test/test_stream/config.hpp @@ -1,5 +1,5 @@ -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_CONFIG_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_CONFIG_HPP +#ifndef WINTLS_TEST_TEST_STREAM_CONFIG_HPP +#define WINTLS_TEST_TEST_STREAM_CONFIG_HPP #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -25,4 +25,4 @@ using error_category = boost::system::error_category; using error_condition = boost::system::error_condition; #endif // !WINTLS_USE_STANDALONE_ASIO -#endif // BOOST_WINTLS_TEST_TEST_STREAM_CONFIG_HPP +#endif // WINTLS_TEST_TEST_STREAM_CONFIG_HPP diff --git a/test/test_stream/empty_value.hpp b/test/test_stream/empty_value.hpp index 11cc2e1b..ba89f1af 100644 --- a/test/test_stream/empty_value.hpp +++ b/test/test_stream/empty_value.hpp @@ -5,12 +5,11 @@ Copyright 2018 Glen Joseph Fernandes Distributed under the Boost Software License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_EMPTY_VALUE_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_EMPTY_VALUE_HPP +#ifndef WINTLS_TEST_TEST_STREAM_EMPTY_VALUE_HPP +#define WINTLS_TEST_TEST_STREAM_EMPTY_VALUE_HPP #include -namespace boost { namespace wintls { namespace test { @@ -26,18 +25,18 @@ struct empty_init_t { }; namespace empty_ { template::value> + bool E = wintls::test::use_empty_value_base::value> class empty_value { public: typedef T type; empty_value() = default; - empty_value(boost::wintls::test::empty_init_t) + empty_value(wintls::test::empty_init_t) : value_() { } template - explicit empty_value(boost::wintls::test::empty_init_t, Args&&... args) + explicit empty_value(wintls::test::empty_init_t, Args&&... args) : value_(std::forward(args)...) { } const T& get() const noexcept { @@ -60,11 +59,11 @@ class empty_value empty_value() = default; - empty_value(boost::wintls::test::empty_init_t) + empty_value(wintls::test::empty_init_t) : T() { } template - explicit empty_value(boost::wintls::test::empty_init_t, Args&&... args) + explicit empty_value(wintls::test::empty_init_t, Args&&... args) : T(std::forward(args)...) { } const T& get() const noexcept { @@ -82,6 +81,5 @@ using empty_::empty_value; } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_EMPTY_VALUE_HPP +#endif // WINTLS_TEST_TEST_STREAM_EMPTY_VALUE_HPP diff --git a/test/test_stream/error.hpp b/test/test_stream/error.hpp index 399871de..d42c5d79 100644 --- a/test/test_stream/error.hpp +++ b/test/test_stream/error.hpp @@ -7,10 +7,9 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_ERROR_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_ERROR_HPP +#ifndef WINTLS_TEST_TEST_STREAM_ERROR_HPP +#define WINTLS_TEST_TEST_STREAM_ERROR_HPP -namespace boost { namespace wintls { namespace test { @@ -27,9 +26,8 @@ enum class error } // namespace test } // namespace wintls -} // namespace boost #include "impl/error.ipp" #include "impl/error.hpp" -#endif // BOOST_WINTLS_TEST_TEST_STREAM_ERROR_HPP +#endif // WINTLS_TEST_TEST_STREAM_ERROR_HPP diff --git a/test/test_stream/fail_count.hpp b/test/test_stream/fail_count.hpp index 6711c60a..82b295fa 100644 --- a/test/test_stream/fail_count.hpp +++ b/test/test_stream/fail_count.hpp @@ -7,14 +7,13 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_FAIL_COUNT_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_FAIL_COUNT_HPP +#ifndef WINTLS_TEST_TEST_STREAM_FAIL_COUNT_HPP +#define WINTLS_TEST_TEST_STREAM_FAIL_COUNT_HPP #include "config.hpp" #include "error.hpp" #include -namespace boost { namespace wintls { namespace test { @@ -61,8 +60,7 @@ class fail_count } // namespace test } // namespace wintls -} // namespace boost #include "impl/fail_count.ipp" -#endif // BOOST_WINTLS_TEST_TEST_STREAM_FAIL_COUNT_HPP +#endif // WINTLS_TEST_TEST_STREAM_FAIL_COUNT_HPP diff --git a/test/test_stream/flat_buffer.hpp b/test/test_stream/flat_buffer.hpp index e418588e..4e1c9cd8 100644 --- a/test/test_stream/flat_buffer.hpp +++ b/test/test_stream/flat_buffer.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_FLAT_BUFFER_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_FLAT_BUFFER_HPP +#ifndef WINTLS_TEST_TEST_STREAM_FLAT_BUFFER_HPP +#define WINTLS_TEST_TEST_STREAM_FLAT_BUFFER_HPP #include "empty_value.hpp" #include "allocator.hpp" @@ -17,7 +17,6 @@ #include #include -namespace boost { namespace wintls { namespace test { @@ -56,22 +55,22 @@ namespace test { */ template class basic_flat_buffer - : private boost::wintls::test::empty_value< - typename boost::wintls::test::allocator_traits:: + : private wintls::test::empty_value< + typename wintls::test::allocator_traits:: template rebind_alloc> { template friend class basic_flat_buffer; using base_alloc_type = typename - boost::wintls::test::allocator_traits:: + wintls::test::allocator_traits:: template rebind_alloc; static bool constexpr default_nothrow = std::is_nothrow_default_constructible::value; using alloc_traits = - boost::wintls::test::allocator_traits; + wintls::test::allocator_traits; using pocma = typename alloc_traits::propagate_on_container_move_assignment; @@ -525,8 +524,7 @@ using flat_buffer = } // namespace test } // namespace wintls -} // namespace boost #include "impl/flat_buffer.hpp" -#endif // BOOST_WINTLS_TEST_TEST_STREAM_FLAT_BUFFER_HPP +#endif // WINTLS_TEST_TEST_STREAM_FLAT_BUFFER_HPP diff --git a/test/test_stream/impl/error.hpp b/test/test_stream/impl/error.hpp index 905c4c27..3b3b064d 100644 --- a/test/test_stream/impl/error.hpp +++ b/test/test_stream/impl/error.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_ERROR_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_ERROR_HPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_ERROR_HPP +#define WINTLS_TEST_TEST_STREAM_IMPL_ERROR_HPP #include @@ -16,7 +16,7 @@ namespace std { template<> struct is_error_code_enum< - boost::wintls::test::error> + wintls::test::error> : std::true_type { }; @@ -26,7 +26,7 @@ namespace boost { namespace system { template<> struct is_error_code_enum< - boost::wintls::test::error> + wintls::test::error> : std::true_type { }; @@ -34,7 +34,6 @@ struct is_error_code_enum< } // boost #endif // !WINTLS_USE_STANDALONE_ASIO -namespace boost { namespace wintls { namespace test { @@ -44,6 +43,5 @@ make_error_code(error e) noexcept; } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_ERROR_HPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_ERROR_HPP diff --git a/test/test_stream/impl/error.ipp b/test/test_stream/impl/error.ipp index a8ee7de2..8448bf3a 100644 --- a/test/test_stream/impl/error.ipp +++ b/test/test_stream/impl/error.ipp @@ -7,12 +7,11 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_ERROR_IPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_ERROR_IPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_ERROR_IPP +#define WINTLS_TEST_TEST_STREAM_IMPL_ERROR_IPP #include "error.hpp" -namespace boost { namespace wintls { namespace test { @@ -48,15 +47,14 @@ public: inline error_code -make_error_code(boost::wintls::test::error e) noexcept +make_error_code(wintls::test::error e) noexcept { - static boost::wintls::test::error_codes const cat{}; + static wintls::test::error_codes const cat{}; return error_code{static_cast< std::underlying_type::type>(e), cat}; } } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_ERROR_IPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_ERROR_IPP diff --git a/test/test_stream/impl/fail_count.ipp b/test/test_stream/impl/fail_count.ipp index c3cafdda..3351bbdc 100644 --- a/test/test_stream/impl/fail_count.ipp +++ b/test/test_stream/impl/fail_count.ipp @@ -7,10 +7,9 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_FAIL_COUNT_IPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_FAIL_COUNT_IPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_FAIL_COUNT_IPP +#define WINTLS_TEST_TEST_STREAM_IMPL_FAIL_COUNT_IPP -namespace boost { namespace wintls { namespace test { @@ -50,6 +49,5 @@ fail(error_code& ec) } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_FAIL_COUNT_IPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_FAIL_COUNT_IPP diff --git a/test/test_stream/impl/flat_buffer.hpp b/test/test_stream/impl/flat_buffer.hpp index 83c0883a..eeb207c6 100644 --- a/test/test_stream/impl/flat_buffer.hpp +++ b/test/test_stream/impl/flat_buffer.hpp @@ -7,13 +7,12 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_FLAT_BUFFER_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_FLAT_BUFFER_HPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_FLAT_BUFFER_HPP +#define WINTLS_TEST_TEST_STREAM_IMPL_FLAT_BUFFER_HPP #include #include -namespace boost { namespace wintls { namespace test { @@ -527,6 +526,5 @@ alloc(std::size_t n) } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_FLAT_BUFFER_HPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_FLAT_BUFFER_HPP diff --git a/test/test_stream/impl/is_invocable.hpp b/test/test_stream/impl/is_invocable.hpp index 0c1bf9e8..f54777bc 100644 --- a/test/test_stream/impl/is_invocable.hpp +++ b/test/test_stream/impl/is_invocable.hpp @@ -7,13 +7,12 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_IS_INVOCABLE_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_IS_INVOCABLE_HPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_IS_INVOCABLE_HPP +#define WINTLS_TEST_TEST_STREAM_IMPL_IS_INVOCABLE_HPP #include #include -namespace boost { namespace wintls { namespace test { @@ -53,6 +52,5 @@ struct is_invocable } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_IS_INVOCABLE_HPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_IS_INVOCABLE_HPP diff --git a/test/test_stream/impl/service_base.hpp b/test/test_stream/impl/service_base.hpp index 3e06f3e1..278a4c48 100644 --- a/test/test_stream/impl/service_base.hpp +++ b/test/test_stream/impl/service_base.hpp @@ -7,10 +7,9 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_SERVICE_BASE_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_SERVICE_BASE_HPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_SERVICE_BASE_HPP +#define WINTLS_TEST_TEST_STREAM_IMPL_SERVICE_BASE_HPP -namespace boost { namespace wintls { namespace test { @@ -31,6 +30,5 @@ net::execution_context::id const service_base::id; } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_SERVICE_BASE_HPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_SERVICE_BASE_HPP diff --git a/test/test_stream/impl/stream.hpp b/test/test_stream/impl/stream.hpp index 575bd912..1d536983 100644 --- a/test/test_stream/impl/stream.hpp +++ b/test/test_stream/impl/stream.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_STREAM_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_STREAM_HPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_STREAM_HPP +#define WINTLS_TEST_TEST_STREAM_IMPL_STREAM_HPP #include "service_base.hpp" #include "is_invocable.hpp" @@ -16,7 +16,6 @@ #include #include -namespace boost { namespace wintls { namespace test { @@ -164,7 +163,7 @@ struct stream::run_read_op // requirements for the handler. static_assert( - boost::wintls::test::is_invocable::value, "ReadHandler type requirements not met"); @@ -197,7 +196,7 @@ struct stream::run_write_op // that your handler does not meet the documented type // requirements for the handler. static_assert( - boost::wintls::test::is_invocable::value, "WriteHandler type requirements not met"); @@ -450,6 +449,5 @@ connect(stream& to, Arg1&& arg1, ArgN&&... argn) } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_STREAM_HPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_STREAM_HPP diff --git a/test/test_stream/impl/stream.ipp b/test/test_stream/impl/stream.ipp index 5f90f1f7..d9851e02 100644 --- a/test/test_stream/impl/stream.ipp +++ b/test/test_stream/impl/stream.ipp @@ -7,14 +7,13 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_IMPL_STREAM_IPP -#define BOOST_WINTLS_TEST_TEST_STREAM_IMPL_STREAM_IPP +#ifndef WINTLS_TEST_TEST_STREAM_IMPL_STREAM_IPP +#define WINTLS_TEST_TEST_STREAM_IMPL_STREAM_IPP #include #include #include -namespace boost { namespace wintls { namespace test { @@ -368,6 +367,5 @@ connect(stream& s1, stream& s2) } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_IMPL_STREAM_IPP +#endif // WINTLS_TEST_TEST_STREAM_IMPL_STREAM_IPP diff --git a/test/test_stream/role.hpp b/test/test_stream/role.hpp index 9675e5e7..5de04ee6 100644 --- a/test/test_stream/role.hpp +++ b/test/test_stream/role.hpp @@ -7,10 +7,9 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_ROLE_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_ROLE_HPP +#ifndef WINTLS_TEST_TEST_STREAM_ROLE_HPP +#define WINTLS_TEST_TEST_STREAM_ROLE_HPP -namespace boost { namespace wintls { namespace test { @@ -45,6 +44,5 @@ enum class role_type } // namespace test } // namespace wintls -} // namespace boost -#endif // BOOST_WINTLS_TEST_TEST_STREAM_ROLE_HPP +#endif // WINTLS_TEST_TEST_STREAM_ROLE_HPP diff --git a/test/test_stream/stream.hpp b/test/test_stream/stream.hpp index 74d67773..0b0ddbaf 100644 --- a/test/test_stream/stream.hpp +++ b/test/test_stream/stream.hpp @@ -7,8 +7,8 @@ // Official repository: https://github.com/boostorg/beast // -#ifndef BOOST_WINTLS_TEST_TEST_STREAM_STREAM_HPP -#define BOOST_WINTLS_TEST_TEST_STREAM_STREAM_HPP +#ifndef WINTLS_TEST_TEST_STREAM_STREAM_HPP +#define WINTLS_TEST_TEST_STREAM_STREAM_HPP #ifdef WINTLS_USE_STANDALONE_ASIO #include @@ -53,8 +53,8 @@ using error_code = std::error_code; namespace asio { namespace ssl { template class stream; -} // ssl -} // asio +} // namespace ssl +} // namespace asio #else // WINTLS_USE_STANDALONE_ASIO namespace net = boost::asio; using system_error = boost::system::system_error; @@ -64,12 +64,11 @@ namespace boost { namespace asio { namespace ssl { template class stream; -} // ssl -} // asio -} // boost +} // namespace ssl +} // namespace asio +} // namespace boost #endif // !WINTLS_USE_STANDALONE_ASIO -namespace boost { namespace wintls { namespace test { @@ -626,7 +625,6 @@ connect(stream& to, Arg1&& arg1, ArgN&&... argn); } // namespace test } // namespace wintls -} // namespace boost #include "impl/stream.hpp" #include "impl/stream.ipp" diff --git a/test/tls_record.cpp b/test/tls_record.cpp index effe1d8d..203bea94 100644 --- a/test/tls_record.cpp +++ b/test/tls_record.cpp @@ -5,7 +5,7 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#include +#include #include "tls_record.hpp" namespace { diff --git a/test/tls_record.hpp b/test/tls_record.hpp index 17d2c2d0..6104d6f7 100644 --- a/test/tls_record.hpp +++ b/test/tls_record.hpp @@ -4,8 +4,8 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_TLS_RECORD_HPP -#define BOOST_WINTLS_TEST_TLS_RECORD_HPP +#ifndef WINTLS_TEST_TLS_RECORD_HPP +#define WINTLS_TEST_TLS_RECORD_HPP #include "unittest.hpp" @@ -134,4 +134,4 @@ struct tls_record { message_type message; }; -#endif // BOOST_WINTLS_TEST_TLS_RECORD_HPP +#endif // WINTLS_TEST_TLS_RECORD_HPP diff --git a/test/unittest.hpp b/test/unittest.hpp index ba8ccad4..a8d7c88e 100644 --- a/test/unittest.hpp +++ b/test/unittest.hpp @@ -4,10 +4,10 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_UNITTEST_HPP -#define BOOST_WINTLS_TEST_UNITTEST_HPP +#ifndef WINTLS_TEST_UNITTEST_HPP +#define WINTLS_TEST_UNITTEST_HPP -#include +#include #include "test_stream/stream.hpp" @@ -43,12 +43,12 @@ inline std::vector bytes_from_file(const std::string& path) { return {std::istreambuf_iterator{ifs}, {}}; } -namespace net = boost::wintls::net; +namespace net = wintls::net; #ifdef WINTLS_USE_STANDALONE_ASIO namespace asio_ssl = asio::ssl; #else // WINTLS_USE_STANDALONE_ASIO namespace asio_ssl = boost::asio::ssl; #endif // !WINTLS_USE_STANDALONE_ASIO -using test_stream = boost::wintls::test::stream; +using test_stream = wintls::test::stream; -#endif // BOOST_WINTLS_TEST_UNITTEST_HPP +#endif // WINTLS_TEST_UNITTEST_HPP diff --git a/test/wintls_client_stream.hpp b/test/wintls_client_stream.hpp index f55e1fcf..c9ab903a 100644 --- a/test/wintls_client_stream.hpp +++ b/test/wintls_client_stream.hpp @@ -4,29 +4,29 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_WINTLS_CLIENT_STREAM_HPP -#define BOOST_WINTLS_TEST_WINTLS_CLIENT_STREAM_HPP +#ifndef WINTLS_TEST_WINTLS_CLIENT_STREAM_HPP +#define WINTLS_TEST_WINTLS_CLIENT_STREAM_HPP #include "certificate.hpp" #include "unittest.hpp" -#include +#include #include #include const std::string test_key_name_client = test_key_name + "-client"; -struct wintls_client_context : public boost::wintls::context { +struct wintls_client_context : public wintls::context { wintls_client_context() - : boost::wintls::context(boost::wintls::method::system_default) + : wintls::context(wintls::method::system_default) , needs_private_key_clean_up_(false) , authority_ptr_() { } void with_test_cert_authority() { if(!authority_ptr_) { - authority_ptr_ = x509_to_cert_context(net::buffer(test_certificate), boost::wintls::file_format::pem); + authority_ptr_ = x509_to_cert_context(net::buffer(test_certificate), wintls::file_format::pem); add_certificate_authority(authority_ptr_.get()); } } @@ -36,11 +36,11 @@ struct wintls_client_context : public boost::wintls::context { // delete key in case last test run has dangling key. error_code dummy; - boost::wintls::delete_private_key(test_key_name_client, dummy); + wintls::delete_private_key(test_key_name_client, dummy); - boost::wintls::import_private_key(net::buffer(test_key), boost::wintls::file_format::pem, test_key_name_client); + wintls::import_private_key(net::buffer(test_key), wintls::file_format::pem, test_key_name_client); needs_private_key_clean_up_ = true; - boost::wintls::assign_private_key(authority_ptr_.get(), test_key_name_client); + wintls::assign_private_key(authority_ptr_.get(), test_key_name_client); use_certificate(authority_ptr_.get()); } @@ -50,18 +50,18 @@ struct wintls_client_context : public boost::wintls::context { ~wintls_client_context() { if(needs_private_key_clean_up_) { - boost::wintls::delete_private_key(test_key_name_client); + wintls::delete_private_key(test_key_name_client); needs_private_key_clean_up_ = false; } } private: bool needs_private_key_clean_up_; - boost::wintls::cert_context_ptr authority_ptr_; + wintls::cert_context_ptr authority_ptr_; }; struct wintls_client_stream { - using handshake_type = boost::wintls::handshake_type; + using handshake_type = wintls::handshake_type; template wintls_client_stream(Args&&... args) @@ -71,7 +71,7 @@ struct wintls_client_stream { wintls_client_context ctx; test_stream tst; - boost::wintls::stream stream; + wintls::stream stream; }; -#endif // BOOST_WINTLS_TEST_WINTLS_CLIENT_STREAM_HPP +#endif // WINTLS_TEST_WINTLS_CLIENT_STREAM_HPP diff --git a/test/wintls_server_stream.hpp b/test/wintls_server_stream.hpp index be8f76ca..53b959ff 100644 --- a/test/wintls_server_stream.hpp +++ b/test/wintls_server_stream.hpp @@ -4,28 +4,28 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef BOOST_WINTLS_TEST_WINTLS_SERVER_STREAM_HPP -#define BOOST_WINTLS_TEST_WINTLS_SERVER_STREAM_HPP +#ifndef WINTLS_TEST_WINTLS_SERVER_STREAM_HPP +#define WINTLS_TEST_WINTLS_SERVER_STREAM_HPP #include "unittest.hpp" #include "certificate.hpp" -#include +#include const std::string test_key_name_server = test_key_name + "-server"; -struct wintls_server_context : public boost::wintls::context { +struct wintls_server_context : public wintls::context { wintls_server_context() - : boost::wintls::context(boost::wintls::method::system_default) + : wintls::context(wintls::method::system_default) , needs_private_key_clean_up_(false) { // delete key in case last test run has dangling key. error_code dummy; - boost::wintls::delete_private_key(test_key_name_server, dummy); + wintls::delete_private_key(test_key_name_server, dummy); - auto cert_ptr = x509_to_cert_context(net::buffer(test_certificate), boost::wintls::file_format::pem); - boost::wintls::import_private_key(net::buffer(test_key), boost::wintls::file_format::pem, test_key_name_server); + auto cert_ptr = x509_to_cert_context(net::buffer(test_certificate), wintls::file_format::pem); + wintls::import_private_key(net::buffer(test_key), wintls::file_format::pem, test_key_name_server); needs_private_key_clean_up_ = true; - boost::wintls::assign_private_key(cert_ptr.get(), test_key_name_server); + wintls::assign_private_key(cert_ptr.get(), test_key_name_server); add_certificate_authority(cert_ptr.get()); use_certificate(cert_ptr.get()); } @@ -36,7 +36,7 @@ struct wintls_server_context : public boost::wintls::context { ~wintls_server_context() { if(needs_private_key_clean_up_) { - boost::wintls::delete_private_key(test_key_name_server); + wintls::delete_private_key(test_key_name_server); needs_private_key_clean_up_ = false; } } @@ -46,7 +46,7 @@ struct wintls_server_context : public boost::wintls::context { }; struct wintls_server_stream { - using handshake_type = boost::wintls::handshake_type; + using handshake_type = wintls::handshake_type; template wintls_server_stream(Args&&... args) @@ -56,7 +56,7 @@ struct wintls_server_stream { wintls_server_context ctx; test_stream tst; - boost::wintls::stream stream; + wintls::stream stream; }; -#endif // BOOST_WINTLS_TEST_WINTLS_SERVER_STREAM_HPP +#endif // WINTLS_TEST_WINTLS_SERVER_STREAM_HPP