Граф коммитов

9292 Коммитов

Автор SHA1 Сообщение Дата
Jens Stutte 2216dc0a3d Bug 1731564: Use motivated SpinEventLoopUntil inside netwerk/*. r=necko-reviewers,valentin
Depends on D127102

Differential Revision: https://phabricator.services.mozilla.com/D127225
2021-10-07 08:06:12 +00:00
june wilde 692c22b993 Bug 1670058 - support Global Privacy Control signal; r=smaug,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D126966
2021-10-07 07:55:30 +00:00
Marian-Vasile Laza 18fb16c542 Backed out 18 changesets (bug 1731564) for causing build bustages on SpinEventLoopUntil. CLOSED TREE
Backed out changeset 0464dbdc8584 (bug 1731564)
Backed out changeset 0d996df13545 (bug 1731564)
Backed out changeset 5630a0e7a109 (bug 1731564)
Backed out changeset 37b41d187cdb (bug 1731564)
Backed out changeset d37700fa60b6 (bug 1731564)
Backed out changeset b0ce7db44b99 (bug 1731564)
Backed out changeset aa5ec3aa1535 (bug 1731564)
Backed out changeset 73b648f1fa70 (bug 1731564)
Backed out changeset bb8fb0f9833e (bug 1731564)
Backed out changeset 0d8905144f5d (bug 1731564)
Backed out changeset 2cfb094a1ec3 (bug 1731564)
Backed out changeset 78d3b0257a6a (bug 1731564)
Backed out changeset e9d32926e93c (bug 1731564)
Backed out changeset 874cab520ce5 (bug 1731564)
Backed out changeset d8071cc32bd9 (bug 1731564)
Backed out changeset 283c5393cbbc (bug 1731564)
Backed out changeset 317bc38e3de5 (bug 1731564)
Backed out changeset 53e3f4862439 (bug 1731564)
2021-10-07 00:09:19 +03:00
Jens Stutte b3a8e550fe Bug 1731564: Use motivated SpinEventLoopUntil inside netwerk/*. r=necko-reviewers,valentin
Depends on D127102

Differential Revision: https://phabricator.services.mozilla.com/D127225
2021-10-06 19:45:14 +00:00
Alexandru Michis 485a54ca75 Backed out changeset b61b692cfbce (bug 1670058) for causing bustages in nsHttpChannel.cpp
CLOSED TREE
2021-10-05 19:49:52 +03:00
june wilde e864a69420 Bug 1670058 - support Global Privacy Control signal; r=smaug,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D126966
2021-10-05 15:00:30 +00:00
Noemi Erli 55b2633c97 Backed out 3 changesets (bug 1733356) for causing bustages in CookieStorage.cpp CLOSED TREE
Backed out changeset e94611929d92 (bug 1733356)
Backed out changeset f1866e615f08 (bug 1733356)
Backed out changeset b87b34fa8a6f (bug 1733356)
2021-10-05 12:57:44 +03:00
Valentin Gosu 822cd925d0 Bug 1733356 - Fix non-unified build errors in netwerk/dns/ r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D127399
2021-10-05 08:22:00 +00:00
Gijs Kruitbosch dd394d57a2 Bug 1733558 - stop duplicating append redirect history entry logic everywhere, r=ckerschb,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D127251
2021-10-04 13:24:15 +00:00
Emilio Cobos Alvarez 3e78dd6549 Bug 1030660 - Disable ClearBogusContentEncodingIfNeeded. r=necko-reviewers,valentin
Other browsers don't do this and it causes compat issues.

Differential Revision: https://phabricator.services.mozilla.com/D127255
2021-10-02 16:40:36 +00:00
Dragana Damjanovic 00a3938779 Bug 1718520 - Retry a HttpTransaction if early data are used and a SSL_ERROR_PROTOCOL_VERSION_ALERT is received r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D126558
2021-10-01 17:22:54 +00:00
Dragana Damjanovic 04599ffe8f Bug 1718520 - Disable early-data if a SSL_ERROR_PROTOCOL_VERSION_ALERT is received r=mt
If amount of origins that have early-data disabled exceeds certain amount, disable early-data for all origins

This is controlled by prefs.

Differential Revision: https://phabricator.services.mozilla.com/D126555
2021-10-01 12:14:21 +00:00
Alexandru Michis 611ed75183 Merge mozilla-central to autoland a=merge 2021-09-30 17:47:10 +03:00
Alexandru Michis 584991b4bd Backed out changeset 5bb05a86bd2e (bug 1732885) for causing networking crashes. a=backout 2021-09-30 17:31:53 +03:00
Kershaw Chang 01b5dd1808 Bug 1733247 - Check the http3 pref when selecting an npnToken, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D127015
2021-09-30 12:18:47 +00:00
Kershaw Chang 833394b32b Bug 1732584 - Make sure NS_HTTP_DISALLOW_HTTP3 is set when proxy is used, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D126907
2021-09-30 12:17:49 +00:00
Dragana Damjanovic 33e8e81aa8 Bug 1732885 - Add assertions to make sure certificates are set if a handshake succeeds. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D126837
2021-09-29 21:18:12 +00:00
Dennis Schubert e6d9617889 Bug 1732875 - Call the ExperimentUserAgentUpdated() handler once direcly in nsHttpHandler::Init(). r=cpeterson,necko-reviewers,valentin
This is needed to make sure the experimental User Agent string is applied immediately after starting the browser, not just whenever the Nimbus data changes as part of the NimbusFeatures::OnUpdate handler.

Differential Revision: https://phabricator.services.mozilla.com/D126774
2021-09-28 17:11:26 +00:00
Shane Caraveo efe27c108e Bug 1732388 support proxyBypass flag on http channels r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D126550
2021-09-27 21:01:53 +00:00
Dragana Damjanovic 5add3e9091 Bug 1732256 - When TLS handshake completion is pending it may happen that nss and necko are out of sync. r=necko-reviewers,kershaw,valentin
The previous check was incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D126496
2021-09-23 13:10:23 +00:00
Valentin Gosu 373cbe05bd Bug 1732249 - Check if secInfo->GetServerCert returns a null cert r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D126453
2021-09-23 09:00:18 +00:00
Sean Feng a1b9c83581 Bug 1731831 - Rename timedChannel to timedChannelInfo for ReplacementChannelConfig r=dragana,necko-reviewers
`timedChannel` is wrong because it implies it is a channel, however it
is in fact a `TimedChannelInfo`.

Differential Revision: https://phabricator.services.mozilla.com/D126254
2021-09-22 19:07:56 +00:00
Dragana Damjanovic a33c6961ed Bug 1382886 - Consider that mTransport may be nullptr when Handshake done callback is called r=necko-reviewers,kershaw
Also set mEarlyDataState to done earlier.

Differential Revision: https://phabricator.services.mozilla.com/D126264
2021-09-22 09:19:32 +00:00
Dragana Damjanovic 4148d02518 Bug 1382886 - Fix fuzzing build, also we cannot set SecurityInfo during read r=necko-reviewers,kershaw
Before this bug TLS handshake was only driven by forcing writes. SecurtyInfo was set during a write code path. That is not anymore true and the TLS handshake can be driven by reading from a socket. That causes an issue where the SecurtyInfo was not set in case a TLS handshake fails. This bug added the setting of the SecurtyInfo to the read code path, but that causes problems when the transaction is closed due to corrupted response.
This patch fixes this by moving the setting of SecurtyInfo to Close() function.

Do not call HandshakeDoneInternal if the connection has been closed between posting the HandshakeDoneInternal runable and executing it.

Differential Revision: https://phabricator.services.mozilla.com/D125666
2021-09-22 09:19:32 +00:00
Dragana Damjanovic 1f317abe34 Bug 1382886 - Remove a busy-wait if the early-data is negotiated and http/1.1 is used but the transaction cannot send early-data. r=necko-reviewers,kershaw
In this case necko should poll for read (not for write) and reset the poll flags when the handshake is done.
The other option is to inspect the resumption ticket before adding it to the nss socket and find out which alpn will be used and disable the early-data if the version is http/1.1 and the transaction cannot send early-data. This currently only works on Nightly. When we roll out the necko’s token cache we can consider making this change.

Additional changes:
Consolidate mEarlyDataNegotiated and mWaitingFor0RTTResponse into mEarlyDataState

Differential Revision: https://phabricator.services.mozilla.com/D123928
2021-09-22 09:19:32 +00:00
Dragana Damjanovic df4152feaf Bug 1382886 - Make sure that nsHttpConnection immediately knows that the handshake is done. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123919
2021-09-22 09:19:31 +00:00
Dragana Damjanovic 985c02c2f1 Bug 1382886 - Use HandshakeDone to signal that a handshake is done r=necko-reviewers,keeler,kershaw
HandshakeDone will be called after a handshake is finished and also after the certificate verifications are done.
The code relies on HandshakeDone to signal that the handshake is done. When early-data is not available HandshakeDone is responsible for setting up a Http2 session if needed. There are 2 outcomes when early-data is used:
1) early-data is accepted and transaction continues polling for read,
2) early-data is rejected. In this case, the transaction is restarted as well as polling flags, i.e. the connection will stop polling for read and start polling for write.
Another difference is that a transaction that is started during the early-data period will behave as a normal transaction, i.e. it will write data and continue polling for read to receive response. The special cases during early-data(mWaitingFor0RTTResponse==true) are removed from nsHttpConnection::OnSocketWritable().

EnsureNPNComplete is only responsible for driving handshake and checking the early-data availability. All logic for finishing a handshake (i.e. checking whether early-data is accepted and checking alpn value) has been moved to HandshakeDone.
The patch also extracts FinishNPNSetup that is responsible for the bookkeeping after a handshake is done or fails, e.g. resetting transactions if 0Rtt is used but handshake fails, updating timings and sending telemetry.

HandshakeDone needs to be dispatched so that it is not called inside nss locks. The side effect of this is that nsHttpConnection::OnSocketWritable() may be called in between  HandshakeDone being dispatched and executed. Therefore we still need to keep CheckCanWrite0RTTData(). This can be fixed in a follow up patch.

Side cleanups:
Remove mNotTrustedMitmDetected - his was used for ESNI, but it is not used anymore

Differential Revision: https://phabricator.services.mozilla.com/D123824
2021-09-22 09:19:31 +00:00
Dragana Damjanovic 18800f98eb Bug 1382886 - Don’t use a special way to write 0RTT data. Reuse the standard code path r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123680
2021-09-22 09:19:30 +00:00
Dragana Damjanovic c116b60b2c Bug 1382886 - Add a callback when the handshake is done. r=necko-reviewers,kershaw,keeler
Differential Revision: https://phabricator.services.mozilla.com/D123601
2021-09-22 09:19:30 +00:00
Dragana Damjanovic 96de623086 Bug 1382886 - Refactor EnsureNPNComplete r=necko-reviewers,kershaw
Extract Check0RttEnabled
The old code checks 0RTT state then does a DriveHandshake then checks 0RTT again. This is done in this way because before DriveHandshake is called for the first time 0RTT states are not set.  DriveHandshake is sometimes called as a side effect by IsAlive() check. The new code makes this less complex and just calls DriveHandshaek before checking 0RTT.
Extract code for setting 0RTT telemetry values.
Remove some code that set timing because the same code is called a bit later again.

Differential Revision: https://phabricator.services.mozilla.com/D123645
2021-09-22 09:19:29 +00:00
Kershaw Chang 3ab686eb88 Bug 1730418 - Fetch HTTPS RR in nsHttpChannel::MaybeUseHTTPSRRForUpgrade, r=necko-reviewers,dragana
Before this patch, we fetch HTTPS RR in `nsHttpChannel::MaybeStartDNSPrefetch`, which is too early. It's possible that this http request is blocked by an extension but we still send the query for HTTPS RR.
To improve this, we move the time of fetching HTTPS RR a bit late.

Differential Revision: https://phabricator.services.mozilla.com/D125931
2021-09-21 08:58:24 +00:00
Kershaw Chang 0017d6ff11 Bug 1726528 - Make sure we don't fallback to a record without echConfig, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D125074
2021-09-20 14:24:15 +00:00
Kershaw Chang 21d1774ea9 Bug 1726528 - Add a pref to control whether to enable echConfig for http3, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D123125
2021-09-20 14:24:14 +00:00
Kershaw Chang 5ed5b6c43a Bug 1729431 - Use an enum as the index of connection info's hash key, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D124752
2021-09-20 14:02:49 +00:00
Kershaw Chang 3146e59eaf Bug 1667102 - Make sure nsHttpTransaction::mConnection is released on socket thread, r=necko-reviewers,dragana
Since `nsHttpTransaction::mConnection` could be `Http2Session` and `Http2Session` supports weak reference, we should make sure `Http2Session` to be always released on socket thread.

Differential Revision: https://phabricator.services.mozilla.com/D125510
2021-09-20 13:57:29 +00:00
Kershaw Chang f9ebc6ad69 Bug 1667102 - Add some diagnostic assertions, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D124753
2021-09-20 13:57:29 +00:00
Butkovits Atila e097708c27 Backed out 7 changesets (bug 1382886) for causing very frequent networking crashes. a=backout DONTBUILD
Backed out changeset e0d76ea1bdd2 (bug 1382886)
Backed out changeset 1db60c600b97 (bug 1382886)
Backed out changeset c922a30d444e (bug 1382886)
Backed out changeset 7f2260b49e60 (bug 1382886)
Backed out changeset 0c049a8ee4a8 (bug 1382886)
Backed out changeset 632eefa7e529 (bug 1382886)
Backed out changeset fe6b8f41ca83 (bug 1382886)
2021-09-18 12:37:24 +03:00
Marian-Vasile Laza 381c254e6d Backed out 3 changesets (bug 1487113) for causing hazard bustages. CLOSED TREE
Backed out changeset 13bf04fc644f (bug 1487113)
Backed out changeset 5b7fe5d564aa (bug 1487113)
Backed out changeset 02236ccd64b4 (bug 1487113)
2021-09-17 22:58:33 +03:00
Dragana Damjanovic 4bd11b491f Bug 1382886 - Fix fuzzing build, also we cannot set SecurityInfo during read r=necko-reviewers,kershaw
Before this bug TLS handshake was only driven by forcing writes. SecurtyInfo was set during a write code path. That is not anymore true and the TLS handshake can be driven by reading from a socket. That causes an issue where the SecurtyInfo was not set in case a TLS handshake fails. This bug added the setting of the SecurtyInfo to the read code path, but that causes problems when the transaction is closed due to corrupted response.
This patch fixes this by moving the setting of SecurtyInfo to Close() function.

Do not call HandshakeDoneInternal if the connection has been closed between posting the HandshakeDoneInternal runable and executing it.

Differential Revision: https://phabricator.services.mozilla.com/D125666
2021-09-17 13:19:02 +00:00
Dragana Damjanovic 99717c8156 Bug 1382886 - Remove a busy-wait if the early-data is negotiated and http/1.1 is used but the transaction cannot send early-data. r=necko-reviewers,kershaw
In this case necko should poll for read (not for write) and reset the poll flags when the handshake is done.
The other option is to inspect the resumption ticket before adding it to the nss socket and find out which alpn will be used and disable the early-data if the version is http/1.1 and the transaction cannot send early-data. This currently only works on Nightly. When we roll out the necko’s token cache we can consider making this change.

Additional changes:
Consolidate mEarlyDataNegotiated and mWaitingFor0RTTResponse into mEarlyDataState

Differential Revision: https://phabricator.services.mozilla.com/D123928
2021-09-17 13:19:02 +00:00
Dragana Damjanovic 3f98b48466 Bug 1382886 - Make sure that nsHttpConnection immediately knows that the handshake is done. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123919
2021-09-17 13:19:01 +00:00
Dragana Damjanovic 72ccc52dcc Bug 1382886 - Use HandshakeDone to signal that a handshake is done r=necko-reviewers,keeler,kershaw
HandshakeDone will be called after a handshake is finished and also after the certificate verifications are done.
The code relies on HandshakeDone to signal that the handshake is done. When early-data is not available HandshakeDone is responsible for setting up a Http2 session if needed. There are 2 outcomes when early-data is used:
1) early-data is accepted and transaction continues polling for read,
2) early-data is rejected. In this case, the transaction is restarted as well as polling flags, i.e. the connection will stop polling for read and start polling for write.
Another difference is that a transaction that is started during the early-data period will behave as a normal transaction, i.e. it will write data and continue polling for read to receive response. The special cases during early-data(mWaitingFor0RTTResponse==true) are removed from nsHttpConnection::OnSocketWritable().

EnsureNPNComplete is only responsible for driving handshake and checking the early-data availability. All logic for finishing a handshake (i.e. checking whether early-data is accepted and checking alpn value) has been moved to HandshakeDone.
The patch also extracts FinishNPNSetup that is responsible for the bookkeeping after a handshake is done or fails, e.g. resetting transactions if 0Rtt is used but handshake fails, updating timings and sending telemetry.

HandshakeDone needs to be dispatched so that it is not called inside nss locks. The side effect of this is that nsHttpConnection::OnSocketWritable() may be called in between  HandshakeDone being dispatched and executed. Therefore we still need to keep CheckCanWrite0RTTData(). This can be fixed in a follow up patch.

Side cleanups:
Remove mNotTrustedMitmDetected - his was used for ESNI, but it is not used anymore

Differential Revision: https://phabricator.services.mozilla.com/D123824
2021-09-17 13:19:01 +00:00
Dragana Damjanovic eebb396d61 Bug 1382886 - Don’t use a special way to write 0RTT data. Reuse the standard code path r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D123680
2021-09-17 13:19:01 +00:00
Dragana Damjanovic 1f0044c034 Bug 1382886 - Add a callback when the handshake is done. r=necko-reviewers,kershaw,keeler
Differential Revision: https://phabricator.services.mozilla.com/D123601
2021-09-17 13:19:00 +00:00
Dragana Damjanovic e5fd2cf6d3 Bug 1382886 - Refactor EnsureNPNComplete r=necko-reviewers,kershaw
Extract Check0RttEnabled
The old code checks 0RTT state then does a DriveHandshake then checks 0RTT again. This is done in this way because before DriveHandshake is called for the first time 0RTT states are not set.  DriveHandshake is sometimes called as a side effect by IsAlive() check. The new code makes this less complex and just calls DriveHandshaek before checking 0RTT.
Extract code for setting 0RTT telemetry values.
Remove some code that set timing because the same code is called a bit later again.

Differential Revision: https://phabricator.services.mozilla.com/D123645
2021-09-17 13:19:00 +00:00
Yury Delendik 19b0d24e7f Bug 1487113 - nsICacheInfoChannel.alternativeDataInputStream as attribute. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D117360
2021-09-17 12:16:23 +00:00
Valentin Gosu 72c414923b Bug 1730494 - Add error codes for COOP and COEP errors r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D125671
2021-09-16 08:31:04 +00:00
Valentin Gosu 13ab902ec7 Bug 1730494 - Show error in webconsole when resource is blocked by CORP headers r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D125392
2021-09-16 08:31:03 +00:00
Valentin Gosu c1f1effff8 Bug 1699373 - Call ProcessCrossOrigin*Header methods after loading cached headers r=necko-reviewers,dragana
Previously we called `ProcessCrossOriginEmbedderPolicy` in
`nsHttpChannel::ContinueProcessResponse1`, but we only loaded the cached
response headers in `ContinueProcessResponse3`, meaning that we incorrectly
reported a missing header for the revalidated resource.

This change moves the header checking calls to `ContinueProcessNormal` and
`AsyncProcessRedirection` instead, so they get executed after processing
the cached headers.

Differential Revision: https://phabricator.services.mozilla.com/D125184
2021-09-16 08:31:03 +00:00
Cristian Tuns f2f6eac4d6 Backed out 3 changesets (bug 1487113) for causing mochitest failures. CLOSED TREE
Backed out changeset b20e5d76c77e (bug 1487113)
Backed out changeset b0b2b27dcb68 (bug 1487113)
Backed out changeset 9214b396eb84 (bug 1487113)
2021-09-14 17:38:32 -04:00