Fix crash if SSL_get0_next_proto_negotiated() cannot be resolved.
Crash occurs after warnings like: QSslSocket: cannot call unresolved function SSL_get0_next_proto_negotiated Task-number: QTBUG-37515 Task-number: QTBUG-33208 Change-Id: I18b803e4709b9d5f6b33717c2ac43179676351a4 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>bb10
parent
d7eb3d1280
commit
baa3d329ac
|
|
@ -1487,11 +1487,13 @@ void QSslSocketBackendPrivate::continueHandshake()
|
|||
}
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x1000100fL && !defined(OPENSSL_NO_TLSEXT) && !defined(OPENSSL_NO_NEXTPROTONEG)
|
||||
const unsigned char *proto;
|
||||
unsigned int proto_len;
|
||||
const unsigned char *proto = 0;
|
||||
unsigned int proto_len = 0;
|
||||
q_SSL_get0_next_proto_negotiated(ssl, &proto, &proto_len);
|
||||
QByteArray nextProtocol(reinterpret_cast<const char *>(proto), proto_len);
|
||||
configuration.nextNegotiatedProtocol = nextProtocol;
|
||||
if (proto_len)
|
||||
configuration.nextNegotiatedProtocol = QByteArray(reinterpret_cast<const char *>(proto), proto_len);
|
||||
else
|
||||
configuration.nextNegotiatedProtocol.clear();
|
||||
configuration.nextProtocolNegotiationStatus = sslContextPointer->npnContext().status;
|
||||
#endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ...
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue