Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 44ec095

Browse files
Remove support for linking with libeay32 and ssleay32
The OpenSSL project stopped using the eay names back in 2016 on platforms other than Microsoft Windows, and version 1.1.0 removed the names from Windows as well. Since we now require OpenSSL 1.1.1 we can remove support for using the eay names from our tree as well. Author: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/3C445F8E-D43E-4970-9CD9-A54882197714@yesql.se Discussion: https://postgr.es/m/CAHrt6656W9OnFomQTHBGYDcM5CKZ7hcgzFt8L+N0ezBZfcN3zA@mail.gmail.com
1 parent 527f8fe commit 44ec095

File tree

6 files changed

+7
-132
lines changed

6 files changed

+7
-132
lines changed

configure

+2-121
Original file line numberDiff line numberDiff line change
@@ -12343,8 +12343,7 @@ if test "$with_ssl" = openssl ; then
1234312343

1234412344
$as_echo "#define OPENSSL_API_COMPAT 0x10101000L" >>confdefs.h
1234512345

12346-
if test "$PORTNAME" != "win32"; then
12347-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
12346+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5
1234812347
$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; }
1234912348
if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then :
1235012349
$as_echo_n "(cached) " >&6
@@ -12391,7 +12390,7 @@ else
1239112390
as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5
1239212391
fi
1239312392

12394-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
12393+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_new in -lssl" >&5
1239512394
$as_echo_n "checking for SSL_new in -lssl... " >&6; }
1239612395
if ${ac_cv_lib_ssl_SSL_new+:} false; then :
1239712396
$as_echo_n "(cached) " >&6
@@ -12438,124 +12437,6 @@ else
1243812437
as_fn_error $? "library 'ssl' is required for OpenSSL" "$LINENO" 5
1243912438
fi
1244012439

12441-
else
12442-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing CRYPTO_new_ex_data" >&5
12443-
$as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
12444-
if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
12445-
$as_echo_n "(cached) " >&6
12446-
else
12447-
ac_func_search_save_LIBS=$LIBS
12448-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12449-
/* end confdefs.h. */
12450-
12451-
/* Override any GCC internal prototype to avoid an error.
12452-
Use char because int might match the return type of a GCC
12453-
builtin and then its argument prototype would still apply. */
12454-
#ifdef __cplusplus
12455-
extern "C"
12456-
#endif
12457-
char CRYPTO_new_ex_data ();
12458-
int
12459-
main ()
12460-
{
12461-
return CRYPTO_new_ex_data ();
12462-
;
12463-
return 0;
12464-
}
12465-
_ACEOF
12466-
for ac_lib in '' eay32 crypto; do
12467-
if test -z "$ac_lib"; then
12468-
ac_res="none required"
12469-
else
12470-
ac_res=-l$ac_lib
12471-
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
12472-
fi
12473-
if ac_fn_c_try_link "$LINENO"; then :
12474-
ac_cv_search_CRYPTO_new_ex_data=$ac_res
12475-
fi
12476-
rm -f core conftest.err conftest.$ac_objext \
12477-
conftest$ac_exeext
12478-
if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
12479-
break
12480-
fi
12481-
done
12482-
if ${ac_cv_search_CRYPTO_new_ex_data+:} false; then :
12483-
12484-
else
12485-
ac_cv_search_CRYPTO_new_ex_data=no
12486-
fi
12487-
rm conftest.$ac_ext
12488-
LIBS=$ac_func_search_save_LIBS
12489-
fi
12490-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
12491-
$as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
12492-
ac_res=$ac_cv_search_CRYPTO_new_ex_data
12493-
if test "$ac_res" != no; then :
12494-
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12495-
12496-
else
12497-
as_fn_error $? "library 'eay32' or 'crypto' is required for OpenSSL" "$LINENO" 5
12498-
fi
12499-
12500-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_new" >&5
12501-
$as_echo_n "checking for library containing SSL_new... " >&6; }
12502-
if ${ac_cv_search_SSL_new+:} false; then :
12503-
$as_echo_n "(cached) " >&6
12504-
else
12505-
ac_func_search_save_LIBS=$LIBS
12506-
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12507-
/* end confdefs.h. */
12508-
12509-
/* Override any GCC internal prototype to avoid an error.
12510-
Use char because int might match the return type of a GCC
12511-
builtin and then its argument prototype would still apply. */
12512-
#ifdef __cplusplus
12513-
extern "C"
12514-
#endif
12515-
char SSL_new ();
12516-
int
12517-
main ()
12518-
{
12519-
return SSL_new ();
12520-
;
12521-
return 0;
12522-
}
12523-
_ACEOF
12524-
for ac_lib in '' ssleay32 ssl; do
12525-
if test -z "$ac_lib"; then
12526-
ac_res="none required"
12527-
else
12528-
ac_res=-l$ac_lib
12529-
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
12530-
fi
12531-
if ac_fn_c_try_link "$LINENO"; then :
12532-
ac_cv_search_SSL_new=$ac_res
12533-
fi
12534-
rm -f core conftest.err conftest.$ac_objext \
12535-
conftest$ac_exeext
12536-
if ${ac_cv_search_SSL_new+:} false; then :
12537-
break
12538-
fi
12539-
done
12540-
if ${ac_cv_search_SSL_new+:} false; then :
12541-
12542-
else
12543-
ac_cv_search_SSL_new=no
12544-
fi
12545-
rm conftest.$ac_ext
12546-
LIBS=$ac_func_search_save_LIBS
12547-
fi
12548-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SSL_new" >&5
12549-
$as_echo "$ac_cv_search_SSL_new" >&6; }
12550-
ac_res=$ac_cv_search_SSL_new
12551-
if test "$ac_res" != no; then :
12552-
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
12553-
12554-
else
12555-
as_fn_error $? "library 'ssleay32' or 'ssl' is required for OpenSSL" "$LINENO" 5
12556-
fi
12557-
12558-
fi
1255912440
# Functions introduced in OpenSSL 1.1.1.
1256012441
for ac_func in SSL_CTX_set_ciphersuites
1256112442
do :

