]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Ooops ... add required configure support.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 9 May 2025 16:24:25 +0000 (12:24 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 9 May 2025 16:24:25 +0000 (12:24 -0400)
The previous commit assumed we have a configure probe for
SSL_CTX_set_cert_cb.  v15 lacks that, so add it now.
(Details borrowed from 36f40ce2d.)

Reported-by: Thomas Munro <thomas.munro@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://postgr.es/m/CA+hUKG+fLqyweHqFSBcErueUVT0vDuSNWui-ySz3+d_APmq7dw@mail.gmail.com
Backpatch-through: 15 only

configure
configure.ac
src/include/pg_config.h.in
src/tools/msvc/Solution.pm

index 91149997283976a098320d6bc246c562b6227986..d9095b568a0c2e688006ac1f71246baf2d3f11a0 100755 (executable)
--- a/configure
+++ b/configure
@@ -13448,13 +13448,15 @@ else
 fi
 
   fi
-  # Function introduced in OpenSSL 1.0.2.
-  for ac_func in X509_get_signature_nid
+  # Functions introduced in OpenSSL 1.0.2. LibreSSL does not have
+  # SSL_CTX_set_cert_cb().
+  for ac_func in X509_get_signature_nid SSL_CTX_set_cert_cb
 do :
-  ac_fn_c_check_func "$LINENO" "X509_get_signature_nid" "ac_cv_func_X509_get_signature_nid"
-if test "x$ac_cv_func_X509_get_signature_nid" = xyes; then :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
   cat >>confdefs.h <<_ACEOF
-#define HAVE_X509_GET_SIGNATURE_NID 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
index d92ec95f405a132df7d121dcebf42149e8e8ee1b..257c66859bb0d946c80db4084277b1d14b0da403 100644 (file)
@@ -1373,8 +1373,9 @@ if test "$with_ssl" = openssl ; then
      AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
      AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
   fi
-  # Function introduced in OpenSSL 1.0.2.
-  AC_CHECK_FUNCS([X509_get_signature_nid])
+  # Functions introduced in OpenSSL 1.0.2. LibreSSL does not have
+  # SSL_CTX_set_cert_cb().
+  AC_CHECK_FUNCS([X509_get_signature_nid SSL_CTX_set_cert_cb])
   # Functions introduced in OpenSSL 1.1.0. We used to check for
   # OPENSSL_VERSION_NUMBER, but that didn't work with 1.1.0, because LibreSSL
   # defines OPENSSL_VERSION_NUMBER to claim version 2.0.0, even though it
index 5ec240d59a53e65f4ab76eaeef4c0dcb6c30c76a..6d5e1820c9d8be02aa6c6d379852b56e758ec560 100644 (file)
 /* Define to 1 if you have spinlocks. */
 #undef HAVE_SPINLOCKS
 
+/* Define to 1 if you have the `SSL_CTX_set_cert_cb' function. */
+#undef HAVE_SSL_CTX_SET_CERT_CB
+
 /* Define to 1 if you have the `SSL_CTX_set_num_tickets' function. */
 #undef HAVE_SSL_CTX_SET_NUM_TICKETS
 
index d92bbbaf7dbac7ed4cf432e5b5c9b7c8ee585d6a..6db8a10265f28b892e1cdc7c4aea0041be867b9c 100644 (file)
@@ -364,6 +364,7 @@ sub GenerateFiles
                HAVE_SHM_OPEN                            => undef,
                HAVE_SOCKLEN_T                           => 1,
                HAVE_SPINLOCKS                           => 1,
+               HAVE_SSL_CTX_SET_CERT_CB                 => 1,
                HAVE_SSL_CTX_SET_NUM_TICKETS             => undef,
                HAVE_STDINT_H                            => 1,
                HAVE_STDLIB_H                            => 1,