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

Commit0aaf699

Browse files
committed
Centralize ssl tests' check for whether we're using LibreSSL.
Right now there's only one caller, so that this is merelyan exercise in shoving code from one module to another,but there will shortly be another one. It seems better toavoid having two copies of this highly-subject-to-change test.Back-patch to v15, where we first introduced some tests thatdon't work with LibreSSL.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.comBackpatch-through: 15
1 parentbc35ade commit0aaf699

File tree

3 files changed

+37
-3
lines changed

3 files changed

+37
-3
lines changed

‎src/test/ssl/t/001_ssltests.pl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ sub switch_server_cert
3535
$ssl_server->switch_server_cert(@_);
3636
}
3737

38-
# Determine whether this build uses OpenSSL or LibreSSL. As a heuristic, the
39-
# HAVE_SSL_CTX_SET_CERT_CB macro isn't defined for LibreSSL.
40-
my$libressl =not check_pg_config("#define HAVE_SSL_CTX_SET_CERT_CB 1");
38+
# Determine whether this build uses OpenSSL or LibreSSL.
39+
my$libressl =$ssl_server->is_libressl;
4140

4241
#### Some configuration
4342

‎src/test/ssl/t/SSL/Backend/OpenSSL.pm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ package SSL::Backend::OpenSSL;
2626

2727
use strict;
2828
use warningsFATAL=>'all';
29+
use PostgreSQL::Test::Utils;
2930
use File::Basename;
3031
use File::Copy;
3132

@@ -205,6 +206,23 @@ sub get_library
205206
return$self->{_library};
206207
}
207208

209+
=pod
210+
211+
=item$backend->library_is_libressl()
212+
213+
Detect whether the SSL library is LibreSSL.
214+
215+
=cut
216+
217+
sublibrary_is_libressl
218+
{
219+
my ($self) =@_;
220+
221+
# The HAVE_SSL_CTX_SET_CERT_CB macro isn't defined for LibreSSL.
222+
# We may eventually need a less-bogus heuristic.
223+
returnnot check_pg_config("#define HAVE_SSL_CTX_SET_CERT_CB 1");
224+
}
225+
208226
# Internal method for copying a set of files, taking into account wildcards
209227
sub_copy_files
210228
{

‎src/test/ssl/t/SSL/Server.pm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,23 @@ sub ssl_library
244244

245245
=pod
246246
247+
=item$server->is_libressl()
248+
249+
Detect whether the currently used SSL backend is LibreSSL.
250+
(Ideally we'd not need this hack, but presently we do.)
251+
252+
=cut
253+
254+
subis_libressl
255+
{
256+
my$self =shift;
257+
my$backend =$self->{backend};
258+
259+
return$backend->library_is_libressl();
260+
}
261+
262+
=pod
263+
247264
=itemswitch_server_cert(params)
248265
249266
Change the configuration to use the given set of certificate, key, ca and

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp