Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Peter Eisentraut <peter@eisentraut.org>, Robert Haas <robertmhaas@gmail.com>, "Koshi Shibagaki (Fujitsu)" <shibagaki.koshi@fujitsu.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Joe Conway <mail@joeconway.com>
Date: 2025-01-15T14:24:52Z
Lists: pgsql-hackers

Attachments

> On 14 Jan 2025, at 13:12, Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote:

> Similar with [1], `pg_gen_salt_rounds` is not an SQL function.
> I think we do not have to mention the function because it's just another implementation of gen_salt().
> Also, use <function> instead of <literal>.

Fixed.

> I think we must call MarkGUCPrefixReserved() to catch the mis-spell.

Good point, fixed.

> Also: I'm not sure whether we should bump the version of pgcrypto. It should be done when
> the API is changed, but the patch does not do. Thought?

I don't think this constitutes a change which warrants a version bump so I've
left that out for now.

The attached includes a rename from "legacy_crypto" to "builtin_crypto".  While
legacy might apply now, there is work ongoing to modernize the algorithms
supported by crypt [0] so legacy might not be applicable soon (this GUC would
however still be relevant as the proposed code isn't FIPS certified).  Builtin
seems like a more future-proof choice in terms of naming.

--
Daniel Gustafsson

[0] c763235a2757e2f5f9e3e27268b9028349cef659.camel@oopsware.de

Commits

  1. pgcrypto: Make it possible to disable built-in crypto

  2. pgcrypto: Add function to check FIPS mode

  3. citext: Allow tests to pass in OpenSSL FIPS mode

  4. pgcrypto: Remove non-OpenSSL support