From 28411b5995553eb3a50c826c55517b4c610959c2 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sat, 14 Dec 2019 22:47:28 +0100 Subject: Move TLS negotiation into new QXmppTlsManager --- src/client/QXmppOutgoingClient.cpp | 42 +------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'src/client/QXmppOutgoingClient.cpp') diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index 1b73542e..8cbde9e2 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -392,40 +392,9 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) QXmppStreamFeatures features; features.parse(nodeRecv); - if(features.clientStateIndicationMode() == QXmppStreamFeatures::Enabled) + if (features.clientStateIndicationMode() == QXmppStreamFeatures::Enabled) d->clientStateIndicationEnabled = true; - if (!socket()->isEncrypted()) - { - // determine TLS mode to use - const QXmppConfiguration::StreamSecurityMode localSecurity = configuration().streamSecurityMode(); - const QXmppStreamFeatures::Mode remoteSecurity = features.tlsMode(); - if (!socket()->supportsSsl() && - (localSecurity == QXmppConfiguration::TLSRequired || - remoteSecurity == QXmppStreamFeatures::Required)) - { - warning("Disconnecting as TLS is required, but SSL support is not available"); - disconnectFromHost(); - return; - } - if (localSecurity == QXmppConfiguration::TLSRequired && - remoteSecurity == QXmppStreamFeatures::Disabled) - { - warning("Disconnecting as TLS is required, but not supported by the server"); - disconnectFromHost(); - return; - } - - if (socket()->supportsSsl() && - localSecurity != QXmppConfiguration::TLSDisabled && - remoteSecurity != QXmppStreamFeatures::Disabled) - { - // enable TLS as it is support by both parties - sendData(""); - return; - } - } - // handle authentication const bool nonSaslAvailable = features.nonSaslAuthMode() != QXmppStreamFeatures::Disabled; const bool saslAvailable = !features.authMechanisms().isEmpty(); @@ -548,15 +517,6 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) d->xmppStreamError = QXmppStanza::Error::UndefinedCondition; emit error(QXmppClient::XmppStreamError); } - else if(ns == ns_tls) - { - if(nodeRecv.tagName() == "proceed") - { - debug("Starting encryption"); - socket()->startClientEncryption(); - return; - } - } else if(ns == ns_sasl) { if (!d->saslClient) { -- cgit v1.2.3