1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

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 <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/0b42f1df-8cba-6a30-77d7-acc241cc88c1%40enterprisedb.com
This commit is contained in:
Peter Eisentraut
2021-11-05 13:59:42 +01:00
parent a5b336b8b9
commit db7d1a7b05
15 changed files with 42 additions and 7742 deletions

View File

@ -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

View File

@ -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/;
}
}