Commit Graph
16 Commits
Author SHA1 Message Date
Lars Eggert 8bd928e1a1 Bug 2033073 - Retry stale PSK resumptions when no early data was offered r=valentin,kershaw,keeler,necko-reviewers,nss-reviewers,jesup
The DECRYPT_ERROR_ALERT retry added in this bug only fires when
mEarlyDataWasAvailable is true. Servers that don't advertise
max_early_data_size (e.g. wptserve, many real-world servers) never
hit it, so a stale persisted session ticket surfaces as a fatal
"Secure Connection Failed" instead of being evicted and retried.

- Move PossibleZeroRTTRetryError() into the outer Close() restart
  condition so the retry path runs regardless of early-data state.
- Extend the alert list with illegal_parameter, handshake_failure,
  decode_error, internal_error, missing_extension, and others that
  PSK rejection can plausibly trigger. Cert-validation alerts stay
  excluded since they would fail identically on a fresh handshake.

Differential Revision: https://phabricator.services.mozilla.com/D297580
2026-05-03 13:25:55 +00:00
Lars Eggert 08f46072a7 Bug 2023512 - Micro-optimizations in netwerk r=valentin,necko-reviewers,webrtc-reviewers,jesup,mjf
Avoid heap allocation for temporary strings
- nsCString(x).get() in LOG calls
- nsCString(Substring(...)).ToInteger()
- Append(nsPrintfCString(...))
- ToAddrPortString: replaced triple-alloc (nsCString + nsPrintfCString + assign)
- DefaultURI::Write/GetUserPass: removed unnecessary nsAutoCString temporaries

