This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e2c9a3f98 Address incompatibility with BoringSSL (#12943)
2e2c9a3f98 is described below

commit 2e2c9a3f98e6d05238a423f7d04ce2eafc70bbd1
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Mon Mar 9 16:55:25 2026 -0600

    Address incompatibility with BoringSSL (#12943)
    
    BoringSSL recently moved some data types and functions into bssl namespace.
---
 CMakeLists.txt                       | 13 +++++++++++++
 include/tscore/ink_config.h.cmake.in |  1 +
 src/iocore/net/OCSPStapling.cc       | 10 ++++++++++
 3 files changed, 24 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0940e04162..fe6cb0241f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -593,6 +593,19 @@ check_cxx_source_compiles(
   }"
   HAVE_CRYPTO_EX_DUP_TYPE1
 )
+check_cxx_source_compiles(
+  "#include <openssl/asn1.h>
+  namespace bssl {
+    DECLARE_ASN1_ITEM(GENERAL_NAME)
+  };
+  int main() {
+    if (&bssl::GENERAL_NAME_it == reinterpret_cast<void *>(0x01)) {
+      return 1;
+    }
+    return 0;
+  }"
+  HAVE_GENERAL_NAME_IN_BSSL_NAMESPACE
+)
 
 set(CMAKE_EXTRA_INCLUDE_FILES netinet/in.h netinet/tcp.h)
 check_type_size("struct tcp_info" STRUCT_TCP_INFO)
diff --git a/include/tscore/ink_config.h.cmake.in 
b/include/tscore/ink_config.h.cmake.in
index c1fbfb2c36..bf012cefec 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -92,6 +92,7 @@
 #cmakedefine HAVE_NATIVE_DUAL_CERT_SUPPORT 1
 #cmakedefine HAVE_CRYPTO_EX_UNUSED 1
 #cmakedefine HAVE_CRYPTO_EX_DUP_TYPE1 1
+#cmakedefine HAVE_GENERAL_NAME_IN_BSSL_NAMESPACE 1
 
 #cmakedefine HAVE_STRUCT_TCP_INFO 1
 #cmakedefine HAVE_STRUCT_TCP_INFO_TCPI_TOTAL_RETRANS 1
diff --git a/src/iocore/net/OCSPStapling.cc b/src/iocore/net/OCSPStapling.cc
index 23ac23c0a0..0a50416765 100644
--- a/src/iocore/net/OCSPStapling.cc
+++ b/src/iocore/net/OCSPStapling.cc
@@ -55,7 +55,13 @@ extern ClassAllocator<FetchSM, false> FetchSMAllocator;
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wunused-function"
 #ifndef GENERAL_NAME_it
+#if HAVE_GENERAL_NAME_IN_BSSL_NAMESPACE
+namespace bssl {
+#endif
 DECLARE_ASN1_ITEM(GENERAL_NAME)
+#if HAVE_GENERAL_NAME_IN_BSSL_NAMESPACE
+}
+#endif
 #endif
 // RFC 6960
 using TS_OCSP_CERTID = struct ocsp_cert_id {
@@ -97,7 +103,11 @@ using TS_OCSP_REQINFO = struct ocsp_req_info_st {
 DECLARE_ASN1_FUNCTIONS(TS_OCSP_REQINFO)
 ASN1_SEQUENCE(TS_OCSP_REQINFO) = {
         ASN1_EXP_OPT(TS_OCSP_REQINFO, version, ASN1_INTEGER, 0),
+#if HAVE_GENERAL_NAME_IN_BSSL_NAMESPACE
+        ASN1_EXP_OPT(TS_OCSP_REQINFO, requestorName, bssl::GENERAL_NAME, 1),
+#else
         ASN1_EXP_OPT(TS_OCSP_REQINFO, requestorName, GENERAL_NAME, 1),
+#endif
         ASN1_SEQUENCE_OF(TS_OCSP_REQINFO, requestList, TS_OCSP_ONEREQ),
         ASN1_EXP_SEQUENCE_OF_OPT(TS_OCSP_REQINFO, requestExtensions, 
X509_EXTENSION, 2)
 } ASN1_SEQUENCE_END(TS_OCSP_REQINFO)

Reply via email to