diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-12-28 21:58:25 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-12-28 22:56:35 +0100 |
| commit | 838deb445b615aa06829164deb926ad68a42ae30 (patch) | |
| tree | 267549c891617d9b871ef4a21a77b365c02de7a5 /src/client/QXmppOutgoingClient.cpp | |
| parent | 3dd4267a5842d5b956dd79633fa2c8b81fb80d53 (diff) | |
| download | qxmpp-838deb445b615aa06829164deb926ad68a42ae30.tar.gz | |
Stream: Add IQ response sender check
Verifies that the sender of the response is correct, so no evil entity
can inject responses.
Fixes #510.
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
| -rw-r--r-- | src/client/QXmppOutgoingClient.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index 7d1ad6a3..9a8e51b8 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -19,6 +19,7 @@ #include <QCryptographicHash> #include <QDnsLookup> +#include <QFuture> #include <QNetworkProxy> #include <QSslConfiguration> #include <QSslSocket> @@ -316,6 +317,15 @@ bool QXmppOutgoingClient::isStreamResumed() const return d->streamResumed; } +QFuture<QXmppStream::IqResult> QXmppOutgoingClient::sendIq(QXmppIq &&iq) +{ + // always set a to address (the QXmppStream needs this for matching) + if (iq.to().isEmpty()) { + iq.setTo(d->config.domain()); + } + return QXmppStream::sendIq(std::move(iq)); +} + void QXmppOutgoingClient::_q_socketDisconnected() { debug("Socket disconnected"); |
