Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8bf9469

Browse files
committed
Tweak some SCRAM error messages and code comments
Clarify/correct some error messages, fix up some code comments thatconfused SASL and SCRAM, and other minor fixes. No changes infunctionality.
1 parent5e87f7b commit8bf9469

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

‎doc/src/sgml/protocol.sgml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,13 +1405,13 @@ ErrorMessage.
14051405
</para>
14061406

14071407
<para>
1408-
When SCRAM-SHA-256 is used in PostgreSQL, the server will ignore theusername
1409-
that the client sends in the <structname>client-first-message</>. Theusername
1408+
When SCRAM-SHA-256 is used in PostgreSQL, the server will ignore theuser name
1409+
that the client sends in the <structname>client-first-message</>. Theuser name
14101410
that was already sent in the startup message is used instead.
14111411
<productname>PostgreSQL</> supports multiple character encodings, while SCRAM
1412-
dictates UTF-8 to be used for theusername, so it might be impossible to
1413-
represent the PostgreSQLusername in UTF-8. To avoid confusion, the client
1414-
should use <literal>pg_same_as_startup_message</literal> as theusername in the
1412+
dictates UTF-8 to be used for theuser name, so it might be impossible to
1413+
represent the PostgreSQLuser name in UTF-8. To avoid confusion, the client
1414+
should use <literal>pg_same_as_startup_message</literal> as theuser name in the
14151415
<structname>client-first-message</>.
14161416
</para>
14171417

@@ -5274,7 +5274,7 @@ RowDescription (B)
52745274

52755275
<varlistentry>
52765276
<term>
5277-
SASLInitialresponse (F)
5277+
SASLInitialResponse (F)
52785278
</term>
52795279
<listitem>
52805280
<para>

‎src/backend/libpq/auth-scram.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ mock_scram_verifier(const char *username, int *iterations, char **salt,
573573
}
574574

575575
/*
576-
* Read the value in a givenSASL exchange message for given attribute.
576+
* Read the value in a givenSCRAM exchange message for given attribute.
577577
*/
578578
staticchar*
579579
read_attr_value(char**input,charattr)
@@ -585,15 +585,15 @@ read_attr_value(char **input, char attr)
585585
ereport(ERROR,
586586
(errcode(ERRCODE_PROTOCOL_VIOLATION),
587587
errmsg("malformed SCRAM message"),
588-
errdetail("Expected attribute'%c' but found%s.",
588+
errdetail("Expected attribute\"%c\" but found\"%s\".",
589589
attr,sanitize_char(*begin))));
590590
begin++;
591591

592592
if (*begin!='=')
593593
ereport(ERROR,
594594
(errcode(ERRCODE_PROTOCOL_VIOLATION),
595595
errmsg("malformed SCRAM message"),
596-
errdetail("Expected character= for attribute%c.",attr)));
596+
errdetail("Expected character\"=\" for attribute\"%c\".",attr)));
597597
begin++;
598598

599599
end=begin;
@@ -652,7 +652,7 @@ sanitize_char(char c)
652652
}
653653

654654
/*
655-
* Read the next attribute and value in aSASL exchange message.
655+
* Read the next attribute and value in aSCRAM exchange message.
656656
*
657657
* Returns NULL if there is attribute.
658658
*/
@@ -674,7 +674,7 @@ read_any_attr(char **input, char *attr_p)
674674
ereport(ERROR,
675675
(errcode(ERRCODE_PROTOCOL_VIOLATION),
676676
errmsg("malformed SCRAM message"),
677-
errdetail("Attribute expected, but found invalid character%s.",
677+
errdetail("Attribute expected, but found invalid character\"%s\".",
678678
sanitize_char(attr))));
679679
if (attr_p)
680680
*attr_p=attr;
@@ -684,7 +684,7 @@ read_any_attr(char **input, char *attr_p)
684684
ereport(ERROR,
685685
(errcode(ERRCODE_PROTOCOL_VIOLATION),
686686
errmsg("malformed SCRAM message"),
687-
errdetail("Expected character= for attribute%c.",attr)));
687+
errdetail("Expected character\"=\" for attribute\"%c\".",attr)));
688688
begin++;
689689

