mirror of
git://git.psyced.org/git/psyced
synced 2024-08-15 03:25:10 +00:00
authzid fix by fippo
This commit is contained in:
parent
b7657baf0e
commit
eeeec5618b
1 changed files with 8 additions and 1 deletions
|
@ -37,6 +37,7 @@ volatile string host; // about time to remember which host we are talking to
|
||||||
|
|
||||||
volatile string tag;
|
volatile string tag;
|
||||||
volatile string streamid;
|
volatile string streamid;
|
||||||
|
volatile string streamfrom;
|
||||||
volatile string resource;
|
volatile string resource;
|
||||||
volatile mapping certinfo;
|
volatile mapping certinfo;
|
||||||
|
|
||||||
|
@ -358,7 +359,11 @@ jabberMsg(XMLNode node) {
|
||||||
return;
|
return;
|
||||||
#ifdef WANT_S2S_SASL
|
#ifdef WANT_S2S_SASL
|
||||||
case "auth":
|
case "auth":
|
||||||
t = to_string(decode_base64(node[Cdata]));
|
// if the authorization id is present, use that, else use streamfrom
|
||||||
|
// note that the standard says that streamfrom MUST be the same as the authorization id
|
||||||
|
// so we could save the base64 stuff and use streamfrom in all cases if we ignore the
|
||||||
|
// standard
|
||||||
|
t = node[Cdata] ? to_string(decode_base64(node[Cdata])) : streamfrom;
|
||||||
switch (node["@mechanism"]) {
|
switch (node["@mechanism"]) {
|
||||||
case "EXTERNAL":
|
case "EXTERNAL":
|
||||||
if (tls_query_connection_state(ME) == 1
|
if (tls_query_connection_state(ME) == 1
|
||||||
|
@ -460,10 +465,12 @@ open_stream(XMLNode node) {
|
||||||
* MUST generate an <invalid-namespace/> stream error condition
|
* MUST generate an <invalid-namespace/> stream error condition
|
||||||
* and terminate both the XML stream and the underlying TCP connection.
|
* and terminate both the XML stream and the underlying TCP connection.
|
||||||
*/
|
*/
|
||||||
|
emit(packet + ">");
|
||||||
STREAM_ERROR("invalid-namespace", "")
|
STREAM_ERROR("invalid-namespace", "")
|
||||||
QUIT
|
QUIT
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
streamfrom = node["@from"];
|
||||||
|
|
||||||
/* if stream version is >= "1.0" reply with stream version
|
/* if stream version is >= "1.0" reply with stream version
|
||||||
* attribute and add a stream:feature tag
|
* attribute and add a stream:feature tag
|
||||||
|
|
Loading…
Reference in a new issue