Hi Takeshi,

Thanks again for the review and the alternative patch.
Attached is v2, which adopts your strtoi64 approach as
discussed.

The crypt-sha.c change is the one you suggested: parse rounds=
with strtoi64() so out-of-range values saturate into the
existing clamping, and report the value as supplied in the
clamp NOTICEs.  The regression tests are carried over from v1
unchanged.

Behaviour is identical to v1 on the full test battery,
including the values beyond int64 in both directions, and the
pgcrypto regression suite passes 25/25.

As noted before, sha-crypt support exists only in PG 18 and
master, so backpatching to REL_18_STABLE should be considered.

Testing was done with AI assistance.

Regards,
Prashant Chinnam

Attachment: v2-0001-pgcrypto-Fix-sha-crypt-rounds-values-that-do-not-fit.patch
Description: v2-0001-pgcrypto-Fix-sha-crypt-rounds-values-that-do-not-fit.patch

Reply via email to