aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-07-20 14:24:04 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-07-20 14:24:04 +0200
commita8603c8043e6123cf9380b35a9b18561166f32d2 (patch)
treece94df8aa03966fb72e1c0aa38e98f7951ce58e1 /src
parentbb57b2c07f92acc8a1c91ce70a6dfa51ccff1f4e (diff)
downloadqxmpp-a8603c8043e6123cf9380b35a9b18561166f32d2.tar.gz
rework
Diffstat (limited to 'src')
-rw-r--r--src/client/QXmppOutgoingClient.cpp5
-rw-r--r--src/server/QXmppIncomingClient.cpp8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp
index 07c26938..61ddf335 100644
--- a/src/client/QXmppOutgoingClient.cpp
+++ b/src/client/QXmppOutgoingClient.cpp
@@ -444,7 +444,10 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv)
}
else if(nodeRecv.tagName() == "failure")
{
- if (!nodeRecv.firstChildElement("not-authorized").isNull())
+ QXmppSaslFailure failure;
+ failure.parse(nodeRecv);
+
+ if (failure.condition() == "not-authorized")
d->xmppStreamError = QXmppStanza::Error::NotAuthorized;
else
d->xmppStreamError = QXmppStanza::Error::UndefinedCondition;
diff --git a/src/server/QXmppIncomingClient.cpp b/src/server/QXmppIncomingClient.cpp
index a8eadb4e..cf2ae092 100644
--- a/src/server/QXmppIncomingClient.cpp
+++ b/src/server/QXmppIncomingClient.cpp
@@ -296,10 +296,12 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv)
}
else if (nodeRecv.tagName() == QLatin1String("response"))
{
+ QXmppSaslResponse response;
+ response.parse(nodeRecv);
+
if (d->saslDigestStep == 1)
{
- const QByteArray raw = QByteArray::fromBase64(nodeRecv.text().toAscii());
- QMap<QByteArray, QByteArray> saslResponse = QXmppSaslDigestMd5::parseMessage(raw);
+ QMap<QByteArray, QByteArray> saslResponse = QXmppSaslDigestMd5::parseMessage(response.value());
// check credentials
const QString username = QString::fromUtf8(saslResponse.value("username"));
@@ -310,7 +312,7 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv)
QXmppPasswordReply *reply = d->passwordChecker->getDigest(request);
reply->setParent(this);
- reply->setProperty("__sasl_raw", raw);
+ reply->setProperty("__sasl_raw", response.value());
connect(reply, SIGNAL(finished()), this, SLOT(onDigestReply()));
}
else if (d->saslDigestStep == 2)