public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/R-AsioHeaders] rawhide: Backport removal of code that fails with OpenSSL 4
Date: Mon, 27 Jul 2026 07:20:47 GMT	[thread overview]
Message-ID: <178513684774.1.11607989896791044018.rpms-R-AsioHeaders-8ae4f2ad6002@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/R-AsioHeaders
Branch : rawhide
Commit : 8ae4f2ad6002c65849e9959616dfb719345c5671
Author : Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date   : 2026-07-27T03:20:26-04:00
Stats  : +323/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/R-AsioHeaders/c/8ae4f2ad6002c65849e9959616dfb719345c5671?branch=rawhide

Log:
Backport removal of code that fails with OpenSSL 4

---
diff --git a/R-AsioHeaders.spec b/R-AsioHeaders.spec
index 4ac5024..35c9841 100644
--- a/R-AsioHeaders.spec
+++ b/R-AsioHeaders.spec
@@ -6,6 +6,8 @@ Summary:        Asio C++ Header Files
 License:        BSL-1.0
 URL:            %{cran_url}
 Source:         %{cran_source}
+# Backport fix for failure with OpenSSL 4.
+Patch:          https://github.com/chriskohlhoff/asio/commit/ae27080e5eab4ab41b1784a927248bf2933186b5.patch
 
 BuildArch:      noarch
 BuildRequires:  R-devel
@@ -24,7 +26,9 @@ compiler). 'Asio' is written and maintained by Christopher M. Kohlhoff, and
 released under the 'Boost Software License', Version 1.0.
 
 %prep
-%autosetup -c
+%autosetup -c -N
+cd AsioHeaders/inst/include
+%autopatch -p3
 
 %generate_buildrequires
 %R_buildrequires

