diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-05-18 16:15:39 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2017-05-21 09:46:16 +0000 |
commit | c21cee827f94d1523301f6fe45b54d993b3a1abc (patch) | |
tree | 50de7aad76b0f5f872488fa4de9cf6bbb8eb9ffd /src/network/ssl/qsslsocket_openssl_symbols.cpp | |
parent | d6248ed80ed6c2d3c454183cf31e2028f3e78424 (diff) |
QSslSocket (OpenSSL) make supportsSsl return false, if v >= 1.1
Our OpenSSL backend allows missing symbols and in general protected
from possible related failures. Unfortunately, for OpenSSL 1.1 this
means not only missing symbols (removed functions), but new incompatible
opaque data-structures and our 1.0 code trying to use them and probably
accessing some data-members via macros - we end up in UB and crashes.
SSLeay, which returns a version number, was removed in 1.1. A failure
to resolve this symbol we consider as a version mismatch and we make
'supportsSsl' to return false.
Task-number: QTCREATORBUG-18137
Change-Id: I5cd270f9c61a729105149779ee7277816f9467d7
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl_symbols.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 1b2419ef07..c344a94427 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -1028,9 +1028,18 @@ bool q_resolveOpenSslSymbols() RESOLVEFUNC(d2i_PKCS12_bio) RESOLVEFUNC(PKCS12_free) - symbolsResolved = true; delete libs.first; delete libs.second; + if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) { + // OpenSSL 1.1 deprecated and removed SSLeay. We consider a failure to + // resolve this symbol as a failure to resolve symbols. + // The right operand of '||' above ... a bit of paranoia. + qCWarning(lcSsl, "Incompatible version of OpenSSL"); + return false; + } + + symbolsResolved = true; + return true; } #endif // QT_CONFIG(library) |