From cbdf4e985f31329a131e2b5cd1ba10051373bf2a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 23 Dec 2023 16:28:16 +0300 Subject: fixes #3793 (XEP-0440: SASL Channel-Binding Type Capability support) --- protocols/JabberG/src/jabber_thread.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'protocols/JabberG/src/jabber_thread.cpp') diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 24864a0116..a7461785a3 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -632,6 +632,7 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info) bool isRegisterAvailable = false; bool areMechanismsDefined = false; + m_bTlsExporter = m_bTlsServerEndpoint = false; for (auto *n : TiXmlEnum(node)) { auto *pszName = n->Name(); @@ -729,6 +730,16 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info) } else info->jabberServerCaps |= pCaps->GetCaps(); } + else if (!mir_strcmp(pszName, "sasl-channel-binding") && !mir_strcmp(n->Attribute("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; + } + } + } } if (areMechanismsDefined) { -- cgit v1.2.3