Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8aa9a26

Browse files
peteremichaelpq
authored andcommitted
Define OPENSSL_API_COMPAT
This avoids deprecation warnings from newer OpenSSL versions (3.0.0 inparticular).This has been originally applied as 4d3db13 for v14 and newer versions,but not on the older branches out of caution, and this commit closes thegap to remove all these deprecation warnings in all the branches stillsupported.OPENSSL_API_COMPAT's value is set based on the oldest version of OpenSSLsupported on a branch: 1.0.1 for Postgres 13 and 0.9.8 for Postgres 11and 12.Reviewed-by: Daniel GustafssonDiscussion:https://postgr.es/m/FEF81714-D479-4512-839B-C769D2605F8A@yesql.seDiscussion:https://postgr.es/m/ZJJmOH+hIOSoesux@paquier.xyzBackpatch-through: 11
1 parentf7ee116 commit8aa9a26

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

‎configure

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12477,7 +12477,11 @@ fi
1247712477
fi
1247812478

1247912479
if test "$with_openssl" = yes ; then
12480-
if test "$PORTNAME" != "win32"; then
12480+
# Minimum required OpenSSL version is 1.0.1
12481+
12482+
$as_echo "#define OPENSSL_API_COMPAT 0x10001000L" >>confdefs.h
12483+
12484+
if test "$PORTNAME" != "win32"; then
1248112485
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
1248212486
$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
1248312487
if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :

‎configure.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,9 @@ fi
12581258

12591259
if test "$with_openssl" = yes ; then
12601260
dnl Order matters!
1261+
# Minimum required OpenSSL version is 1.0.1
1262+
AC_DEFINE(OPENSSL_API_COMPAT, [0x10001000L],
1263+
[Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.])
12611264
if test "$PORTNAME" != "win32"; then
12621265
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
12631266
AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])

‎src/include/pg_config.h.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,10 @@
758758
/* Define bytes to use libc memset(). */
759759
#undef MEMSET_LOOP_LIMIT
760760

761+
/* Define to the OpenSSL API version in use. This avoids deprecation warnings
762+
from newer OpenSSL versions. */
763+
#undef OPENSSL_API_COMPAT
764+
761765
/* Define to the address where bug reports for this package should be sent. */
762766
#undef PACKAGE_BUGREPORT
763767

‎src/tools/msvc/Solution.pm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ sub GenerateFiles
152152
my$package_bugreport;
153153
my$package_url;
154154
my ($majorver,$minorver);
155+
my$ac_define_openssl_api_compat_found = 0;
156+
my$openssl_api_compat;
155157

156158
# Parse configure.in to get version numbers
157159
open(my$c,'<',"configure.in")
@@ -176,10 +178,15 @@ sub GenerateFiles
176178
$majorver =sprintf("%d",$1);
177179
$minorver =sprintf("%d",$2 ?$2 : 0);
178180
}
181+
elsif (/\bAC_DEFINE\(OPENSSL_API_COMPAT,\[([0-9xL]+)\]/)
182+
{
183+
$ac_define_openssl_api_compat_found = 1;
184+
$openssl_api_compat =$1;
185+
}
179186
}
180187
close($c);
181188
confess"Unable to parse configure.in for all variables!"
182-
unless$ac_init_found;
189+
unless$ac_init_found &&$ac_define_openssl_api_compat_found;
183190

184191
if (IsNewer("src/include/pg_config_os.h","src/include/port/win32.h"))
185192
{
@@ -436,6 +443,7 @@ sub GenerateFiles
436443
LOCALE_T_IN_XLOCALE=>undef,
437444
MAXIMUM_ALIGNOF=> 8,
438445
MEMSET_LOOP_LIMIT=> 1024,
446+
OPENSSL_API_COMPAT=>$openssl_api_compat,
439447
PACKAGE_BUGREPORT=>qq{"$package_bugreport"},
440448
PACKAGE_NAME=>qq{"$package_name"},
441449
PACKAGE_STRING=>qq{"$package_name$package_version"},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp