In each modified case, we can transfer an existing reference count from a
going-out-of-scope local variable, instead of incurring unnecessary refcount
traffic by AddRef()'ing when we append and then immediately Release()'ing when
the local variable goes out of scope.
Differential Revision: https://phabricator.services.mozilla.com/D302966
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
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
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
This is a large number of largely mechanical changes. When possible, the code
was called to directly call `.get()` instead, performing the assertions
manually. In many places PromiseFlatCString() calls were added to dynamically
copy the strings into null terminated buffers if the string was not null
terminated.
Differential Revision: https://phabricator.services.mozilla.com/D286158
This patch renames nsITransportSecurityInfo.failedCertChain to
handshakeCertificates and makes the property always available (after the
handshake has completed, that is).
Differential Revision: https://phabricator.services.mozilla.com/D268467
This patch renames nsITransportSecurityInfo.failedCertChain to
handshakeCertificates and makes the property always available (after the
handshake has completed, that is).
Differential Revision: https://phabricator.services.mozilla.com/D268467
The race here is caused by the fact that CommonSocketControl::mUsedPrivateDNS was
initialized to false in the constructor, and then set to
`SetUsedPrivateDNS(GetProviderFlags() & nsISocketProvider::USED_PRIVATE_DNS);`
in SetCertVerificationResult.
However, these flags don't change, so we can just initialize it in the constructor.
Differential Revision: https://phabricator.services.mozilla.com/D267401
SEC_ERROR_REVOKED_CERTIFICATE is a certificate error, not a TLS protocol error.
This patch updates the categorization of this error while maintaining the
property that it cannot be overridden. This has the benefit of making it
possible to show more diagnostic information in the error page, which this
patch also adds.
Differential Revision: https://phabricator.services.mozilla.com/D239220
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
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
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
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
1. Allow to store more than one token per key.
2. Allow to use the token only once. The token will be removed after reading it.
3. Add a gtest.
Differential Revision: https://phabricator.services.mozilla.com/D153605
1. Allow to store more than one token per key.
2. Allow to use the token only once. The token will be removed after reading it.
3. Add a gtest.
Differential Revision: https://phabricator.services.mozilla.com/D153605
This patch updates some uses of RefPtr<nsNSSCertificate> to
nsCOMPtr<nsIX509Cert> because it's not necessary to use the concrete class.
This patch also removes some empty files that should have been removed in a
previous bug.
Differential Revision: https://phabricator.services.mozilla.com/D136679
nsIX509Cert::GetCert() may cause a CERTCertificate to be instantiated. Doing so
can have performance and stability implications, so it's best to avoid it.
This patch avoids it where possible.
Differential Revision: https://phabricator.services.mozilla.com/D135945
nsIX509Cert::GetCert() may cause a CERTCertificate to be instantiated. Doing so
can have performance and stability implications, so it's best to avoid it.
This patch avoids it where possible.
Depends on D135943
Differential Revision: https://phabricator.services.mozilla.com/D135945
nsNSSCertificate had a few functions that acted as constructors. This patch
removes these unnecessary functions and uses actual constructors.
Depends on D134977
Differential Revision: https://phabricator.services.mozilla.com/D134978