]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix outdated comment of scram_build_secret()
authorMichael Paquier <michael@paquier.xyz>
Tue, 10 Dec 2024 03:54:16 +0000 (12:54 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 10 Dec 2024 03:54:16 +0000 (12:54 +0900)
This routine documented that "iterations" would use a default value if
set to 0 by the caller.  However, the iteration should always be set by
the caller to a value strictly more than 0, as documented by an
assertion.

Oversight in b577743000cd, that has made the iteration count of SCRAM
configurable.

Author: Matheus Alcantara
Discussion: https://postgr.es/m/ac858943-4743-44cd-b4ad-08a0c10cbbc8@gmail.com
Backpatch-through: 16

src/common/scram-common.c

index 6448564a08c4138fd5c2add2fb27ff09c820ebbb..389453187c2284b4f2b1b89464c1265e51c9daca 100644 (file)
@@ -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.