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

22597 Коммитов

Автор SHA1 Сообщение Дата
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
Valentin Gosu 6b7ecfaebe Bug 1733318 - Better logging in GetAddrInfo r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D127061
2021-09-30 12:14:19 +00:00
Valentin Gosu 6cd518bee9 Bug 1732961 - TRR should not be ignoring enterprise policy value of network.trr.uri/mode r=nhnt11
In bug 1626057 we added support for steering. There we made the distinction
between a default network.trr.uri pref, and a user-set one by using
`Preferences::HasUserValue`. However, it seems that enterprise policies change
the default branch of the pref, so this would lead to it having a lower
priority than DoHRollout or steering.

In bug 1713036 we introduced `network.trr.default_provider_uri` and made
`network.trr.uri` an empty string, so checking hasUserValue isn't required
anymore.

Differential Revision: https://phabricator.services.mozilla.com/D126961
2021-09-30 11:58:52 +00:00
Valentin Gosu 2ec278d9e1 Bug 1732961 - Add xpcshell-test for setting an enterprise policy for DNSOverHTTPS r=nhnt11
Differential Revision: https://phabricator.services.mozilla.com/D126960
2021-09-30 11:58:51 +00:00
Manuel Bucher 0a9c89d46a Bug 1733323 - Remove `.only()`-call on test case to enable other trr test cases again r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D127066
2021-09-30 08:49:13 +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
Olli Pettay 524e95c9e4 Bug 1732250, use the original URI from the old channel when updating session history entry, r=peterv,necko-reviewers,valentin
https://searchfox.org/mozilla-central/rev/1df999af9999ccb436512cfece57a68d94d36e08/netwerk/protocol/http/nsHttpChannel.cpp#2876
makes original uri handling in the channel rather magical. The value of it on the new channel is bogus during
AsyncOnChannelRedirect call, and nsIChannel.idl doesn't hint about that behavior.

browser_getNavigationHistory.js can work as a testcase once it is enabled for Fission.

Differential Revision: https://phabricator.services.mozilla.com/D126735
2021-09-29 09:35:59 +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
Valentin Gosu 0504488366 Bug 1731054 - Reenable bug1708673 without perf regression r=necko-reviewers,kershaw
Depends on D126360

Differential Revision: https://phabricator.services.mozilla.com/D126361
2021-09-28 07:08:28 +00:00
Tim Huang 93a518fe4f Bug 1731557 - Part 1: Using an enum to represent storage permission in the loadInfo. r=pbz,necko-reviewers,dragana
To differentiate the storage permission is granted by either the
permission or the allowList, we need to change the hasStoragePermission
to an enum to represent the storage permission state.

This patch also changes the name of the attribute to make it reasonable
with respect to this change.

Differential Revision: https://phabricator.services.mozilla.com/D126276
2021-09-27 22:50:41 +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
Kershaw Chang 25350b4da3 Bug 1615017 - Use a wrapped lock to protect data in CacheFileMetadata, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D126650
2021-09-27 20:59:17 +00:00
ffxbld acd813f1dd No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D126479
2021-09-23 15:38:10 +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
lyavor c8c3f419e0 Bug 1725402 - HTTPS-First should copy referrerInfo (and potentially more state) from upgraded channel when performing a fallback to http.r=ckerschb,Gijs,freddyb
Differential Revision: https://phabricator.services.mozilla.com/D122585
2021-09-23 10:51:14 +00:00
Valentin Gosu e41b7a871b Bug 1732095 - Remove unused nsICacheStorageService.synthesizedCacheStorage r=necko-reviewers,kershaw
Depends on D126357

Differential Revision: https://phabricator.services.mozilla.com/D126360
2021-09-23 09:14:19 +00:00
Valentin Gosu d99d6259ee Bug 1732095 - Clean up CacheStorageService r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D126357
2021-09-23 09:14:19 +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
Narcis Beleuzu a2842d5f98 Merge autoland to mozilla-central. a=merge 2021-09-22 07:06:10 +03:00
Narcis Beleuzu a750766613 Backed out changeset da95455590d7 (bug 1475641) for marionette crashes on test_profile_management.py . CLOSED TREE 2021-09-22 01:19:18 +03:00
Kershaw Chang 72e0fa0067 Bug 1475641 - Move PAProxyAutoConfig to socket process, r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D125855
2021-09-21 19:54:29 +00:00
Kershaw Chang 558cd8791f Bug 1715960 - Add a simple parity check to URLSegment, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D124748
2021-09-21 19:13:37 +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
Christoph Kerschbaumer 502869a709 Bug 1731602: Update some tests within netwerk/ to work with https-first enabled r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D126103
2021-09-20 14:30:47 +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
Kershaw Chang 4fce4f4f6d Bug 1731030 - Check if the status code is NS_ERROR_OFFLINE, r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D125809
2021-09-17 12:53:03 +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