summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_thread.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-12-03 19:56:47 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-12-03 19:56:47 +0300
commit550c9c86a95b3bc9f98e11a99e376e0a6ec0bf82 (patch)
treedc3d529b80d3a3562c458181ac6446c8a2053223 /protocols/JabberG/src/jabber_thread.cpp
parent3813c8e151beafef2f3e790573a59897c654b734 (diff)
common code moved to the separate method
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index f1db58dd1e..c283904cde 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -648,6 +648,18 @@ void CJabberProto::PerformAuthentication(ThreadData *info)
/////////////////////////////////////////////////////////////////////////////////////////
+void CJabberProto::OnProcessChannelBinding(const TiXmlElement *node)
+{
+ for (auto *it : TiXmlFilter(node, "channel-binding")) {
+ if (auto *pszType = it->Attribute("type")) {
+ if (!mir_strcmp(pszType, "tls-exporter"))
+ m_bTlsExporter = true;
+ else if (!mir_strcmp(pszType, "tls-server-end-point"))
+ m_bTlsServerEndpoint = true;
+ }
+ }
+}
+
void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info)
{
info->jabberServerCaps = JABBER_RESOURCE_CAPS_NONE;
@@ -711,6 +723,8 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info)
}
else if (!mir_strcmp(c->Name(), "upgrade") && c->Attribute("xmlns", "urn:xmpp:sasl:upgrade:0"))
OnProcessUpgrade(c, info);
+ else if (!mir_strcmp(pszName, "sasl-channel-binding") && c->Attribute("xmlns", JABBER_FEAT_CHANNEL_BINDING))
+ OnProcessChannelBinding(c);
}
}
else if (!mir_strcmp(pszName, "session"))
@@ -728,16 +742,8 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info)
}
else info->jabberServerCaps |= pCaps->GetCaps();
}
- else if (!mir_strcmp(pszName, "sasl-channel-binding") && !mir_strcmp(xmlns, JABBER_FEAT_CHANNEL_BINDING)) {
- for (auto *it : TiXmlFilter(n, "channel-binding")) {
- if (auto *pszType = it->Attribute("type")) {
- if (!mir_strcmp(pszType, "tls-exporter"))
- m_bTlsExporter = true;
- else if (!mir_strcmp(pszType, "tls-server-end-point"))
- m_bTlsServerEndpoint = true;
- }
- }
- }
+ else if (!mir_strcmp(pszName, "sasl-channel-binding") && !mir_strcmp(xmlns, JABBER_FEAT_CHANNEL_BINDING))
+ OnProcessChannelBinding(n);
}
if (areMechanismsDefined) {