Eliminate copies
- SSLTokensCache::GetLocked: clone-then-destroy
- ObliviousHttpService::GetTRRSettings: Assign(Clone())
- LoadInfo truncated URI builder: 5-variable operator+ chain
- for (auto x : on containers of RefPtr/nsCOMPtr
- LoadInfo::CreateTruncatedPrincipal: AppendElement(x)

Eliminate redundant initialization
- DNS.cpp::InitFromString: removed {} redundant with following memset
- Dashboard::LogData ctor: mHost(host)

Idiomatic cleanup
- FuzzySecurityInfo/FuzzySocketControl: Assign(""_ns)

Differential Revision: https://phabricator.services.mozilla.com/D288105
2026-03-20 07:49:15 +00:00
rperta 8b04ae3215 Revert "Bug 2023512 - Micro-optimizations in netwerk r=valentin,necko-reviewers,webrtc-reviewers,jesup,mjf" for causing ipv6 tests related failures
This reverts commit 99626e5548.
2026-03-19 07:58:45 +00:00
Lars Eggert 99626e5548 Bug 2023512 - Micro-optimizations in netwerk r=valentin,necko-reviewers,webrtc-reviewers,jesup,mjf
Avoid heap allocation for temporary strings
- nsCString(x).get() in LOG calls
- nsCString(Substring(...)).ToInteger()
- Append(nsPrintfCString(...))
- ToAddrPortString: replaced triple-alloc (nsCString + nsPrintfCString + assign)
- DefaultURI::Write/GetUserPass: removed unnecessary nsAutoCString temporaries

Eliminate copies
- SSLTokensCache::GetLocked: clone-then-destroy
- ObliviousHttpService::GetTRRSettings: Assign(Clone())
- LoadInfo truncated URI builder: 5-variable operator+ chain
- for (auto x : on containers of RefPtr/nsCOMPtr
- LoadInfo::CreateTruncatedPrincipal: AppendElement(x)

Eliminate redundant initialization
- DNS.cpp::InitFromString: removed memset redundant with preceding {}
- Dashboard::LogData ctor: mHost(host)

Idiomatic cleanup
- FuzzySecurityInfo/FuzzySocketControl: Assign(""_ns)

Differential Revision: https://phabricator.services.mozilla.com/D288105
2026-03-19 06:21:56 +00:00
rperta d14dbd3f66 Revert "Bug 2023512 - Micro-optimizations in netwerk r=valentin,necko-reviewers,webrtc-reviewers,jesup,mjf" for causing ipv6 tests related failures
This reverts commit 114b8c673b.
2026-03-18 08:32:11 +00:00
Lars Eggert 114b8c673b Bug 2023512 - Micro-optimizations in netwerk r=valentin,necko-reviewers,webrtc-reviewers,jesup,mjf
Avoid heap allocation for temporary strings
- nsCString(x).get() in LOG calls
- nsCString(Substring(...)).ToInteger()
- Append(nsPrintfCString(...))
- ToAddrPortString: replaced triple-alloc (nsCString + nsPrintfCString + assign)
- DefaultURI::Write/GetUserPass: removed unnecessary nsAutoCString temporaries

Eliminate copies
- SSLTokensCache::GetLocked: clone-then-destroy
- ObliviousHttpService::GetTRRSettings: Assign(Clone())
- LoadInfo truncated URI builder: 5-variable operator+ chain
- for (auto x : on containers of RefPtr/nsCOMPtr
- LoadInfo::CreateTruncatedPrincipal: AppendElement(x)

Eliminate redundant initialization
- DNS.cpp::InitFromString: removed memset redundant with preceding {}
- Dashboard::LogData ctor: mHost(host)

Idiomatic cleanup
- FuzzySecurityInfo/FuzzySocketControl: Assign(""_ns)

Differential Revision: https://phabricator.services.mozilla.com/D288105
2026-03-18 06:49:28 +00:00
Sylvestre Ledru a22215a2f9 Bug 2023419 - Remove Emacs/Vim modelines from netwerk/ r=emilio,cookie-reviewers,valentin
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287861
2026-03-17 12:06:31 +00:00
Valentin Gosu c3dde813f4 Bug 1851294 - Add nsITLSSocketControl.asyncStartTLS r=jschanck,necko-reviewers,kershaw
Thunderbird uses nsITLSSocketControl.startTLS to drive the XMPP
connection, but since we started enforcing proper thread safety in
bug 1847260, it's asserting when called on the main thread.

This patch marks StartTLS and proxyStartTLS as [noscript] and adds
asyncStartTLS. This new method dispatches a runnable to the socket thread
to call startTLS, then resolves (or rejects with the nsresult as an arg)
on the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D207692
2024-04-19 09:42:41 +00:00
Dana Keeler 63db05ab9d Bug 1401466 - make the client auth certificate selection dialog tab modal r=jschanck,necko-reviewers,bolsson,kershaw,valentin
Previously, the client authentication certificate selection dialog could show
up unexpectedly. Because it was modal, it would prevent user interaction with
the browser. It could even get in a state where the dialog couldn't be
interacted with, and neither could anything else, so the entire browser would
be locked and the user would have to quit and restart.

This patch associates a top-level outer content window ID (called "browserId"
in networking code) with each NSSSocketControl. When a peer asks for a client
authentication certificate, the NSSSocketControl can use the ID to find the
relevant tab and open a tab-modal dialog, which allows other browser UI to be
interacted with.

Some loads cannot be associated with browser tabs, and so the implementation
falls back to opening a window-modal dialog on the most recently active window.
This is still better than the previous implementation, since the dialog is
connected to a window rather than being its own separate dialog.

Differential Revision: https://phabricator.services.mozilla.com/D183775
2023-08-30 03:05:35 +00:00
Dana Keeler 94dc5b9ec4 Bug 1813618 - buffer client auth certificate selection UI for speculative connections r=valentin,jschanck,necko-reviewers,kershaw
When necko makes a speculative connection, the peer may ask for a client
authentication certificate. This patch makes it so that when this happens,
no certificate selection UI will be shown until the connection is claimed (as
in, it is no longer merely speculative).

Differential Revision: https://phabricator.services.mozilla.com/D175528
2023-04-18 17:52:49 +00:00
Dana Keeler ca6f24b54c Bug 1805234 - provide FuzzySecurityInfo for FuzzySocketControl r=jschanck,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D164620
2022-12-14 17:33:58 +00:00
Dana Keeler a9bcca7130 Bug 1791633 - separate nsITLSSocketControl from nsITransportSecurityInfo r=necko-reviewers,kershaw,jschanck
Depends on D160311

Differential Revision: https://phabricator.services.mozilla.com/D160313
2022-11-16 16:37:29 +00:00
Marian-Vasile Laza f986221d71 Backed out 3 changesets (bug 1791633) for causing bustages on TransportSecurityInfo.cpp. CLOSED TREE
Backed out changeset 23b864e14db0 (bug 1791633)
Backed out changeset 0bcba3375ec0 (bug 1791633)
Backed out changeset ab0ea0d68f5c (bug 1791633)
2022-11-15 23:51:58 +02:00
Dana Keeler f608ea9a59 Bug 1791633 - separate nsITLSSocketControl from nsITransportSecurityInfo r=necko-reviewers,kershaw,jschanck
Depends on D160311

Differential Revision: https://phabricator.services.mozilla.com/D160313
2022-11-15 20:03:29 +00:00
Butkovits Atila a9f1f1a451 Backed out 3 changesets (bug 1791633) for causing build bustages at nsHttpConnectionMgr.cpp:. CLOSED TREE
Backed out changeset ee9744982673 (bug 1791633)
Backed out changeset f5a4bfdaba40 (bug 1791633)
Backed out changeset f57131b9cfe2 (bug 1791633)
2022-11-15 08:07:16 +02:00
Dana Keeler 4f397cbfed Bug 1791633 - separate nsITLSSocketControl from nsITransportSecurityInfo r=necko-reviewers,kershaw,jschanck
Depends on D160311

Differential Revision: https://phabricator.services.mozilla.com/D160313
2022-11-15 05:34:40 +00:00