690690
end=begin;
@@ -703,7 +703,7 @@ read_any_attr(char **input, char *attr_p)
703703
}
704704

705705
/*
706-
* Read and parse the first message from client in the context of aSASL
706+
* Read and parse the first message from client in the context of aSCRAM
707707
* authentication exchange message.
708708
*
709709
* At this stage, any errors will be reported directly with ereport(ERROR).
@@ -802,14 +802,14 @@ read_client_first_message(scram_state *state, char *input)
802802
ereport(ERROR,
803803
(errcode(ERRCODE_PROTOCOL_VIOLATION),
804804
errmsg("malformed SCRAM message"),
805-
errdetail("Unexpected channel-binding flag%s.",
805+
errdetail("Unexpected channel-binding flag\"%s\".",
806806
sanitize_char(*input))));
807807
}
808808
if (*input!=',')
809809
ereport(ERROR,
810810
(errcode(ERRCODE_PROTOCOL_VIOLATION),
811811
errmsg("malformed SCRAM message"),
812-
errdetail("Comma expected, but found character%s.",
812+
errdetail("Comma expected, but found character\"%s\".",
813813
sanitize_char(*input))));
814814
input++;
815815

@@ -824,7 +824,7 @@ read_client_first_message(scram_state *state, char *input)
824824
ereport(ERROR,
825825
(errcode(ERRCODE_PROTOCOL_VIOLATION),
826826
errmsg("malformed SCRAM message"),
827-
errdetail("Unexpected attribute%s in client-first-message.",
827+
errdetail("Unexpected attribute\"%s\" in client-first-message.",
828828
sanitize_char(*input))));
829829
input++;
830830

@@ -929,7 +929,7 @@ verify_client_proof(scram_state *state)
929929
}
930930

931931
/*
932-
* Build the first server-side message sent to the client in aSASL
932+
* Build the first server-side message sent to the client in aSCRAM
933933
* communication exchange.
934934
*/
935935
staticchar*

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
228228
{
229229
*success= false;
230230
printfPQExpBuffer(errorMessage,
231-
libpq_gettext("invalid server signature\n"));
231+
libpq_gettext("incorrect server signature\n"));
232232
}
233233
*done= true;
234234
state->state=FE_SCRAM_FINISHED;
@@ -249,7 +249,7 @@ pg_fe_scram_exchange(void *opaq, char *input, int inputlen,
249249
}
250250

251251
/*
252-
* Read value for an attribute part of aSASL message.
252+
* Read value for an attribute part of aSCRAM message.
253253
*/
254254
staticchar*
255255
read_attr_value(char**input,charattr,PQExpBuffererrorMessage)
@@ -260,7 +260,7 @@ read_attr_value(char **input, char attr, PQExpBuffer errorMessage)
260260
if (*begin!=attr)
261261
{
262262
printfPQExpBuffer(errorMessage,
263-
libpq_gettext("malformed SCRAM message (%c expected)\n"),
263+
libpq_gettext("malformed SCRAM message (attribute \"%c\" expected)\n"),
264264
attr);
265265
returnNULL;
266266
}
@@ -269,7 +269,7 @@ read_attr_value(char **input, char attr, PQExpBuffer errorMessage)
269269
if (*begin!='=')
270270
{
271271
printfPQExpBuffer(errorMessage,
272-
libpq_gettext("malformed SCRAM message (expected= in attr '%c')\n"),
272+
libpq_gettext("malformed SCRAM message (expectedcharacter \"=\" for attribute \"%c\")\n"),
273273
attr);
274274
returnNULL;
275275
}
@@ -508,7 +508,7 @@ read_server_final_message(fe_scram_state *state, char *input,
508508
char*errmsg=read_attr_value(&input,'e',errormessage);
509509

510510
printfPQExpBuffer(errormessage,
511-
libpq_gettext("error received from server inSASL exchange: %s\n"),
511+
libpq_gettext("error received from server inSCRAM exchange: %s\n"),
512512
errmsg);
513513
return false;
514514
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp