Re: Support getrandom() for pg_strong_random() source

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support getrandom() for pg_strong_random() source
Date: 2025-10-07 09:48:09
Message-ID: 875xcr9h5y.fsf@wibble.ilmari.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com> writes:

> On Fri, Oct 3, 2025 at 5:11 AM Joe Conway <mail(at)joeconway(dot)com> wrote:
>> That RFC appears to be specific to UUIDv4, but assuming that advice is generally
>> applicable to UUIDs in general it seems to mean we are off the hook when it
>> comes to FIPS with respect to UUIDs.
>
> The most recent RFC still says that [1]. And it doesn't appear to
> mandate the use of a CSPRNG at all, so it'd be unfortunate if UUIDs
> were bound by FIPS considerations... but my opinion has no effect on
> whether they're bound in practice.

It doesn't mandate (MUST) a CSPRNG, but it strongly recommends (SHOULD)
it (unless unavailable) in the best practices section
(https://www.rfc-editor.org/rfc/rfc9562.html#name-unguessability)

6.9. Unguessability

Implementations SHOULD utilize a cryptographically secure
pseudorandom number generator (CSPRNG) to provide values that are
both difficult to predict ("unguessable") and have a low likelihood
of collision ("unique"). The exception is when a suitable CSPRNG is
unavailable in the execution environment. Take care to ensure the
CSPRNG state is properly reseeded upon state changes, such as
process forks, to ensure proper CSPRNG operation. CSPRNG ensures the
best of Sections 6.7 and 8 are present in modern UUIDs.

- ilmari

> --Jacob
>
> [1] https://www.rfc-editor.org/rfc/rfc9562.html#name-security-considerations

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ajin Cherian 2025-10-07 09:53:52 Re: Improve pg_sync_replication_slots() to wait for primary to advance
Previous Message Euler Taveira 2025-10-07 09:47:28 Re: oid2name : add objects file path