From: Daniel Gustafsson <daniel@yesql.se>
To: Robins Tharakan <tharakan@gmail.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove support for OpenSSL older than 1.1.0
Date: Tue, 3 Sep 2024 13:36:50 +0200
Message-ID: <0047E121-A5F5-45C7-8A3D-3DD3FC880DC5@yesql.se> (raw)
In-Reply-To: <CAEP4nAyQJemjC3UVfVydXZFw-VdLKw1AhThL++db0vGXwuh7jw@mail.gmail.com>
References: <E1sl66q-000GJZ-E3@gemulon.postgresql.org>
<CAEP4nAyQJemjC3UVfVydXZFw-VdLKw1AhThL++db0vGXwuh7jw@mail.gmail.com>
> On 3 Sep 2024, at 12:36, Robins Tharakan <tharakan@gmail.com> wrote:
> I am trying to update my buildfarm animals for this, and although I fixed massasauga (essentially by skipping the test for now), I am unclear why snakefly still fails (now, much later into the cycle).
>
> Could you point me on how to fix snakefly?
> (I've tried to disable SSL tests, but that doesn't seem to be helping).
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=snakefly&dt=2024-09-03%2009%3A56%3A46
The BF run entry claims it's failing in the ssl_passphrase_callbackCheck stage
which is odd, since without SSL it shouldn't recurse into that test module at
all.
Looking at massasauga it did recurse into there but then subsequently skipped
the test due to OpenSSL being missing. However, it would first need to compile
the test module in order to reach the SKIP statement in the TAP test, and I
believe that's where snakefly is failing. If I recompile postgres without SSL
and ensure that it cannot see any OpenSSL headers via standard includes I can
reproduce the error, the excerpt from install.log being the expected
compilation failure:
ssl_passphrase_func.c:29:23: error: unknown type name 'SSL_CTX'
static void set_rot13(SSL_CTX *context, bool isServerStart);
^
ssl_passphrase_func.c:52:3: error: use of undeclared identifier 'openssl_tls_init_hook'
openssl_tls_init_hook = set_rot13;
^
ssl_passphrase_func.c:56:11: error: unknown type name 'SSL_CTX'
set_rot13(SSL_CTX *context, bool isServerStart)
^
ssl_passphrase_func.c:63:2: error: call to undeclared function 'SSL_CTX_set_default_passwd_cb'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
SSL_CTX_set_default_passwd_cb(context, rot13_passphrase);
^
4 errors generated.
Does massasauga have OpenSSL headers such that the compiler can find them via
standard includes, and snakefly doesn't?
The buildfarm client should honor the rules in the src/test/modules Makefile
which skips the subdirectory when OpenSSL isn't present, but since the TAP test
have a SKIP clause I guess we should support it. The attached diff fixes it
for me, are you able to test that on snakefly?
--
Daniel Gustafsson
Attachments:ssl_passphrase_skip.diff (application/octet-stream, 1.1K) downloaddiff --git a/src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.c b/src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.cindex d599214982..b0d1fd2f70 100644--- a/src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.c+++ b/src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.c@@ -25,8 +25,10 @@ static char *ssl_passphrase = NULL;
/* callback function */
static int rot13_passphrase(char *buf, int size, int rwflag, void *userdata);
+#ifdef USE_SSL
/* hook function to set the callback */
static void set_rot13(SSL_CTX *context, bool isServerStart);
+#endif
/*
* Module load callback
@@ -48,10 +50,13 @@ _PG_init(void)
MarkGUCPrefixReserved("ssl_passphrase");
+#ifdef USE_SSL
if (ssl_passphrase)
openssl_tls_init_hook = set_rot13;
+#endif
}
+#ifdef USE_SSL
static void
set_rot13(SSL_CTX *context, bool isServerStart)
{
@@ -62,6 +67,7 @@ set_rot13(SSL_CTX *context, bool isServerStart)
SSL_CTX_set_default_passwd_cb(context, rot13_passphrase);
}
+#endif
static int
rot13_passphrase(char *buf, int size, int rwflag, void *userdata)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: daniel@yesql.se, tharakan@gmail.com
Subject: Re: pgsql: Remove support for OpenSSL older than 1.1.0
In-Reply-To: <0047E121-A5F5-45C7-8A3D-3DD3FC880DC5@yesql.se>
References: <E1sl66q-000GJZ-E3@gemulon.postgresql.org> <CAEP4nAyQJemjC3UVfVydXZFw-VdLKw1AhThL++db0vGXwuh7jw@mail.gmail.com> <0047E121-A5F5-45C7-8A3D-3DD3FC880DC5@yesql.se>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox