2020-07-16 Billy Brumley <bbrumley@gmail.com>
* lib/freebl/ecl/ecl-priv.h, lib/freebl/ecl/ecl.c,
lib/freebl/ecl/ecp_secp521r1.c, lib/freebl/freebl_base.gypi,
lib/freebl/manifest.mn:
Bug 1631583 - ECC: constant time P-521 r=kjacobs,rrelyea,bbeurdouche
This portable code contributed by the Network and Information
Security Group (NISEC) at Tampere University comes from:
[ECCKiila](https://gitlab.com/nisec/ecckiila) that uses
[Fiat](https://github.com/mit-plv/fiat-crypto) for the underlying
field arithmetic.
Co-authored-by: Luis Rivera-Zamarripa <luis.riverazamarripa@tuni.fi>
Co-authored-by: Jesús-Javier Chi-Domínguez
<jesus.chidominguez@tuni.fi>
[ca068f5b5c17] [tip]
* lib/freebl/ecl/ecl-priv.h, lib/freebl/ecl/ecl.c,
lib/freebl/ecl/ecp_secp384r1.c, lib/freebl/freebl_base.gypi,
lib/freebl/manifest.mn, tests/ec/ectest.sh:
Bug 1631583 - ECC: constant time P-384 r=bbeurdouche,rrelyea
This portable code contributed by the Network and Information
Security Group (NISEC) at Tampere University comes from:
[ECCKiila](https://gitlab.com/nisec/ecckiila) that uses
[Fiat](https://github.com/mit-plv/fiat-crypto) for the underlying
field arithmetic.
Co-authored-by: Luis Rivera-Zamarripa <luis.riverazamarripa@tuni.fi>
Co-authored-by: Jesús-Javier Chi-Domínguez
<jesus.chidominguez@tuni.fi>
[d19a3cd451bb]
2020-07-13 Robert Relyea <rrelyea@redhat.com>
* lib/pk11wrap/pk11pub.h:
Bug 1643528 Cannot compile code with nss headers and -Werror=strict-
prototypes r=kjacobs
[01ffd8fef7fa]
2020-07-10 Daiki Ueno <dueno@redhat.com>
* gtests/ssl_gtest/ssl_auth_unittest.cc, lib/ssl/ssl3con.c,
lib/ssl/ssl3exthandle.c, lib/ssl/sslimpl.h,
lib/ssl/tls13exthandle.c:
Bug 1646324, advertise rsa_pkcs1_* schemes in CH and CR for certs,
r=mt
Summary: In TLS 1.3, unless "signature_algorithms_cert" is
advertised, the "signature_algorithms" extension is used as an
indication of supported algorithms for signatures on certificates.
While rsa_pkcs1_* signatures schemes cannot be used for signing
handshake messages, they should be advertised if the peer wants to
to support certificates signed with RSA PKCS#1.
This adds a flag to ssl3_EncodeSigAlgs() and ssl3_FilterSigAlgs() to
preserve rsa_pkcs1_* schemes in the output.
Reviewers: mt
Reviewed By: mt
Bug #: 1646324
[df1d2695e115]
2020-07-09 Benjamin Beurdouche <bbeurdouche@mozilla.com>
* gtests/pk11_gtest/pk11_pbkdf2_unittest.cc, lib/pk11wrap/pk11pbe.c:
Bug 1649648 - Fix null pointers passed as argument in
pk11wrap/pk11pbe.c:886 r=kjacobs
[de661583d467]
Differential Revision: https://phabricator.services.mozilla.com/D83824
Due to changes in about:newtab somehow the preferences code is getting
initialised before the call to openPreferencesViaOpenPreferencesAPI().
Update this code to work when preferences is already initialised.
Differential Revision: https://phabricator.services.mozilla.com/D81067
Two tests in this file had the same name, give this one a more specific name
so that console output is easier to follow.
Differential Revision: https://phabricator.services.mozilla.com/D81066
This patch removes the excemptions for about:newtab, about:home and
about:blank.
When we switch processes using session restore we sometimes focus the
content area. We mustn't do this if the uri is undefined, this can happen
for some of these pages and we expect the address bar to be focused instead.
Differential Revision: https://phabricator.services.mozilla.com/D80339
Knowing the time it takes for the parent process to gather its profile, we expect sub-processes not to take longer than twice that time (plus a bit more).
Each time we receive a profile, the timer is restarted* to allow more time for pending processes.
If the most current timer fires, we assume that pending processes may be frozen and unable to ever respond, so we use all profiles gathered so far.
(There is currently no indication to the user that processes are missing, this should be added in the future.)
* Tech detail: We just cancel the current timer and forget about it, then start a new one and keep track of it. When a timer fires, we can compare its address to the address of the last (most current) timer, and only that one can force the end of profile-gathering.
Differential Revision: https://phabricator.services.mozilla.com/D83626
This creates the print.modal_print_preview.enabled pref to manage
whether the tab modal print UI should be used and creates some
files we'll need for the UI to use.
Differential Revision: https://phabricator.services.mozilla.com/D83445
There were cases where the clip task generation considered a primitive
to be invisible, while the rest of the code proceeded with an assumption
that the clip task was created.
Differential Revision: https://phabricator.services.mozilla.com/D82121
Calling `getPrivate` directly spreads implementation details of the Debugger
wrapper types across multiple files in a way that is ugly and complicates the
implementation. We can easily avoid that by making the existing referent
functions public.
Differential Revision: https://phabricator.services.mozilla.com/D83443
There's no reason for all of the debugger's wrapper types to share an OWNER
slot definitions. Only a single callsite in the codebase runs on a generic
JSObject*, and that site _already_ immediately refines the object into an
explicit child type right after it gets the owner, so reordering the code
allows us to rely on the wrapper types to define their own functions for
getting the owner value.
Differential Revision: https://phabricator.services.mozilla.com/D83442
Currently we iterate over all debuggers to find the ones that have a hook to
call. This is not ideal because we do extra iteration for no reason and also
because it makes the GC hook unlike any other type of hook. The GC hook is
conceptually a runtime-wide hook just like 'onNewGlobal', so this patch
changes the GC hook implementation to use the same approach as that hook.
Differential Revision: https://phabricator.services.mozilla.com/D83440
With this patch, the creation cost of `TextFragmentData` is minimized, but
`MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()` can work
with the latest DOM tree information at touching start of the deleting range
even after touching end of the range.
Depends on D83228
Differential Revision: https://phabricator.services.mozilla.com/D83229
This is what the original method should've done. Mutation event listeners may
change the DOM tree at the first modification, but it hasn't checked whether
the range to delete or replace around start of deleting range is still valid
or not.
Depends on D83226
Differential Revision: https://phabricator.services.mozilla.com/D83228
For representing delete or replace data which have the range and replace string,
this patch creates `ReplaceRangeDataBase` class which is stack-only, has
`EditorDOMRange` or `EditorDOMRangeInTexts` as the range and has replace string
which can be empty string.
Then, `MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()` should
modify the DOM tree by itself. With the following patch, the behavior is
corrected for multiple DOM tree changes.
Depends on D83224
Differential Revision: https://phabricator.services.mozilla.com/D83226
This patch is preparation for easier to review.
This patch duplicates the body of
`MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()` and calls the
copies from new `MakeSureToKeepVisibleStateOfWhiteSpacesAroundDeletingRange()`.
The one is for handling start of deleting range, and the other is for handling
end of deleting range.
As you see, this patch and the following patches do not work because of the
duplicated code. Perhaps, part 2 works if there is no mutation event listeners.
Part 9 works even if there is mutation event listeners which touch the DOM
tree in the worst case (when it touches both end of delete range and start of
delete range, and around the start of deleting range is modified by JS).
Finally, part 9 takes back the original performance.
Depends on D82715
Differential Revision: https://phabricator.services.mozilla.com/D83217
Forgot to follow up on these two remaining non-standard values that may have
been being used to reset a <meter> or <input type=number> back to its
original appearance, but which telemetry showed no usage of.
Differential Revision: https://phabricator.services.mozilla.com/D83598
This includes all of the <compat-auto> values, plus menulist-button,
which doesn't behave any differently from menulist currently.
Differential Revision: https://phabricator.services.mozilla.com/D83436
Uses of `-moz-appearance: none` are changed to `appearance: none`.
Uses of other values that are simply reverting the appearance back to
its default are changed to `appearance: auto`.
Uses of values in UA sheets that are defining the inherent appearance of
widgets are changed to:
appearance: auto;
-moz-default-appearance: <value>;
since those values are either no longer supported on (-moz-)appearance,
or are still supported but only in some limited form.
There are some uses of `-moz-appearance: textfield` on <input
type=number> elements that are renamed to `appearance: textfield`.
Differential Revision: https://phabricator.services.mozilla.com/D83430
This patch adds a vectored exception handler to catch STATUS_HEAP_CORRUPTION
exceptions on Windows. Previously these crashes would terimnate the affected
process without generating a minidump. For child process crashes the user would
be notified of the crash but could not report them. Main process crashes on the
other hand would close Firefox abruptly without any sort of feedback to the
user.
Note that this type of exceptions are originated from Windows default memory
allocator which we replace with jemalloc. As such they're unlikely to be thrown
from our code, but are frequently encountered when dealing with injected DLLs
and other external components.
Differential Revision: https://phabricator.services.mozilla.com/D83753
This patch attempts to fix the permanent win mingw build failure caused
by use of the undeclared identifiers 'S_IFLNK' and 'S_IFSOCK' in
dom/system/OSFileConstants.cpp
These identifiers are only ever declared on Unix systems (Linux, macOS,
Android, etc.), so the `ifdef` guard around the use of these constants
has been updated appropriately.
Differential Revision: https://phabricator.services.mozilla.com/D83844
clang may potentially insert trapping instructions when __builtin_unreachable() is used.
We need to ensure we do not use this intrinsic when asserts are disabled. To work around
this, we add a condition that is checked before entering the body of SK_ABORT.
Differential Revision: https://phabricator.services.mozilla.com/D83841
PSM internals are currently tightly-copuled with NSS data types. In many cases
this is unnecessary, because PSM often needs only a sequence of bytes (in the
case of certificates, for example). This tight coupling can also have
performance and architectural impacts. For example, thread contention for NSS
resources has caused performance issues in the past. This patch starts the
process of avoiding using these types as much as possible in PSM.
More specifically, RootCABinNumber can take a Span<uint8_t> instead of a
SECItem. Instead of taking a PK11SlotInfo (which essentially requires having a
CERTCertificate), we can use PK11_FindEncodedCertInSlot to see if the
certificate exists on a small number of specific slots to achieve the same
effect as before. Doing this should eventually allow us to avoid creating a
CERTCertificate, which implicitly involves searching all slots on all modules.
Differential Revision: https://phabricator.services.mozilla.com/D83682