pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matheus Alcantara <matheusssilv97@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Outdated comment on scram_build_secret
Date: Mon, 9 Dec 2024 20:39:03 -0300
Message-ID: <ac858943-4743-44cd-b4ad-08a0c10cbbc8@gmail.com> (raw)

Hi,

The documentation for the iterations parameter on scram_build_secret say:
  * If iterations is 0, default number of iterations is used.

But the body of the function have the following assert
	Assert(iterations > 0);

Commit b577743000 introduced the assert and remove the if condition. 
All usages of this function is using an iteration > 0, so I think that 
is just a matter of updating the documentation? If that's the case the 
attached patch does that.

-- 
Matheus Alcantara
EDB: https://www.enterprisedb.com

Attachments:

v1-0001-Fix-outdated-scram_build_secret-comment.patch (text/plain, 972B) download From c560e0c5b7e51e48314c6e3ada6126f9ef27d8e3 Mon Sep 17 00:00:00 2001 From: Matheus Alcantara <mths.dev@pm.me> Date: Mon, 9 Dec 2024 20:36:30 -0300 Subject: [PATCH v1] Fix outdated scram_build_secret comment --- src/common/scram-common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/scram-common.c b/src/common/scram-common.c index b611bb8fe7..51cc12e8c3 100644 --- a/src/common/scram-common.c +++ b/src/common/scram-common.c @@ -200,8 +200,7 @@ scram_ServerKey(const uint8 *salted_password, * * The password should already have been processed with SASLprep, if necessary! * - * If iterations is 0, default number of iterations is used. The result is - * palloc'd or malloc'd, so caller is responsible for freeing it. + * The result is palloc'd or malloc'd, so caller is responsible for freeing it. * * On error, returns NULL and sets *errstr to point to a message about the * error details. -- 2.39.3 (Apple Git-146)

view thread (2+ messages)  latest in thread

Message-ID: <ac858943-4743-44cd-b4ad-08a0c10cbbc8@gmail.com>
Permalink:  ../ac858943-4743-44cd-b4ad-08a0c10cbbc8@gmail.com/
Also on:    postgresql.org/message-id/ac858943-4743-44cd-b4ad-08a0c10cbbc8@gmail.com

 ·  · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: matheusssilv97@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Outdated comment on scram_build_secret
  In-Reply-To: <ac858943-4743-44cd-b4ad-08a0c10cbbc8@gmail.com>

* 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