Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0

Поиск
Список
Период
Сортировка
От Daniel Gustafsson
Тема Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0
Дата
Msg-id 9FC8618A-C651-4438-A6A3-7E6682944922@yesql.se
обсуждение исходный текст
Ответ на Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> On 6 Feb 2022, at 01:53, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> ..we happily pass that bogus host name to SSL_set_tlsext_host_name.
> Apparently, openssl takes such a bogus setting in stride, but libressl
> not so much.

Looking at OpenSSL 1.1.1 (which is what LibreSSL claims API compatibility
with), the call ends up simply copying whatever came in without validation:

    case SSL_CTRL_SET_TLSEXT_HOSTNAME:
        /*
         * TODO(OpenSSL1.2)
         * This API is only used for a client to set what SNI it will request
         * from the server, but we currently allow it to be used on servers
         * as well, which is a programming error.  Currently we just clear
         * the field in SSL_do_handshake() for server SSLs, but when we can
         * make ABI-breaking changes, we may want to make use of this API
         * an error on server SSLs.
         */

In OpenSSL 3 they have removed the TODO marker, but still don't validate the
hostname, which explains why we don't see test errors here on the OpenSSL 3
animals (and likely wont going forward based on the comment).

In LibreSSL this is implemented with tlsext_sni_is_valid_hostname() which
checks for RFC 5890 compliance.

So, passing host='' seems the correct option.  It would be nice to be able to
run testcases which knows if we use LibreSSL or OpenSSL to test situations like
this where they do differ.

> I'd recommend using host='' in the tests, as that more or less
> replicates what the test author probably expected to happen.

Agreed. Are you taking care of that or should I?

--
Daniel Gustafsson        https://vmware.com/




В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Build error in Solaris
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: BUG #17391: While using --with-ssl=openssl and PG_TEST_EXTRA='ssl' options, SSL tests fail on OpenBSD 7.0