From 5bd9f983421cdf21f0abb47f957adf9cfd30d966 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 22 Jun 2018 11:49:27 +0200 Subject: QDtls - handle server-side timeouts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to RFC 6347 a DTLS server also must retransmit buffered message(s) if timeouts happen during the handshake phase (so it's not a client only as I initially understood it). Conveniently so an auto-test is already in place and needs just a tiny adjustment - handshakeWithRetransmission covers both sides. Change-Id: If914ec3052e28ef5bf12a40e5eede45bbc53e8e0 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Edward Welbourne --- tests/auto/network/ssl/qdtls/tst_qdtls.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp index de575e0bf0..7df7ed91dc 100644 --- a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp +++ b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp @@ -217,6 +217,8 @@ void tst_QDtls::init() connect(clientCrypto.data(), &QDtls::handshakeTimeout, this, &tst_QDtls::handleHandshakeTimeout); + connect(serverCrypto.data(), &QDtls::handshakeTimeout, + this, &tst_QDtls::handleHandshakeTimeout); } void tst_QDtls::construction_data() @@ -1209,7 +1211,10 @@ void tst_QDtls::pskRequested(QSslPreSharedKeyAuthenticator *auth) void tst_QDtls::handleHandshakeTimeout() { - if (!clientCrypto->handleTimeout(&clientSocket)) + auto crypto = qobject_cast(sender()); + Q_ASSERT(crypto); + + if (!crypto->handleTimeout(&clientSocket)) testLoop.exitLoop(); } -- cgit v1.2.3