From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Christoph Moench-Tegeder <cmt@burggraben.net>
Cc: Michael Mühlbeyer <Michael.Muehlbeyer@trivadis.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: md5 issues Postgres14 on OL7
Date: Wed, 5 Jan 2022 16:09:12 +0900
Message-ID: <YdVEGLO/Ft7FUWF6@paquier.xyz> (raw)
In-Reply-To: <4190764.1641362933@sss.pgh.pa.us>
References: <89B7F072-5BBE-4C92-903E-D83E865D9367@trivadis.com>
<YcCRp9QvQvCZ7ODI@elch.exwg.net>
<YdQ1GLqQ/Vq6LwW9@paquier.xyz>
<4038656.1641318875@sss.pgh.pa.us>
<YdUx+6Sm5T0II8Un@paquier.xyz>
<4190764.1641362933@sss.pgh.pa.us>
On Wed, Jan 05, 2022 at 01:08:53AM -0500, Tom Lane wrote:
> I think it's very important that the error message in this case
> mention "FIPS mode" explicitly. Otherwise, people will have no
> idea that that's where the problem originates, and they'll be
> frustrated and we'll get bug reports. (They may be frustrated
> anyway, but it was their choice, or their corporate policy's
> choice, to cut off their access to MD5. Not our place to dodge
> that decision.)
I am not completely sure how to detect that in 1.1.1 in the context of
Fedora, and portability may become a tricky thing. FIPS_mode() and
FIPS_mode_set() are legacy APIs that should not be used, and upstream
just disables them in 1.1.1.
[... digs a bit ...]
Ugh. Fedora patches upstream's 1.1.1 to check and react on
/proc/sys/crypto/fips_enabled. Their code is here, see particularly
0009-Add-Kernel-FIPS-mode-flag-support.patch:
https://src.fedoraproject.org/rpms/openssl.git
So that's why you are able to use it with 1.1.1. Well, we could do
something similar to that, but in 3.0.0 things are done very
differently: one has to set to alg_sect fips=yes with fips = fips_sect
in the OpenSSL configuration to load the FIPS provider. Providing
more error context is going to be hairy here..
In order to make things portable with 14 in cryptohash.c, we don't
have any need to change the existing cryptohash APIs. We could just
store in each implementation context a location to a static string,
and add a new routine to extract it if there is an error, defaulting
to OOM.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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-general@postgresql.org
Cc: michael@paquier.xyz, tgl@sss.pgh.pa.us, cmt@burggraben.net, Michael.Muehlbeyer@trivadis.com
Subject: Re: md5 issues Postgres14 on OL7
In-Reply-To: <YdVEGLO/Ft7FUWF6@paquier.xyz>
References: <89B7F072-5BBE-4C92-903E-D83E865D9367@trivadis.com> <YcCRp9QvQvCZ7ODI@elch.exwg.net> <YdQ1GLqQ/Vq6LwW9@paquier.xyz> <4038656.1641318875@sss.pgh.pa.us> <YdUx+6Sm5T0II8Un@paquier.xyz> <4190764.1641362933@sss.pgh.pa.us> <YdVEGLO/Ft7FUWF6@paquier.xyz>
* 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