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

Commit976a8c2

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 parentf2d5b57 commit976a8c2

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +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. (Nor for OpenSSL
40-
# 1.0.1, but that's old enough that accommodating it isn't worth the cost.)
41-
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;
4240

4341
#### Some configuration
4442

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

Lines changed: 20 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,25 @@ 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+
# (Nor for OpenSSL 1.0.1, but that's old enough that accommodating it
223+
# isn't worth the cost.)
224+
# We may eventually need a less-bogus heuristic.
225+
returnnot check_pg_config("#define HAVE_SSL_CTX_SET_CERT_CB 1");
226+
}
227+
208228
# Internal method for copying a set of files, taking into account wildcards
209229
sub_copy_files
210230
{

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

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp