From 7c334301bd32376538390027f7481c4b5f3eab49 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 10 Nov 2017 16:25:49 +0100 Subject: HTTP/2 - fix header processing httpReply->setHeaderField does not simply append (name|value) pairs, it first erases all entries with the same name. This is quite wrong when we have _several_ 'Set-Cookie' headers, for example. Found while trying to login into a facebook account :) Task-number: QTBUG-64359 Change-Id: I51416ca3ba3d92b9414e4649e493d9cd88f6d9a0 Reviewed-by: Edward Welbourne --- src/network/access/qhttp2protocolhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network') diff --git a/src/network/access/qhttp2protocolhandler.cpp b/src/network/access/qhttp2protocolhandler.cpp index 114feb91b7..9dfcec8311 100644 --- a/src/network/access/qhttp2protocolhandler.cpp +++ b/src/network/access/qhttp2protocolhandler.cpp @@ -1069,7 +1069,7 @@ void QHttp2ProtocolHandler::updateStream(Stream &stream, const HPack::HttpHeader QByteArray binder(", "); if (name == "set-cookie") binder = "\n"; - httpReply->setHeaderField(name, value.replace('\0', binder)); + httpReplyPrivate->fields.append(qMakePair(name, value.replace('\0', binder))); } } -- cgit v1.2.3 From 55f8d7dfe5589f85b0fa8a0705b1821f69b2cb34 Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Mon, 13 Feb 2017 21:35:02 +0100 Subject: qsslsocket_mac: handle 'OrLater' SslProtocols in verifySessionProtocol() The verifySessionProtocol() method in the SecureTransport backend did not properly handle TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater. This commit teaches verifySessionProtocol() about them. It also adds TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater to the protocolServerSide() test in tst_qsslsocket. Backport from 5.10 to 5.9 (LTS). Reviewed-by: Timur Pocheptsov (cherry picked from commit 9c765522d1c4f8090b5f5d391b1740fc4bd67664) Change-Id: I58c53bdf43e0f19b4506f3696d793f657eb4dc6f Reviewed-by: Edward Welbourne --- src/network/ssl/qsslsocket_mac.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/network') diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index 0aef6a2a99..2ba988fb70 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -1108,6 +1108,12 @@ bool QSslSocketBackendPrivate::verifySessionProtocol() const protocolOk = (sessionProtocol() >= QSsl::SslV3); else if (configuration.protocol == QSsl::SecureProtocols) protocolOk = (sessionProtocol() >= QSsl::TlsV1_0); + else if (configuration.protocol == QSsl::TlsV1_0OrLater) + protocolOk = (sessionProtocol() >= QSsl::TlsV1_0); + else if (configuration.protocol == QSsl::TlsV1_1OrLater) + protocolOk = (sessionProtocol() >= QSsl::TlsV1_1); + else if (configuration.protocol == QSsl::TlsV1_2OrLater) + protocolOk = (sessionProtocol() >= QSsl::TlsV1_2); else protocolOk = (sessionProtocol() == configuration.protocol); -- cgit v1.2.3