diff --git a/ae27080e5eab4ab41b1784a927248bf2933186b5.patch b/ae27080e5eab4ab41b1784a927248bf2933186b5.patch
new file mode 100644
index 0000000..edcfa05
--- /dev/null
+++ b/ae27080e5eab4ab41b1784a927248bf2933186b5.patch
@@ -0,0 +1,318 @@
+From ae27080e5eab4ab41b1784a927248bf2933186b5 Mon Sep 17 00:00:00 2001
+From: Christopher Kohlhoff <chris@kohlhoff.com>
+Date: Mon, 21 Oct 2024 22:02:46 +1100
+Subject: [PATCH] Remove deprecated class ssl::rfc2818_verification.
+
+---
+ asio/include/Makefile.am                      |   2 -
+ asio/include/asio/ssl.hpp                     |   1 -
+ .../asio/ssl/impl/rfc2818_verification.ipp    | 164 ------------------
+ asio/include/asio/ssl/impl/src.hpp            |   1 -
+ .../include/asio/ssl/rfc2818_verification.hpp |  98 -----------
+ asio/src/Makefile.msc                         |   1 -
+ asio/src/doc/quickref.xml                     |   1 -
+ asio/src/tests/Makefile.am                    |   3 -
+ asio/src/tests/unit/ssl/.gitignore            |   1 -
+ .../tests/unit/ssl/rfc2818_verification.cpp   |  25 ---
+ 10 files changed, 297 deletions(-)
+ delete mode 100644 asio/include/asio/ssl/impl/rfc2818_verification.ipp
+ delete mode 100644 asio/include/asio/ssl/rfc2818_verification.hpp
+ delete mode 100644 asio/src/tests/unit/ssl/rfc2818_verification.cpp
+
+diff --git a/asio/include/asio/ssl.hpp b/asio/include/asio/ssl.hpp
+index 4180dab6f4..3de9504ab3 100644
+--- a/asio/include/asio/ssl.hpp
++++ b/asio/include/asio/ssl.hpp
+@@ -18,7 +18,6 @@
+ #include "asio/ssl/context.hpp"
+ #include "asio/ssl/context_base.hpp"
+ #include "asio/ssl/error.hpp"
+-#include "asio/ssl/rfc2818_verification.hpp"
+ #include "asio/ssl/host_name_verification.hpp"
+ #include "asio/ssl/stream.hpp"
+ #include "asio/ssl/stream_base.hpp"
+diff --git a/asio/include/asio/ssl/impl/rfc2818_verification.ipp b/asio/include/asio/ssl/impl/rfc2818_verification.ipp
+deleted file mode 100644
+index 93e161daa8..0000000000
+--- a/asio/include/asio/ssl/impl/rfc2818_verification.ipp
++++ /dev/null
+@@ -1,164 +0,0 @@
+-//
+-// ssl/impl/rfc2818_verification.ipp
+-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-//
+-// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+-//
+-// 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 ASIO_SSL_IMPL_RFC2818_VERIFICATION_IPP
+-#define ASIO_SSL_IMPL_RFC2818_VERIFICATION_IPP
+-
+-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+-# pragma once
+-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+-
+-#include "asio/detail/config.hpp"
+-
+-#if !defined(ASIO_NO_DEPRECATED)
+-
+-#include <cctype>
+-#include <cstring>
+-#include "asio/ip/address.hpp"
+-#include "asio/ssl/rfc2818_verification.hpp"
+-#include "asio/ssl/detail/openssl_types.hpp"
+-
+-#include "asio/detail/push_options.hpp"
+-
+-namespace asio {
+-namespace ssl {
+-
+-bool rfc2818_verification::operator()(
+-    bool preverified, verify_context& ctx) const
+-{
+-  using namespace std; // For memcmp.
+-
+-  // Don't bother looking at certificates that have failed pre-verification.
+-  if (!preverified)
+-    return false;
+-
+-  // We're only interested in checking the certificate at the end of the chain.
+-  int depth = X509_STORE_CTX_get_error_depth(ctx.native_handle());
+-  if (depth > 0)
+-    return true;
+-
+-  // Try converting the host name to an address. If it is an address then we
+-  // need to look for an IP address in the certificate rather than a host name.
+-  asio::error_code ec;
+-  ip::address address = ip::make_address(host_, ec);
+-  bool is_address = !ec;
+-
+-  X509* cert = X509_STORE_CTX_get_current_cert(ctx.native_handle());
+-
+-  // Go through the alternate names in the certificate looking for matching DNS
+-  // or IP address entries.
+-  GENERAL_NAMES* gens = static_cast<GENERAL_NAMES*>(
+-      X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0));
+-  for (int i = 0; i < sk_GENERAL_NAME_num(gens); ++i)
+-  {
+-    GENERAL_NAME* gen = sk_GENERAL_NAME_value(gens, i);
+-    if (gen->type == GEN_DNS && !is_address)
+-    {
+-      ASN1_IA5STRING* domain = gen->d.dNSName;
+-      if (domain->type == V_ASN1_IA5STRING && domain->data && domain->length)
+-      {
+-        const char* pattern = reinterpret_cast<const char*>(domain->data);
+-        std::size_t pattern_length = domain->length;
+-        if (match_pattern(pattern, pattern_length, host_.c_str()))
+-        {
+-          GENERAL_NAMES_free(gens);
+-          return true;
+-        }
+-      }
+-    }
+-    else if (gen->type == GEN_IPADD && is_address)
+-    {
+-      ASN1_OCTET_STRING* ip_address = gen->d.iPAddress;
+-      if (ip_address->type == V_ASN1_OCTET_STRING && ip_address->data)
+-      {
+-        if (address.is_v4() && ip_address->length == 4)
+-        {
+-          ip::address_v4::bytes_type bytes = address.to_v4().to_bytes();
+-          if (memcmp(bytes.data(), ip_address->data, 4) == 0)
+-          {
+-            GENERAL_NAMES_free(gens);
+-            return true;
+-          }
+-        }
+-        else if (address.is_v6() && ip_address->length == 16)
+-        {
+-          ip::address_v6::bytes_type bytes = address.to_v6().to_bytes();
+-          if (memcmp(bytes.data(), ip_address->data, 16) == 0)
+-          {
+-            GENERAL_NAMES_free(gens);
+-            return true;
+-          }
+-        }
+-      }
+-    }
+-  }
+-  GENERAL_NAMES_free(gens);
+-
+-  // No match in the alternate names, so try the common names. We should only
+-  // use the "most specific" common name, which is the last one in the list.
+-  X509_NAME* name = X509_get_subject_name(cert);
+-  int i = -1;
+-  ASN1_STRING* common_name = 0;
+-  while ((i = X509_NAME_get_index_by_NID(name, NID_commonName, i)) >= 0)
+-  {
+-    X509_NAME_ENTRY* name_entry = X509_NAME_get_entry(name, i);
+-    common_name = X509_NAME_ENTRY_get_data(name_entry);
+-  }
+-  if (common_name && common_name->data && common_name->length)
+-  {
+-    const char* pattern = reinterpret_cast<const char*>(common_name->data);
+-    std::size_t pattern_length = common_name->length;
+-    if (match_pattern(pattern, pattern_length, host_.c_str()))
+-      return true;
+-  }
+-
+-  return false;
+-}
+-
+-bool rfc2818_verification::match_pattern(const char* pattern,
+-    std::size_t pattern_length, const char* host)
+-{
+-  using namespace std; // For tolower.
+-
+-  const char* p = pattern;
+-  const char* p_end = p + pattern_length;
+-  const char* h = host;
+-
+-  while (p != p_end && *h)
+-  {
+-    if (*p == '*')
+-    {
+-      ++p;
+-      while (*h && *h != '.')
+-        if (match_pattern(p, p_end - p, h++))
+-          return true;
+-    }
+-    else if (tolower(*p) == tolower(*h))
+-    {
+-      ++p;
+-      ++h;
+-    }
+-    else
+-    {
+-      return false;
+-    }
+-  }
+-
+-  return p == p_end && !*h;
+-}
+-
+-} // namespace ssl
+-} // namespace asio
+-
+-#include "asio/detail/pop_options.hpp"
+-
+-#endif // !defined(ASIO_NO_DEPRECATED)
+-
+-#endif // ASIO_SSL_IMPL_RFC2818_VERIFICATION_IPP
+diff --git a/asio/include/asio/ssl/impl/src.hpp b/asio/include/asio/ssl/impl/src.hpp
+index 5ffb95fdcd..26c79c515d 100644
+--- a/asio/include/asio/ssl/impl/src.hpp
++++ b/asio/include/asio/ssl/impl/src.hpp
+@@ -24,6 +24,5 @@
+ #include "asio/ssl/detail/impl/engine.ipp"
+ #include "asio/ssl/detail/impl/openssl_init.ipp"
+ #include "asio/ssl/impl/host_name_verification.ipp"
+-#include "asio/ssl/impl/rfc2818_verification.ipp"
+ 
+ #endif // ASIO_SSL_IMPL_SRC_HPP
+diff --git a/asio/include/asio/ssl/rfc2818_verification.hpp b/asio/include/asio/ssl/rfc2818_verification.hpp
+deleted file mode 100644
+index db2831045d..0000000000
+--- a/asio/include/asio/ssl/rfc2818_verification.hpp
++++ /dev/null
+@@ -1,98 +0,0 @@
+-//
+-// ssl/rfc2818_verification.hpp
+-// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-//
+-// Copyright (c) 2003-2024 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+-//
+-// 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 ASIO_SSL_RFC2818_VERIFICATION_HPP
+-#define ASIO_SSL_RFC2818_VERIFICATION_HPP
+-
+-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+-# pragma once
+-#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
+-
+-#include "asio/detail/config.hpp"
+-
+-#if !defined(ASIO_NO_DEPRECATED)
+-
+-#include <string>
+-#include "asio/ssl/detail/openssl_types.hpp"
+-#include "asio/ssl/verify_context.hpp"
+-
+-#include "asio/detail/push_options.hpp"
+-
+-namespace asio {
+-namespace ssl {
+-
+-/// (Deprecated. Use ssl::host_name_verification.) Verifies a certificate
+-/// against a hostname according to the rules described in RFC 2818.
+-/**
+- * @par Example
+- * The following example shows how to synchronously open a secure connection to
+- * a given host name:
+- * @code
+- * using asio::ip::tcp;
+- * namespace ssl = asio::ssl;
+- * typedef ssl::stream<tcp::socket> ssl_socket;
+- *
+- * // Create a context that uses the default paths for finding CA certificates.
+- * ssl::context ctx(ssl::context::sslv23);
+- * ctx.set_default_verify_paths();
+- *
+- * // Open a socket and connect it to the remote host.
+- * asio::io_context io_context;
+- * ssl_socket sock(io_context, ctx);
+- * tcp::resolver resolver(io_context);
+- * tcp::resolver::query query("host.name", "https");
+- * asio::connect(sock.lowest_layer(), resolver.resolve(query));
+- * sock.lowest_layer().set_option(tcp::no_delay(true));
+- *
+- * // Perform SSL handshake and verify the remote host's certificate.
+- * sock.set_verify_mode(ssl::verify_peer);
+- * sock.set_verify_callback(ssl::rfc2818_verification("host.name"));
+- * sock.handshake(ssl_socket::client);
+- *
+- * // ... read and write as normal ...
+- * @endcode
+- */
+-class rfc2818_verification
+-{
+-public:
+-  /// The type of the function object's result.
+-  typedef bool result_type;
+-
+-  /// Constructor.
+-  explicit rfc2818_verification(const std::string& host)
+-    : host_(host)
+-  {
+-  }
+-
+-  /// Perform certificate verification.
+-  ASIO_DECL bool operator()(bool preverified, verify_context& ctx) const;
+-
+-private:
+-  // Helper function to check a host name against a pattern.
+-  ASIO_DECL static bool match_pattern(const char* pattern,
+-      std::size_t pattern_length, const char* host);
+-
+-  // Helper function to check a host name against an IPv4 address
+-  // The host name to be checked.
+-  std::string host_;
+-};
+-
+-} // namespace ssl
+-} // namespace asio
+-
+-#include "asio/detail/pop_options.hpp"
+-
+-#if defined(ASIO_HEADER_ONLY)
+-# include "asio/ssl/impl/rfc2818_verification.ipp"
+-#endif // defined(ASIO_HEADER_ONLY)
+-
+-#endif // !defined(ASIO_NO_DEPRECATED)
+-
+-#endif // ASIO_SSL_RFC2818_VERIFICATION_HPP

                 reply	other threads:[~2026-07-27  7:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178513684774.1.11607989896791044018.rpms-R-AsioHeaders-8ae4f2ad6002@fedoraproject.org \
    --to=quantum.analyst@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox