Content-Length: 319577 | pFad | http://github.com/postgrespro/postgres/commit/07044efe00762bdd04c4d392adb8f6425b13369b

CD Remove bogus SCRAM_ITERATION_LEN constant. · postgrespro/postgres@07044ef · GitHub
Skip to content

Commit 07044ef

Browse files
committed
Remove bogus SCRAM_ITERATION_LEN constant.
It was not used for what the comment claimed, at all. It was actually used as the 'base' argument to strtol(), when reading the iteration count. We don't need a constant for base-10, so remove it.
1 parent cd0ceba commit 07044ef

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

src/backend/libpq/auth-scram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ parse_scram_verifier(const char *verifier, char **salt, int *iterations,
476476
if ((p = strtok(NULL, ":")) == NULL)
477477
goto invalid_verifier;
478478
errno = 0;
479-
*iterations = strtol(p, &p, SCRAM_ITERATION_LEN);
479+
*iterations = strtol(p, &p, 10);
480480
if (*p || errno != 0)
481481
goto invalid_verifier;
482482

src/include/common/scram-common.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
/* length of salt when generating new verifiers */
3232
#define SCRAM_SALT_LEN 10
3333

34-
/* number of bytes used when sending iteration number during exchange */
35-
#define SCRAM_ITERATION_LEN 10
36-
3734
/* default number of iterations when generating verifier */
3835
#define SCRAM_ITERATIONS_DEFAULT 4096
3936

src/interfaces/libpq/fe-auth-scram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ read_server_first_message(fe_scram_state *state, char *input,
444444
/* read_attr_value() has generated an error string */
445445
return false;
446446
}
447-
state->iterations = strtol(iterations_str, &endptr, SCRAM_ITERATION_LEN);
447+
state->iterations = strtol(iterations_str, &endptr, 10);
448448
if (*endptr != '\0' || state->iterations < 1)
449449
{
450450
printfPQExpBuffer(errormessage,

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/07044efe00762bdd04c4d392adb8f6425b13369b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy