Re: [PATCH] pgcrypto: Fix sha-crypt rounds= values that do not fit in int (BUG #19743)

From: Takeshi Ideriha <iderihatakeshi(at)gmail(dot)com>
To: Prashant Chinnam <crprashant(at)hotmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] pgcrypto: Fix sha-crypt rounds= values that do not fit in int (BUG #19743)
Date: 2026-10-29 05:28:58
Message-ID: 0d16dc5c-2682-43f1-9ade-97f814d1ecc2@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Prashant

On 2026/10/27 9:39, Prashant Chinnam wrote:

>
> I would prefer to keep clamping negative values in this patch.
> Clamping is the long-standing behaviour for values that fit in
> an int today -- rounds=-5 gives the below-minimum NOTICE and
> 1000 rounds on current master -- and this bug is specifically
> about the silent modulo 2^32 wrap of values that do not fit.
> Turning negative values into an ERROR would change behaviour
> for inputs that currently work, and it would be hard to
> backpatch, while the wrap fix itself should be backpatchable
> to REL_18_STABLE. If negative rounds should error, I think
> that deserves its own discussion and a master-only change.
> What do you think?

Sure. Thank you for pointing this out. As you said, how to handle
negative value is a bit different topic from the main issue here. Let's
keep the current behavior in this thread unless another concern arise.

Regards,
Takeshi Ideriha

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2026-10-29 05:30:00 Re: Reduce logging during prepared transaction recovery
Previous Message jian he 2026-10-29 05:05:55 Re: [PG19] Three bugs with a CHECK constraint that only the child enforces