From f875121b078d7db00357e9926ddec1bc187df9dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meusel?= Date: Wed, 28 Feb 2018 14:27:25 +0100 Subject: [PATCH 1/2] FIX: compile on linux --- Release/include/cpprest/details/x509_cert_utilities.h | 7 +++++-- Release/src/http/client/x509_cert_utilities.cpp | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Release/include/cpprest/details/x509_cert_utilities.h b/Release/include/cpprest/details/x509_cert_utilities.h index f07f20091f..bca584883c 100644 --- a/Release/include/cpprest/details/x509_cert_utilities.h +++ b/Release/include/cpprest/details/x509_cert_utilities.h @@ -16,7 +16,7 @@ #include #include "cpprest/certificate_info.h" -#if defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) +#if defined(__linux__) || defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) #if defined(_MSC_VER) #pragma warning(push) @@ -38,6 +38,7 @@ namespace web { namespace http { namespace client { namespace details { using namespace utility; +#if !defined(__linux__) bool is_end_certificate_in_chain(boost::asio::ssl::verify_context &verifyCtx); @@ -49,9 +50,11 @@ bool is_end_certificate_in_chain(boost::asio::ssl::verify_context &verifyCtx); /// Host name from the URI. /// True if verification passed and server can be trusted, false otherwise. bool verify_cert_chain_platform_specific(boost::asio::ssl::verify_context &verifyCtx, const std::string &hostName, const CertificateChainFunction& func = nullptr); - bool verify_X509_cert_chain(const std::vector &certChain, const std::string &hostName, const CertificateChainFunction& func = nullptr); +#endif + + std::vector> get_X509_cert_chain_encoded_data(boost::asio::ssl::verify_context &verifyCtx); }}}} diff --git a/Release/src/http/client/x509_cert_utilities.cpp b/Release/src/http/client/x509_cert_utilities.cpp index ecfe4a58b4..ef8af05f0c 100644 --- a/Release/src/http/client/x509_cert_utilities.cpp +++ b/Release/src/http/client/x509_cert_utilities.cpp @@ -13,7 +13,7 @@ #include "stdafx.h" -#if defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) +#if defined(__linux__) || defined(__APPLE__) || (defined(ANDROID) || defined(__ANDROID__)) || (defined(_WIN32) && !defined(__cplusplus_winrt) && !defined(_M_ARM) && !defined(CPPREST_EXCLUDE_WEBSOCKETS)) #include "cpprest/details/x509_cert_utilities.h" #include @@ -40,6 +40,8 @@ namespace web { namespace http { namespace client { namespace details { +#if !defined(__linux__) + bool is_end_certificate_in_chain(boost::asio::ssl::verify_context &verifyCtx) { X509_STORE_CTX *storeContext = verifyCtx.native_handle(); @@ -104,6 +106,8 @@ bool verify_cert_chain_platform_specific(boost::asio::ssl::verify_context &verif return verify_result; } +#endif + #if defined(ANDROID) || defined(__ANDROID__) using namespace crossplat; From 9aa9ae5a1d6c36f80ffc40753f799979f0f51b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meusel?= Date: Wed, 28 Feb 2018 15:19:12 +0100 Subject: [PATCH 2/2] amend contributers file --- CONTRIBUTORS.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 2699c0d53d..8f5fdada71 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -40,6 +40,10 @@ Chris O'Gorman (chogorma) Ocedo GmbH Henning Pfeiffer (megaposer) +neXenio GmbH +Patrik Fiedler (xqp) +René Meusel (reneme) + thomasschaub Trimble