]> granicus.if.org Git - postgresql/commitdiff
Fix up references to scram-sha-256
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 30 Jan 2018 21:50:30 +0000 (16:50 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 30 Jan 2018 22:05:35 +0000 (17:05 -0500)
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>

doc/src/sgml/protocol.sgml
src/backend/libpq/auth.c
src/backend/libpq/hba.c
src/include/libpq/scram.h
src/interfaces/libpq/fe-auth.c

index 8ec21cc756cc9b281c322f9c7085034bcb77e64a..0414db4c52a683900af4473a6913d3717af8d418 100644 (file)
@@ -1420,7 +1420,7 @@ On error, the server can abort the authentication at any stage, and send an
 ErrorMessage.
 </para>
 
- <sect2 id="sasl-scram-sha256">
+ <sect2 id="sasl-scram-sha-256">
   <title>SCRAM-SHA-256 authentication</title>
 
   <para>
index 547f1f770aa660892d10431f1b2e764eaeab91f1..10e92b458e1ed24669d0ef4e4f658b9b603823cf 100644 (file)
@@ -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
         * terminate the list.
         */
-       sendAuthRequest(port, AUTH_REQ_SASL, SCRAM_SHA256_NAME "\0",
-                                       strlen(SCRAM_SHA256_NAME) + 2);
+       sendAuthRequest(port, AUTH_REQ_SASL, SCRAM_SHA_256_NAME "\0",
+                                       strlen(SCRAM_SHA_256_NAME) + 2);
 
        /*
         * Initialize the status tracker for message exchanges.
@@ -950,7 +950,7 @@ CheckSCRAMAuth(Port *port, char *shadow_pass, char **logdetail)
                         * is an error.
                         */
                        selected_mech = pq_getmsgrawstring(&buf);
-                       if (strcmp(selected_mech, SCRAM_SHA256_NAME) != 0)
+                       if (strcmp(selected_mech, SCRAM_SHA_256_NAME) != 0)
                        {
                                ereport(ERROR,
                                                (errcode(ERRCODE_PROTOCOL_VIOLATION),
index 08a1db74a0798962fc4a7a26808186b7165eec32..36bc7a4cdda6f836cc2c2c1636dd319affa433cf 100644 (file)
@@ -126,7 +126,7 @@ static const char *const UserAuthName[] =
        "ident",
        "password",
        "md5",
-       "scram-sha256",
+       "scram-sha-256",
        "gss",
        "sspi",
        "pam",
index 0166e1945ddb7c0cbbf7dba000578300691555ff..61ceeeeb2769cdec543e42fdfa314720d80f8fe1 100644 (file)
@@ -14,7 +14,7 @@
 #define PG_SCRAM_H
 
 /* 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 */
 #define SASL_EXCHANGE_CONTINUE         0
index 382558f3f874df8afc412f4d904b3bec7473d32b..c4ef4f0bbb01efdc0a6e2b0fe6d173bee5f64184 100644 (file)
@@ -532,7 +532,7 @@ pg_SASL_init(PGconn *conn, int payloadlen)
                /*
                 * 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;
 
@@ -550,7 +550,7 @@ pg_SASL_init(PGconn *conn, int payloadlen)
                        conn->sasl_state = pg_fe_scram_init(conn->pguser, password);
                        if (!conn->sasl_state)
                                goto oom_error;
-                       selected_mechanism = SCRAM_SHA256_NAME;
+                       selected_mechanism = SCRAM_SHA_256_NAME;
                }
        }