summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_openssl11_symbols_p.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2020-04-13 20:31:34 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2020-04-16 11:26:04 +0200
commit8ddffc6ba4f38bb8dbeb0cf61b6b10ee73505bbb (patch)
treed370a49ed40eec55f680b35e8b493e0ab1c56fac /src/network/ssl/qsslsocket_openssl11_symbols_p.h
parentc034089fa697e6dc22f04b3209768a9dc1abcb9c (diff)
OpenSSL: handle SSL_shutdown's errors properly
Do not call SSL_shutdown on a session that is in handshake state (SSL_in_init(s) returns 1). Also, do not call SSL_shutdown if a session encountered a fatal error (SSL_ERROR_SYSCALL or SSL_ERROR_SSL was found before). If SSL_shutdown was unsuccessful (returned code != 1), we have to clear the error(s) it queued. Unfortunately, SSL_in_init was a macro in OpenSSL 1.0.x. We have to resolve SSL_state to implement SSL_in_init. Fixes: QTBUG-83450 Change-Id: I6326119f4e79605429263045ac20605c30dccca3 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 8907635da59c2ae0e8db01f27b24a841b830e655)
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl11_symbols_p.h')
-rw-r--r--src/network/ssl/qsslsocket_openssl11_symbols_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_openssl11_symbols_p.h b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
index 0fe0899d4f..b7193ad180 100644
--- a/src/network/ssl/qsslsocket_openssl11_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
@@ -192,4 +192,11 @@ typedef int (*q_SSL_psk_use_session_cb_func_t)(SSL *, const EVP_MD *, const unsi
}
void q_SSL_set_psk_use_session_callback(SSL *s, q_SSL_psk_use_session_cb_func_t);
+#if OPENSSL_VERSION_NUMBER < 0x10101000L
+// What a mess!
+int q_SSL_in_init(SSL *s);
+#else
+int q_SSL_in_init(const SSL *s);
+#endif // 1.1.1 or 1.1.0
+
#endif