From 86632bd377e9809a6670ee069b45bfb59a07d0fa Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 8 May 2018 12:35:46 +0200 Subject: QSslSocketBackendPrivate - avoid recursion while handing errors The logic seems to be simple - if client code on error signal tries to close TLS socket and this socket has buffered data, it calls 'flush' and 'transmit' or even 'startHandshake' as a result, which in turn will set and emit error again. To auto- test this, we initiate a handshake with pre-shared key hint on a server side and both client/server sockets incorrectly configured (missing PSK signals). We also do early write into the client socket to make sure it has some data buffered by the moment we call 'close'. Task-number: QTBUG-68089 Task-number: QTBUG-56476 Change-Id: I6ba6435bd572ad85d9209c4c81774a397081b34f Reviewed-by: Edward Welbourne --- src/network/ssl/qsslsocket_openssl_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/network/ssl/qsslsocket_openssl_p.h') diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index ce9096fea9..c16b9d5f76 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -131,6 +131,8 @@ public: static int s_indexForSSLExtraData; // index used in SSL_get_ex_data to get the matching QSslSocketBackendPrivate #endif + bool inSetAndEmitError = false; + // Platform specific functions void startClientEncryption() override; void startServerEncryption() override; -- cgit v1.2.3