From db7d1a7b0530e8cbd045744e1c75b0e63fb6916f Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 5 Nov 2021 13:59:42 +0100 Subject: pgcrypto: Remove non-OpenSSL support pgcrypto had internal implementations of some encryption algorithms, as an alternative to calling out to OpenSSL. These were rarely used, since most production installations are built with OpenSSL. Moreover, maintaining parallel code paths makes the code more complex and difficult to maintain. This patch removes these internal implementations. Now, pgcrypto is only built if OpenSSL support is configured. Reviewed-by: Daniel Gustafsson Discussion: https://www.postgresql.org/message-id/flat/0b42f1df-8cba-6a30-77d7-acc241cc88c1%40enterprisedb.com --- src/tools/msvc/Mkvcbuild.pm | 39 ++------------------------------------- src/tools/msvc/vcregress.pl | 7 +------ 2 files changed, 3 insertions(+), 43 deletions(-) (limited to 'src') diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index 4362bd44fd1..856fb7a2cc5 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -440,7 +440,7 @@ sub mkvcbuild if (!$solution->{options}->{openssl}) { - push @contrib_excludes, 'sslinfo', 'ssl_passphrase_callback'; + push @contrib_excludes, 'sslinfo', 'ssl_passphrase_callback', 'pgcrypto'; } if (!$solution->{options}->{uuid}) @@ -448,41 +448,6 @@ sub mkvcbuild push @contrib_excludes, 'uuid-ossp'; } - # AddProject() does not recognize the constructs used to populate OBJS in - # the pgcrypto Makefile, so it will discover no files. - my $pgcrypto = - $solution->AddProject('pgcrypto', 'dll', 'crypto', 'contrib/pgcrypto'); - $pgcrypto->AddFiles( - 'contrib/pgcrypto', 'pgcrypto.c', - 'px.c', 'px-hmac.c', - 'px-crypt.c', 'crypt-gensalt.c', - 'crypt-blowfish.c', 'crypt-des.c', - 'crypt-md5.c', 'mbuf.c', - 'pgp.c', 'pgp-armor.c', - 'pgp-cfb.c', 'pgp-compress.c', - 'pgp-decrypt.c', 'pgp-encrypt.c', - 'pgp-info.c', 'pgp-mpi.c', - 'pgp-pubdec.c', 'pgp-pubenc.c', - 'pgp-pubkey.c', 'pgp-s2k.c', - 'pgp-pgsql.c'); - if ($solution->{options}->{openssl}) - { - $pgcrypto->AddFiles('contrib/pgcrypto', 'openssl.c', - 'pgp-mpi-openssl.c'); - } - else - { - $pgcrypto->AddFiles( - 'contrib/pgcrypto', 'internal.c', - 'internal-sha2.c', 'blf.c', - 'rijndael.c', 'pgp-mpi-internal.c', - 'imath.c'); - } - $pgcrypto->AddReference($postgres); - $pgcrypto->AddLibrary('ws2_32.lib'); - my $mf = Project::read_file('contrib/pgcrypto/Makefile'); - GenerateContribSqlFiles('pgcrypto', $mf); - foreach my $subdir ('contrib', 'src/test/modules') { opendir($D, $subdir) || croak "Could not opendir on $subdir!\n"; @@ -795,7 +760,7 @@ sub mkvcbuild } } - $mf = + my $mf = Project::read_file('src/backend/utils/mb/conversion_procs/Makefile'); $mf =~ s{\\\r?\n}{}g; $mf =~ m{SUBDIRS\s*=\s*(.*)$}m diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index fc826da3ff2..f3357b32920 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -726,18 +726,13 @@ sub fetchTests if ($m =~ /contrib\/pgcrypto/) { - # pgcrypto is special since the tests depend on the + # pgcrypto is special since some tests depend on the # configuration of the build - my $cftests = - $config->{openssl} - ? GetTests("OSSL_TESTS", $m) - : GetTests("INT_TESTS", $m); my $pgptests = $config->{zlib} ? GetTests("ZLIB_TST", $m) : GetTests("ZLIB_OFF_TST", $m); - $t =~ s/\$\(CF_TESTS\)/$cftests/; $t =~ s/\$\(CF_PGP_TESTS\)/$pgptests/; } } -- cgit v1.2.3