mirror of
https://github.com/postgres/postgres.git
synced 2025-05-29 16:21:20 +03:00
Fix up references to scram-sha-256
pg_hba_file_rules erroneously reported this as scram-sha256. Fix that. To avoid future errors and confusion, also adjust documentation links and internal symbols to have a separator between "sha" and "256". Reported-by: Christophe Courtois <christophe.courtois@dalibo.com> Author: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
parent
92123c6ea2
commit
167a22b2a6
@ -1420,7 +1420,7 @@ On error, the server can abort the authentication at any stage, and send an
|
|||||||
ErrorMessage.
|
ErrorMessage.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<sect2 id="sasl-scram-sha256">
|
<sect2 id="sasl-scram-sha-256">
|
||||||
<title>SCRAM-SHA-256 authentication</title>
|
<title>SCRAM-SHA-256 authentication</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -883,8 +883,8 @@ CheckSCRAMAuth(Port *port, char *shadow_pass, char **logdetail)
|
|||||||
* SCRAM-SHA-256 at the moment). The extra "\0" is for an empty string to
|
* SCRAM-SHA-256 at the moment). The extra "\0" is for an empty string to
|
||||||
* terminate the list.
|
* terminate the list.
|
||||||
*/
|
*/
|
||||||
sendAuthRequest(port, AUTH_REQ_SASL, SCRAM_SHA256_NAME "\0",
|
sendAuthRequest(port, AUTH_REQ_SASL, SCRAM_SHA_256_NAME "\0",
|
||||||
strlen(SCRAM_SHA256_NAME) + 2);
|
strlen(SCRAM_SHA_256_NAME) + 2);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the status tracker for message exchanges.
|
* Initialize the status tracker for message exchanges.
|
||||||
@ -950,7 +950,7 @@ CheckSCRAMAuth(Port *port, char *shadow_pass, char **logdetail)
|
|||||||
* is an error.
|
* is an error.
|
||||||
*/
|
*/
|
||||||
selected_mech = pq_getmsgrawstring(&buf);
|
selected_mech = pq_getmsgrawstring(&buf);
|
||||||
if (strcmp(selected_mech, SCRAM_SHA256_NAME) != 0)
|
if (strcmp(selected_mech, SCRAM_SHA_256_NAME) != 0)
|
||||||
{
|
{
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
(errcode(ERRCODE_PROTOCOL_VIOLATION),
|
||||||
|
@ -126,7 +126,7 @@ static const char *const UserAuthName[] =
|
|||||||
"ident",
|
"ident",
|
||||||
"password",
|
"password",
|
||||||
"md5",
|
"md5",
|
||||||
"scram-sha256",
|
"scram-sha-256",
|
||||||
"gss",
|
"gss",
|
||||||
"sspi",
|
"sspi",
|
||||||
"pam",
|
"pam",
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#define PG_SCRAM_H
|
#define PG_SCRAM_H
|
||||||
|
|
||||||
/* Name of SCRAM-SHA-256 per IANA */
|
/* Name of SCRAM-SHA-256 per IANA */
|
||||||
#define SCRAM_SHA256_NAME "SCRAM-SHA-256"
|
#define SCRAM_SHA_256_NAME "SCRAM-SHA-256"
|
||||||
|
|
||||||
/* Status codes for message exchange */
|
/* Status codes for message exchange */
|
||||||
#define SASL_EXCHANGE_CONTINUE 0
|
#define SASL_EXCHANGE_CONTINUE 0
|
||||||
|
@ -532,7 +532,7 @@ pg_SASL_init(PGconn *conn, int payloadlen)
|
|||||||
/*
|
/*
|
||||||
* Do we support this mechanism?
|
* Do we support this mechanism?
|
||||||
*/
|
*/
|
||||||
if (strcmp(mechanism_buf.data, SCRAM_SHA256_NAME) == 0)
|
if (strcmp(mechanism_buf.data, SCRAM_SHA_256_NAME) == 0)
|
||||||
{
|
{
|
||||||
char *password;
|
char *password;
|
||||||
|
|
||||||
@ -550,7 +550,7 @@ pg_SASL_init(PGconn *conn, int payloadlen)
|
|||||||
conn->sasl_state = pg_fe_scram_init(conn->pguser, password);
|
conn->sasl_state = pg_fe_scram_init(conn->pguser, password);
|
||||||
if (!conn->sasl_state)
|
if (!conn->sasl_state)
|
||||||
goto oom_error;
|
goto oom_error;
|
||||||
selected_mechanism = SCRAM_SHA256_NAME;
|
selected_mechanism = SCRAM_SHA_256_NAME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user