summaryrefslogtreecommitdiffstats
path: root/src/network
Commit message (Collapse)AuthorAgeFilesLines
* QNetworkCookie: Rename sameSite to sameSitePolicyMårten Nordheim2021-04-142-8/+8
| | | | | | | | | | As suggested in the API review. Amends 37bd7b5733c7f1a4eb6ac5458fdc46f94a91194a Change-Id: Ic3e8567f349568dc3b4dbf79be27c304b39480cf Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a7dac8e35be35462973f2f3f653e5d1986005cb2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: delete the instance as a post-routineMårten Nordheim2021-04-141-2/+24
| | | | | | | | | | | | | | | | | | | | | | | On Windows, on exit, the backend will deref (and then implicitly start deletion of) a COM object. This object tries to communicate with an object in another thread, though it seems this other thread quits before the main thread in _most_ cases. To get around this we move the deletion to earlier in the program. While this is only reported as a Windows issue it makes for more consistent behavior if all platforms behave the same. Document and test that recreation of QNI works as expected after the destruction (and recreation) of QCoreApplication. Amends: 0875626e22ad4e709ddf505e701a8d699559f5b4 Fixes: QTBUG-92568 Change-Id: Iffc07f38673019aa059efd4d64d2ad706a03f6fe Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit e875c071ec32ab9aa460c982f25f6c6191e41326) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: make supports(...) not virtualMårten Nordheim2021-04-131-1/+1
| | | | | | | | Change-Id: Ib8d27410e6baa495a7351a57c8c1c1b30a64eb26 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5a60657363a860520215e4740c80b03ecf1f7e78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: Remove the default argumentMårten Nordheim2021-04-132-30/+23
| | | | | | | | | | And the code for loading whatever backend is sorted first. Though, looking at the code it would've never returned 'true' anyway. Change-Id: I7bc2c740e8cb5343e5843cb1d65715d236b92a25 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b67fe6dc7d27f857a4581e583fe25187c673bcaa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: Private the destructorMårten Nordheim2021-04-132-3/+9
| | | | | | | | | It wasn't meant to be public. Change-Id: Ifa7fff48f82b96bdfa277677d3988dc8881b8c2a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b1fe3e3d80cb23dee4de683e03711d1ac0614de2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLocalSocket/Win: fix possible UB in _q_pipeClosed()Alex Trotsenko2021-03-311-5/+2
| | | | | | | | | | We must stop the pipe writer before closing the handle on which it operates. Change-Id: I4765dd8393167fe2453653aba76a097b8ace8e3d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 64f02ebf05d88eaa8399a5cff85db5a605ede62e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLocalSocket: fix signal name in docsAlex Trotsenko2021-03-311-1/+1
| | | | | | | | | It should be disconnected() instead of disconnectedFromServer(). Change-Id: I2b816e9c92d675ea5a7a26b4752e831c30950ef2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 97877d79487befe050f96aa9ae3b52f20a351e97) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QAsn1Element: Avoid overflow in QAsn1Element::toIntegerRobert Löhning2021-03-181-2/+3
| | | | | | | | | | Fixes oss-fuzz issue 29534. Change-Id: I51d0b8238c73e5860c40d3b74577ddb8926647a3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 11a3eab1e168256778c45090b56e998e50c08c55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* openssl: fix the build on LinuxShawn Rutledge2021-03-182-1/+5
| | | | | | | | | | | | | | | qtbase/src/network/ssl/qtls_openssl.cpp:1527:34: error: ‘qScopeGuard’ was not declared in this scope qtbase/src/network/ssl/qtlsbackend_openssl.cpp:227:9: error: ‘QDirIterator’ was not declared in this scope; did you mean ‘QSetIterator’? qtbase/src/network/ssl/qtlsbackend_openssl.cpp: In function ‘QList<QSslCertificate> QTlsPrivate::systemCaCertificates()’: qtbase/src/network/ssl/qtlsbackend_openssl.cpp:387:10: error: aggregate ‘QDir currentDir’ has incomplete type and cannot be defined tbase/src/network/ssl/qtlsbackend_openssl.cpp:414:13: error: ‘QDirIterator’ was not declared in this scope; did you mean ‘QSetIterator’? qtbase/src/network/ssl/qtlsbackend_openssl.cpp:415:20: error: ‘it’ was not declared in this scope; did you mean ‘Qt’? qtbase/src/network/ssl/qtls_openssl.cpp:1527:34: error: ‘qScopeGuard’ was not declared in this scope qtbase/src/network/ssl/qtlsbackend_openssl.cpp:229:45: error: variable ‘QDirIterator iterator’ has initializer but incomplete type Change-Id: Ibcf4c7731b04f3f4be59d95130e088114f1536df Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Suppress warning (MSVC, C4250)Timur Pocheptsov2021-03-172-1/+11
| | | | | | | | | | | | This design decision was intentional and reflects the fact that we cannot have inheritance tree 'linear' as before, since the base interface is an abstract class without any data-members. Also, fix a warning about size_t -> int implicit conversion. Pick-to: dev Fixes: QTBUG-91866 Change-Id: Icbc73c22d8adf72bbd8949125d4404ea6da69c6d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Stop using QSslConfigurationPrivate inside the plugin codeTimur Pocheptsov2021-03-1612-249/+334
| | | | | | | | | | | | | | | | | | | | It was reasonable while backends were a part of QtNetwork. Now if moving them outside (or just trying to implement a new backend as a plugin), accessing data-members of QSslConfigurationPrivate means that any plugin knows about memory layout actual only for the version of Qt it was built with/for. Instead, we have to use the public class. Since it does not have all needed setters and some data-members have no access at all, we provide an API in QTlsBackend (which stays a part of QtNetwork) that knows the actual memory layout. Task-number: QTBUG-65922 Pick-to: dev Change-Id: I5ca1de4f982b4b11d9a87c4b40413367dcb83c16 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Convert QSslSocket(Backend)Private into pluginTimur Pocheptsov2021-03-1642-2468/+3244
| | | | | | | | | | | | | | All backend-specific code is now separated and removed from QSslSocket(Private) code. The original code is mostly preserved to avoid (as much as possible) regressions (and to simplify code-review). Pick-to: dev Fixes: QTBUG-91173 Task-number: QTBUG-65922 Change-Id: I3ac4ba35d952162c8d6dc62d747cbd62dca0ef78 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Add hyperlink to relevant sectionv6.1.0-beta2Paul Wicking2021-03-121-2/+2
| | | | | | | | Fixes: QTBUG-91734 Change-Id: I3910c7fcf1625ad08a65e691a8eaf9ed6b61779a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit b42df9756a8d72cbdfbf72f15e98385b35148eb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make qdecompresshelper archive bomb check only trigger for large filesØystein Heskestad2021-03-072-0/+10
| | | | | | | | | | | | | This is to avoid false positives. By default files are large if uncompressed size > 10 MB. Only configurable internally. Also add auto tests. Task-number: QTBUG-91392 Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit be73ca7eb1cebcc15064666e647bc337b5c2baa2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInterface/Unix: fix DNS eligibility of global addressesThiago Macieira2021-03-071-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkInterface] Fixed the reporting the "DNS eligibility" factor (QNetworkAddressEntry::dnsEligibility) for global IP addresses. Previously, QNetworkInterface interface erroneously reported all global addresses as eligible, regardless of whether they had already been deprecated by the OS or were temporary in the first place. From the tst_QNetworkInterface::dump output (netmask & broadcast suppressed for readability, IPv6 prefixes changed to protect the innocent, but the local part is exactly as found on my system): address 0: 192.168.26.33/24 dns-eligible preferred:33546998ms valid:33546998ms address 1: 2001:db8::800/128 dns-eligible preferred:264817000ms valid:264817000ms address 2: fd00::800/128 dns-eligible preferred:forever valid:forever address 3: 2001:db8::2f5b:342c:fc53:b9b2/64 dns-ineligible preferred:12422000ms valid:264817000ms address 4: fd00::9351:adff:333d:5c8d/64 dns-ineligible preferred:12421999ms valid:531402999ms address 5: fd00::7297:9516:fbb4:17ac/64 dns-ineligible preferred:0ms valid:445585999ms address 6: fd00::fdc8:e620:691:3b44/64 dns-eligible preferred:forever valid:forever address 7: 2001:db8::ae82:a01:5a8a:e210/64 dns-ineligible preferred:0ms valid:264816999ms address 8: 2001:db8::c673:e0a2:8927:2118/64 dns-eligible preferred:264816999ms valid:264816999ms address 9: fe80::bd89:b998:4aeb:a5d0%bond0/64 dns-ineligible preferred:forever valid:forever Prior to this commit, only address 9 was showing as ineligible. Addresses 1 and 2 come from DHCPv6 and are thus always eligible. Addresses 3, 4, 5, and 7 are temporary addresses added on account of RFC 4941 and are therefore ineligible (they have the IFA_F_TEMPORARY flag set). Note how 5 and 7 have also stopped being preferred. Address 3 is the one I see when I go to ip6.me and address 4 is the one used to reach the router. Addresses 6, 8, and 9 are the "permanent" addresses that would normally be based on the MAC address of the interface, but are actually in "stable privacy" mode for me (RFC 8064). Address 9 is the link-local one, which makes it ineligible, leaving the other two stable addresses eligible. Addresses 1, 3, 7, and 8 are global, from a DHCPv6-PD delegation from my ISP, which is why they have finite lifetime. Addresses 2, 4, 5, and 6 are from my local Unique Local Address (ULA) prefix, which is why 2 and 6 are valid forever. Change-Id: If8b43dc9678c4b4ba9c1fffd1668fdcae873c6bd Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 83876c025674eba9c932c108d355ba40e7789546) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix a BIC introduced by extending the namespace QSsl in _p.h filesTimur Pocheptsov2021-03-0543-243/+215
| | | | | | | | | Renamed the private part of the namespace to QTlsPrivate. Pick-to: dev Fixes: QTBUG-91531 Change-Id: Id2d9c458d8d958b35e437eee42889177dad0a7a7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Convert QDtls classes to the new plugin-based designTimur Pocheptsov2021-03-0411-278/+749
| | | | | | | | | | | | Essentially, the same code re-shuffled and placed behind the new interfaces. Pick-to: dev Fixes: QTBUG-91174 Task-number: QTBUG-65922 Change-Id: I8f14697f10713f9738c5c7805aed0150c084850c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QHostInfo: simplify assignment operatorVolker Hilsheimer2021-03-041-4/+5
| | | | | | | | | | | | | | | The d_ptr is never nullptr. If it could be, then other's d_ptr could also be nullptr, and we would dereference the null pointer. Guarding against self-assignment is nevertheless a good practice. Fixes static analyzer warning 5fc3780532e30c6350a0aa1ad2188a4c. Change-Id: I07ff808e4c4f5bf07b4d6663f1fb4a3301a0fec7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6e334a85a82f1fedc39f54511a9d1b0c7b512d5b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSsl: fix UB pointer useTimur Pocheptsov2021-03-022-7/+7
| | | | | | | | | | | | Weird macro had inverted notion of type safety: instead of casting parameters and return values (they are pointers) to work with generic OPENSSL_sk_xxx functions, it was ... casting a function pointer to an invalid type to get ... nothing, but UB. Home-brewed (un)'safestack'!!! Pick-to: dev 5.15 Change-Id: Ib91a7ba4cd472f370836797e422456f91a4385b0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Convert elliptic curves and DH params to work with QTlsBackendTimur Pocheptsov2021-03-0113-396/+372
| | | | | | | | | | | | | | The corresponding API is becoming a part of QTlsBackend interface, since it's too minimalistic and does not require additional interfaces, unlike certificates or keys. Pick-to: dev Fixes: QTBUG-91177 Fixes: QTBUG-91175 Task-number: QTBUG-65922 Change-Id: I44dd0adbdf2427962451998664efe234d59fae24 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Assert that we have a socketEngine before calling itVolker Hilsheimer2021-02-281-0/+1
| | | | | | | | | | | | | If we are connected or bound, then we must have an engine. Otherwise in code we frequently test for the d->socketEngine pointer, including in waitForConnected. Fixes static anlyzer warning 3b37ce4102843c97ceef2b7bb68a409d. Change-Id: Ib9818282ad2813db97859cbe1f184bcfb5ea4ab4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 2af45d0cee253a6bc4e6807076445439cc69c2ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move QSslCertificate's details and cert-related code to the pluginsTimur Pocheptsov2021-02-2520-1726/+540
| | | | | | | | | | | | | | Also since we have to properly support 'no-ssl' configure option (alas, we support QSslCertificate on such builds) - introduce a minimal crippled QTlsBackendCertOnly, which depends on X509CertificateGeneric. Pick-to: dev Fixes: QTBUG-90954 Task-number: QTBUG-65922 Change-Id: Ib9d62903f16b7c0eaaa23e319a822c24a7631dc6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtNetwork: Fix build with QT_NO_SSLv6.1.0-beta1Friedemann Kleint2021-02-221-2/+2
| | | | | | | | | | | Fix: qsslcertificate_qt.cpp.obj : error LNK2001: Unresolved symbol ""public: static struct QMetaObject const QTlsBackend::staticMetaObject" (?staticMetaObject@QTlsBackend@@2UQMetaObject@@B)". Task-number: QTBUG-90953 Change-Id: I4eb99c2ee4be67dfdf07e52219b73c6b14436344 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 9a5a2d61c077ddc8a0fb4e2cce7a36a5dbb081d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* A follow-up fix for potentially missing OpenSSL symbol resolvingTimur Pocheptsov2021-02-225-2/+28
| | | | | | | | | | | This patch also adds 'isValid()' to know if a backend from a plugin is in working condition (say, there is 'openssl' plugin but no or old openssl libraries in some system). Pick-to: dev Task-number: QTBUG-65922 Change-Id: I0b846536a069ca8c5a94e7191f11c81bac6ad527 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QNetworkInterface/Linux: make the IFLA_OPER_STATE set IsRunningThiago Macieira2021-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were setting IsUp for both the ifinfomsg::ifi_flags field and IFLA_OPER_STATE message. Turns out the second matches the "RUNNING" state that ifconfig used to return (IFF_RUNNING from SIOCIFFLAGS). Example: $ ip link show vboxnet0 4: vboxnet0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000 link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff $ ifconfig vboxnet0 vboxnet0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 0a:00:27:00:00:00 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 In this example, ifconfig is not showing "RUNNING", so its "UP" matches iproute2's in the <> section (that's the interface's ifi_flags). In an interface that ifconfig shows RUNNING, iproute2 will show "state UP", which is the IFLA_OPER_STATE. Exception: looks like the loopback has IF_OPER_UNKNOWN. Change-Id: Ic90d8429a0eb4837971dfffd1664bfc3f4b4e030 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 7507d872856282f381354b13a3b50d865c9ce2f8)
* Remove assignment to variable which is never readAlex Blasche2021-02-191-1/+0
| | | | | | | | | | Highlighted by static code analysis. Change-Id: I0e0d33c66c3aac5135204212bea2d5d48bad3739 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 0f4b2ccea4a8701a83c37c612b0ad0e60063b7c0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: Address API review feedbackMårten Nordheim2021-02-181-2/+4
| | | | | | | | | | | | Added missing NOTIFY for Q_PROPERTY. Switched one Q_ENUM to Q_FLAG. Declared missing operators for QFlag. Change-Id: I8e6756838e44e205844a34c95f436df6b51a862f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 0d4fb41e8c00263a0d385b70cc066776cbf6cc37) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation: Revise locking during creationMårten Nordheim2021-02-181-11/+8
| | | | | | | | | | | | Potential issue caught by the Mårten static analyzer. In case another thread somehow ended up creating and returning an instance while another was waiting to relock it would deallocate the previous instance, which could lead to some bad situations. Change-Id: I6e1843f8a483b2c3e0540e998c383e41f59c8655 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c98e92b8ca7fd295482ee99f095c220b6f389169) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QNetworkInterface IsUp and IsRunning enum documentationAndreas Hartmetz2021-02-181-3/+5
| | | | | | | | | | | | | | | The information is based on common Linux knowledge, StackOverflow answers (this is just one of them): https://stackoverflow.com/questions/11679514/what-is-the- difference-between-iff-up-and-iff-running an LKML thread about IFF_UP and IFF_RUNNING: https://lkml.org/lkml/1999/7/9/69 and the FreeBSD manpage for "ifnet" - e.g. https://www.freebsd.org/cgi/man.cgi?query=ifnet&sektion=9 Change-Id: I50a47b7fb26a63ac9d3f7eeef559fa7f56003cff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e6bd5a5ca3f55765edccf7c667612fb0919e6c94)
* qssl.h - address comments from API reviewTimur Pocheptsov2021-02-181-13/+13
| | | | | | | | | | Enumerators initially were to be flags, but this changed later, no initialisers needed now. Pick-to: dev Change-Id: I72b24f979e207e21d6f42a11cf0ae8887df473d3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port QSslKey to the new plugin-based implementationTimur Pocheptsov2021-02-1824-1940/+248
| | | | | | | | | | | | The idea is to have QSslKey(Private) backend-neutral and hide all library-specific code inside plugins. Pick-to: dev Fixes: QTBUG-90953 Task-number: QTBUG-65922 Change-Id: I2eeee3b2b72c78c2e24f2fb914abce3caa913be8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Revert "Remove the qmake project files" for snippetsNico Vertriest2021-02-181-0/+3
| | | | | | | | | | | | | This reverts a limited part of commit ad2da2d27a590333fc89a56fc58700a09c3017b3 that deleted .pro files for snippets compilation. Some .pro files which contain snippets used in the documentation itself should be restored. Task-number: QTBUG-90483 Change-Id: I1b03833c8ff17b5fca43a5b6c5417e8545b1711b Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 3183673303f6e66a02a7fbd25f4df2da8e979cc5) Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Schannel: Fix incomplete downloads with read buffer restrictedMårten Nordheim2021-02-153-1/+5
| | | | | | | | | | | | | | | | | | | | When the read buffer has a max size we do our best not to exceed it. Usually there's no problem and we just read more when the next tcp frame arrives. However if there's data leftover after the last tcp frame arrived then we won't receive any more data. To counter this QSslSocket would try to invoke QSslSocketPrivate::transmit indirectly if there were any bytes available on the plain socket. The problem is that with Schannel the last few remaining bytes would not be in the plain socket, but in the 'intermediateBuffer'. So let's make QSslSocket aware of that. Fixes: QTBUG-90625 Change-Id: If56e4cce558f99c9a08a1f6818e005a887712ef2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Norbert Pfeiler <norbert.pfeiler+git@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 6d4da1340f18b66e60ed6969aeb7180e00d39077) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation fixupsMårten Nordheim2021-02-123-5/+6
| | | | | | | | | | | | | Addressing feedback that came after the reviews ended from both bot and people. Added CLASS_NAME to the CMakeLists files for the plugins so that cmake can generate the correct import. Fixes: QTBUG-91061 Change-Id: Ib3f1e863100c1c421a6c0a4081b1d40696d67b23 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 92b15beb9aa09467583230a018c23114bb666a8e)
* Introduce QSsl::X509Certificate interface and its implementationsTimur Pocheptsov2021-02-0727-192/+2890
| | | | | | | | | | | | To enable QSslCertificate to use TLS plugins. All backend-specific code is to be moved from QSslCertificate(Private) making them backend-neutral. Pick-to: dev Task-number: QTBUG-90954 Task-number: QTBUG-65922 Change-Id: Ic9d5abf91e42ce81fe56239f95ae97b64035e950 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove QNetworkStatusMonitorMårten Nordheim2021-02-056-467/+10
| | | | | | | | | Since the old code is now fully integrated in QNetworkInformation backends Pick-to: dev Change-Id: Ia843d17bb3c98333e8d68752e25722b5860f48e0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* SCNetworkReachability based backend for QNetworkInformationMårten Nordheim2021-02-051-1/+1
| | | | | | | | | | | For macOS/iOS. Based on the code Timur wrote for QNetworkStatusMonitor, and uses QNetworkConnectionMonitor. It has less detail than the other backends which is unfortunate but should be fine! Pick-to: dev Task-number: QTBUG-86966 Change-Id: I0d5930d539f9668f001d6f85c86c9df0803d0f60 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* qtlskey_schannel_p.cpp: fix a compilation errorLi Xinwei2021-02-021-0/+1
| | | | | | | qtlskey_schannel.cpp(183): error C3861: 'lcSsl': identifier not found Change-Id: I406860f87a7b7f93ac2c0ca3d426dfa88615a90e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* NetworkListManager based backend for QNetworkInformationMårten Nordheim2021-02-023-9/+9
| | | | | | | | | | For Windows. Based on the code I wrote for QNetworkStatusMonitor. It also renames the netlistmgr feature, avoiding the abbreviation. Locally my MinGW fails the networklistmanager feature test so it may not be supported on MinGW, likely leaving it without a backend at all. Change-Id: I13bbe4127edc2a9c0bb91602c95f1cb206a85a69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Schannel - fix a compilation errorTimur Pocheptsov2021-02-011-0/+1
| | | | | | | | While rebasing and resolving conflicts, I've acidentally removed a declaration of supportsTls13() making a call expression invalid. Change-Id: If561091db36f0354b61fa050ff9f72b29eddce53 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QSsl::TlsKey - provide the interface and implementationsTimur Pocheptsov2021-02-0121-16/+2475
| | | | | | | | which will become parts of TLS plugins in the future. Task-number: QTBUG-65922 Change-Id: I4ee3c59c435fc34a9f4dacd3ff0e3cfb44251e23 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Remove the 'corewlan' featureAlexey Edelev2021-02-013-33/+433
| | | | | | | | | | | | | Remove 'corewlan' feature from the network related configure.json. The 'bearer' component was removed in the Network module. It was the only consumer of the 'corewlan' feature. There are no plans, yet, to use CoreWLAN framework in the future. Pick-to: 6.0 Fixes: QTBUG-90672 Change-Id: I1afb7b04ea75f8cb09cb570d820d16f54a130cf9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Shrink the memory footprint of QLocalSocketPrivatePiotr Mikolajczyk2021-02-011-3/+2
| | | | | | | | Member variables have been reordered to reduce the memory footprint by 8 bytes. Change-Id: Ib03f916c065861fa317f8802695363fd152e314a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* TLS backend: merge with its factoryTimur Pocheptsov2021-01-286-197/+129
| | | | | | | | | | | | | | QTlsBackend is a factory itself - it creates TLS/X509 objects. Having an intermediary between Factory->Backend->TLS primitive does not look very natural thus let's squash the first two parts. Backend is a factory creating TLS primitives, but its static functions also provide information about backends availablei and give access to those backends. Fixes: QTBUG-90606 Task-number: QTBUG-65922 Change-Id: I8409d81fd11fb46e6ab4465b4937a7680a8c2447 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix static analysis warnings concerning QNetworkInformationMårten Nordheim2021-01-272-0/+7
| | | | | | | By marking undeclared and unused copy/move constructors as deleted. Change-Id: Ie74b9cb015090dbb425b701a55eadb9d80ab0285 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Port QLocalServer to the new property systemTimur Pocheptsov2021-01-275-12/+23
| | | | | | Task-number: QTBUG-85520 Change-Id: Iee43a2e9e2d4847dad3b8be345d562af9aa3b690 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QDnsLookup - port to the new property systemTimur Pocheptsov2021-01-273-18/+52
| | | | | | | | | Read/write/notify properties, 3 out of 5 defined in this class. Task-number: QTBUG-85520 Change-Id: Ic6c74f90a2fa3c71d71cf9a5d557f1b6fc489d35 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-272-22/+25
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Update public suffix list to today's latestEdward Welbourne2021-01-272-14313/+14346
| | | | | | | | | | | | | | | | | | | | | Fetched from the authoritative source, verified the content matches that of the current master revision in the github repository. Amend one cookie jar test to find the last group in the last chunk correctly - each group arises from a non-empty hsah-table entry, but the last few hash-table entries may be empty, in which case the last group isn't just before the last index, it's earlier by the number of empty hash table entries. In the process, amend this test and the related test of the end of the first chunk to iterate all the entries in the group (in the present version, as it happens, each end-group has just one entry, but that may vary). Task-number: QTBUG-90214 Pick-to: 6.0 5.15 Change-Id: I6da365a6ca558124f8275e392735071dc77e04bb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix schannel compilation issuesMårten Nordheim2021-01-271-3/+3
| | | | | | | Amends 7cf8e5ada9eac00b200141fdc80a2e76c0422411 Change-Id: I6e188675ab53fd173bd75defe9d190a509f4adad Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>