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>
bb10
Timur Pocheptsov 2017-05-18 16:15:39 +02:00
parent d6248ed80e
commit c21cee827f
1 changed files with 10 additions and 1 deletions

View File

@ -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)