configure.ac

+2-7
Original file line numberDiff line numberDiff line change
@@ -1322,13 +1322,8 @@ if test "$with_ssl" = openssl ; then
13221322
# Minimum required OpenSSL version is 1.1.1
13231323
AC_DEFINE(OPENSSL_API_COMPAT, [0x10101000L],
13241324
[Define to the OpenSSL API version in use. This avoids deprecation warnings from newer OpenSSL versions.])
1325-
if test "$PORTNAME" != "win32"; then
1326-
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
1327-
AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
1328-
else
1329-
AC_SEARCH_LIBS(CRYPTO_new_ex_data, [eay32 crypto], [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
1330-
AC_SEARCH_LIBS(SSL_new, [ssleay32 ssl], [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
1331-
fi
1325+
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
1326+
AC_CHECK_LIB(ssl, SSL_new, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
13321327
# Functions introduced in OpenSSL 1.1.1.
13331328
AC_CHECK_FUNCS([SSL_CTX_set_ciphersuites], [], [AC_MSG_ERROR([OpenSSL version >= 1.1.1 is required for SSL support])])
13341329
# Function introduced in OpenSSL 1.0.2, not in LibreSSL.

contrib/pgcrypto/Makefile

-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ endif
6161
# matter.)
6262
SHLIB_LINK += $(filter -lcrypto -lz, $(LIBS))
6363
ifeq ($(PORTNAME), win32)
64-
SHLIB_LINK += $(filter -leay32, $(LIBS))
6564
# those must be at the end
6665
SHLIB_LINK += -lws2_32
6766
endif

contrib/sslinfo/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ include $(top_builddir)/src/Makefile.global
2020
include $(top_srcdir)/contrib/contrib-global.mk
2121
endif
2222

23-
SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))
23+
SHLIB_LINK += $(filter -lssl -lcrypto, $(LIBS))

src/interfaces/libpq/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ else
8686
SHLIB_LINK += $(filter -lcrypt -ldes -lcom_err -lcrypto -lk5crypto -lkrb5 -lgssapi32 -lssl -lsocket -lnsl -lresolv -lintl -lm $(PTHREAD_LIBS), $(LIBS)) $(LDAP_LIBS_FE)
8787
endif
8888
ifeq ($(PORTNAME), win32)
89-
SHLIB_LINK += -lshell32 -lws2_32 -lsecur32 $(filter -leay32 -lssleay32 -lcomerr32 -lkrb5_32, $(LIBS))
89+
SHLIB_LINK += -lshell32 -lws2_32 -lsecur32 $(filter -lcomerr32 -lkrb5_32, $(LIBS))
9090
endif
9191
SHLIB_PREREQS = submake-libpgport
9292

src/test/modules/ssl_passphrase_callback/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include $(top_builddir)/src/Makefile.global
1919
include $(top_srcdir)/contrib/contrib-global.mk
2020
endif
2121

22-
SHLIB_LINK += $(filter -lssl -lcrypto -lssleay32 -leay32, $(LIBS))
22+
SHLIB_LINK += $(filter -lssl -lcrypto, $(LIBS))
2323

2424
# Targets to generate or remove the ssl certificate and key
2525
# Normally not needed. Don't run these targets in a vpath build, the results

0 commit comments

Comments
 (0)