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

15802 Коммитов

Автор SHA1 Сообщение Дата
Jan Varga 03e0a91794 Bug 1669437 - Add necessary infrastructure for independent in-memory only local storage database; r=asuth,dom-workers-and-storage-reviewers
The new infrastructure consists of a separate bridge between the content and the
parent process and a separate local storage database in the parent process.
The new infrastructure can be used for storing and sharing of private browsing
data across content processes.
This patch only creates necessary infrastructure, actual enabling of storing and
sharing of data across content processes will be done in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D96562
2020-11-11 13:12:57 +00:00
J.C. Jones 0644349b9b Bug 1671713 - land NSS NSS_3_59_BETA1 UPGRADE_NSS_RELEASE, r=kjacobs
2020-11-10  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/certdb/certdb.c, lib/certdb/stanpcertdb.c,
	lib/pk11wrap/pk11cert.c, lib/pki/pki3hack.c:
	Bug 1607449 - Lock cert->nssCertificate to prevent data race.
	r=jcj,keeler

	[c3cb09a7d087] [NSS_3_59_BETA1]

Differential Revision: https://phabricator.services.mozilla.com/D96652
2020-11-11 00:56:20 +00:00
Moritz Birghan c297b0b108 Bug 1663052 - Enable EV Treatment for SecureTrust's Trustwave Global root certificates r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D96437
2020-11-09 22:20:36 +00:00
Moritz Birghan 9614d4d163 Bug 1658596 - Enable EV Treatment for "IdenTrust Commercial Root CA 1" root certificate r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D96435
2020-11-09 22:32:27 +00:00
ffxbld d14f34aeb2 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D96420
2020-11-09 14:25:22 +00:00
Dana Keeler fd77d8d2c9 Bug 1669414 - osclientcerts: temporarily remove differentiation between modern and legacy keys r=rmf
Eventually it needs to be possible for osclientcerts to differentiate between
keys that can and can't perform modern cryptography (RSA-PSS being the main
issue). This is because PSM and NSS need to know not to offer to use a key that
can't actually perform the signing operation in question. However, the current
implementation can be very slow if the user has slow hardware with a number of
keys on it. Since PSM and NSS changes are required to make use of this
differentiation anyway, the best approach for now seems to be to skip this step.

Differential Revision: https://phabricator.services.mozilla.com/D96148
2020-11-06 18:24:40 +00:00
Dana Keeler 4f13e2395d Bug 1675339 - make nsCertOverrideService only block shutdown when a write is pending r=kjacobs
Bug 1634065 will involve changing when nsCertOverrideService gets initialized.
It turns out that doing this causes
services/crypto/tests/unit/test_crypto_random.js to fail various assertions in
the JS engine. It's unclear what the underlying issue is, but the failures
happen as a result of marking nsCertOverrideService as a shutdown blocker
unconditionally in its initialization. This patch works around this by marking
the service as a blocker only when there's a write event happening, which is
arguably more correct anyway.

Differential Revision: https://phabricator.services.mozilla.com/D95899
2020-11-06 18:16:51 +00:00
Kevin Jacobs 92af1fd6cc Bug 1671713 - land NSS 97751cd6d553 UPGRADE_NSS_RELEASE, r=jcj
2020-11-03  Kevin Jacobs  <kjacobs@mozilla.com>

	* gtests/common/testvectors/hmac-sha256-vectors.h,
	gtests/common/testvectors/hmac-sha384-vectors.h,
	gtests/common/testvectors/hmac-sha512-vectors.h,
	gtests/common/testvectors_base/test-structs.h,
	gtests/pk11_gtest/manifest.mn, gtests/pk11_gtest/pk11_gtest.gyp,
	gtests/pk11_gtest/pk11_hmac_unittest.cc:
	Bug 1672823 - Add Wycheproof HMAC test cases. r=jcj

	[97751cd6d553] [tip]

	* gtests/common/testvectors/hkdf-sha1-vectors.h,
	gtests/common/testvectors/hkdf-sha256-vectors.h,
	gtests/common/testvectors/hkdf-sha384-vectors.h,
	gtests/common/testvectors/hkdf-sha512-vectors.h,
	gtests/common/testvectors/hkdf-vectors.h,
	gtests/common/testvectors_base/test-structs.h,
	gtests/common/wycheproof/genTestVectors.py,
	gtests/pk11_gtest/manifest.mn,
	gtests/pk11_gtest/pk11_hkdf_unittest.cc:
	Bug 1672823 - Add Wycheproof HKDF test cases. r=bbeurdouche

	[5a02ca2617cf]

	* gtests/common/testvectors/dsa-vectors.h,
	gtests/common/testvectors_base/test-structs.h,
	gtests/common/wycheproof/genTestVectors.py,
	gtests/common/wycheproof/source_vectors/dsa_test.json,
	gtests/pk11_gtest/manifest.mn,
	gtests/pk11_gtest/pk11_dsa_unittest.cc,
	gtests/pk11_gtest/pk11_gtest.gyp:
	Bug 1672823 - Add Wycheproof DSA test cases. r=jcj

	[3ce42ead87f9]

	* lib/dev/devslot.c, lib/dev/devt.h:
	Bug 1663661 - Guard against NULL token in nssSlot_IsTokenPresent.
	r=jcj

	This patch addresses locking inconsistency in
	`nssSlot_IsTokenPresent` by retaining the slot lock for the duration
	of accesses to `slot->token`. This is already done correctly
	elsewhere. As a side effect, this introduces an ordering
	requirement: we take `slot->lock` followed by `session->lock`.

	[0ed11a5835ac]

2020-10-30  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/pk11wrap/pk11pars.c:
	Bug 1670835 - Fixup for 6f79a7695812, add missing return value
	check. r=rrelyea

	[424974716ef0]

Differential Revision: https://phabricator.services.mozilla.com/D96073
2020-11-06 00:54:30 +00:00
ffxbld de7e9afc3e No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D96062
2020-11-05 15:46:44 +00:00
Philipp Ammann 93c8ef1413 Bug 1661450 - Guard X11-only code behind #ifdef MOZ_X11 r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D88803
2020-08-31 11:41:22 +00:00
Cosmin Sabou 4d167c5d6b Backed out 5 changesets (bug 1661450) for causing build bustages. CLOSED TREE
Backed out changeset b01a3dceb3eb (bug 1661450)
Backed out changeset 4a0b897aa1b2 (bug 1661450)
Backed out changeset 561d7cce5353 (bug 1661450)
Backed out changeset 088f1afeff27 (bug 1661450)
Backed out changeset 04db3acdf84f (bug 1661450)
2020-11-05 12:00:59 +02:00
Philipp Ammann d3b31d1286 Bug 1661450 - Guard X11-only code behind #ifdef MOZ_X11 r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D88803
2020-08-31 11:41:22 +00:00
Dragana Damjanovic 830e14487e Bug 1674111 - Do not use HTTP3 for OCSP request. r=keeler
Do not use SPDY or HTTP3 for internal security operations. It could result
in the silent upgrade to ssl, which in turn could require an SSL
operation to fulfill something like an OCSP fetch, which is an
endless loop.

Differential Revision: https://phabricator.services.mozilla.com/D95295
2020-11-04 12:18:49 +00:00
Razvan Maries 10425eddfc Backed out 7 changesets (bug 1658084, bug 1671983) for perma failures on browser_async_remove_tab.js and browser_e10s_chrome_process.js. CLOSED TREE
Backed out changeset 2e6309c1cdbd (bug 1658084)
Backed out changeset 99aafd9304ef (bug 1671983)
Backed out changeset 80280b85280a (bug 1671983)
Backed out changeset 008db2659002 (bug 1671983)
Backed out changeset 32bd45c7fe3a (bug 1671983)
Backed out changeset 56e227e6580c (bug 1671983)
Backed out changeset a404f809f79d (bug 1671983)
2020-11-04 04:23:47 +02:00
Nika Layzell 5f9c85da95 Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-04 00:55:36 +00:00
Aaron Klotz a2f9ffcda8 Bug 1675090: Use rvalue ref in SandboxTarget::RegisterSandboxStartCallback; r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D95776
2020-11-03 19:36:42 +00:00
Kevin Jacobs b838f38de2 Bug 1671713 - land NSS 035110dfa0b9 UPGRADE_NSS_RELEASE, r=bbeurdouche
2020-10-26  Robert Relyea  <rrelyea@redhat.com>

	* lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocspresponse.c,
	tests/ssl/ssl.sh:
	Bug 1672291 libpkix OCSP failures on SHA1 self-signed root certs
	when SHA1 signatures are disabled. r=mt

	When libpkix is checking an OCSP cert, it can't use the passed in
	set of trust anchors as a base because only the single root that
	signed the leaf can sign the OCSP request. As a result it actually
	checks the signature of the self-signed root when processing an OCSP
	request. This fails of the root cert signature is invalid for any
	reason (including it's a sha1 self-signed root cert and we've
	disabled sha1 signatures (say, by policy)).

	Further investigation indicates the difference between our classic
	code and the current code is the classic code only checks OCSP
	responses on leaf certs. In the real world, those responses are
	signed by intermediate certificates (who won't have sha1 signed
	certificates anymore), so our signature processing works just fine.
	pkix checks OCSP on the intermediate certificates as well, which are
	signed by the root cert. In this case the root cert is a chain of 1,
	and is effectively a leaf. This patch updates the OCSP response code
	to not check the signatures on the single cert if that cert is a
	selfsigned root cert. This requires bug 391476 so we still do the
	other validation checking on the certs (making sure it's trusted as
	a CA).

	[035110dfa0b9] [tip]

2020-10-23  Robert Relyea  <rrelyea@redhat.com>

	* lib/certhigh/certvfypkix.c,
	lib/libpkix/pkix_pl_nss/module/pkix_pl_nsscontext.c,
	lib/libpkix/pkix_pl_nss/module/pkix_pl_nsscontext.h,
	lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c,
	lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocspresponse.c,
	tests/ssl/ssl.sh:
	Bug 1672291 libpkix OCSP failures on SHA1 self-signed root certs
	when SHA1 signatures are disabled.

	When libpkix is checking an OCSP cert, it can't use the passed in
	set of trust anchors as a base because only the single root that
	signed the leaf can sign the OCSP request. As a result it actually
	checks the signature of the self-signed root when processing an OCSP
	request. This fails of the root cert signature is invalid for any
	reason (including it's a sha1 self-signed root cert and we've
	disabled sha1 signatures (say, by policy)).

	Further investigation indicates the difference between our classic
	code and the current code is the classic code only checks OCSP
	responses on leaf certs. In the real world, those responses are
	signed by intermediate certificates (who won't have sha1 signed
	certificates anymore), so our signature processing works just fine.
	pkix checks OCSP on the intermediate certificates as well, which are
	signed by the root cert. In this case the root cert is a chain of 1,
	and is effectively a leaf. This patch updates the OCSP response code
	to not check the signatures on the single cert if that cert is a
	selfsigned root cert. This requires bug 391476 so we still do the
	other validation checking on the certs (making sure it's trusted as
	a CA).
	[97f69f7a89a1]

2020-10-26  Kevin Jacobs  <kjacobs@mozilla.com>

	* gtests/ssl_gtest/tls_filter.cc:
	Bug 1644209 - Fix broken SelectedCipherSuiteReplacer filter. r=mt

	This patch corrects the `SelectedCipherSuiteReplacer`filter to
	always parse the `session_id` variable (`legacy_session_id` for TLS
	1.3+). The previous code attempted to skip it in 1.3+ but did not
	account for DTLS wire versions, resulting in intermittent failures.

	[a79d14b06b4a]

2020-10-26  Daiki Ueno  <dueno@redhat.com>

	* gtests/ssl_gtest/ssl_tls13compat_unittest.cc, lib/ssl/ssl3con.c,
	lib/ssl/sslimpl.h:
	Bug 1672703, always tolerate the first CCS in TLS 1.3, r=mt

	Summary: This flips the meaning of the flag for checking excessive
	CCS messages, so it only rejects multiple CCS messages while the
	first CCS message is always accepted.

	Reviewers: mt

	Reviewed By: mt

	Bug #: 1672703

	[b03a4fc5b902]

2020-10-23  Robert Relyea  <rrelyea@redhat.com>

	* automation/abi-check/expected-report-libnssutil3.so.txt,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	lib/nss/nss.h, lib/ssl/ssl3con.c, lib/util/SECerrs.h,
	lib/util/nssutil.def, lib/util/secerr.h, tests/policy/policy.sh:
	Bug 1670835 Crypto Policy Support needs to be updated with
	disable/enable support

	Policy update

	Current state of the nss policy system:

	The initial policy patch focused on getting policy working well in
	handling ssl. The policy infrastructure used two existing NSS
	infrastructure: 1) Algorithm policies tied the OIDS and 2) the ssl
	policy constraints first created to handle export policy
	restrictions. To make loadable policies work, we added a couple of
	new things: 1) a policy parser to the secmod infrastructure which
	allows us to set algorithm policies based on a config file. This
	file had two sections: disallow= and allow=. Disallow turned off
	policy bits, and allow turned them on. Disallow was always parsed
	first, so you could very strictly control your policy map by saying
	disallow=all allow={exclusive list of allowed algorithms} 2) a new
	NSS_Option() value that allowed the policy parser to set integer
	values (like minimum tls version) based on the data in the policy
	parser. 3) SSL code which is run at ssl_init time that reads the
	algorithm policies and maps the results to SSL policies.

	The resulting loaded policy code, in general, sets the boundaries of
	what it possible, actually enable/disable of ssl cipher suites are
	still under program control, and the builtin NSS default values. The
	only consession to configuration is if a cipher is disallowed by
	policy, it is also disabled. Allowing a cipher suite by policy that
	wasn't already enabled, however, doesn't enable that policy by
	default. Inside the policy restrictions, applications can still make
	their own decisions on configuration and preference.

	At the time the policy system was designed, there were 3 additional
	features, which were designed, but not specified: disable, enable,
	and lock.

	disable and enable work just like disallow and allow, except the
	specify what the default settings are. This would allow the policy
	file to change the underlying default in the case where the
	application doesn't try to configure ssl on it's own.

	lock would make either the policy or configuration 'locked' meaning
	once the lock has been executed, no further changes to those
	configurations would be allowed.

	What is needed:

	We have a need for the following additional features:

	1) we want to turn more of the sha-1 hash function off by default.
	We still need sha-1 digest because it's used in many non-secure
	cases, but we do want to disable more sha-1 signature usage.
	Currently only CERT-SIGNATURE and various hmac usages in SSL ciphers
	can be controlled by policy. We want to disallow a greater range of
	signature (that is signature use in general).

	2) we want to disable more ciphers by default, but need a way to
	have certain policies (like LEGACY) turn them back on, so that our
	shipped system is more secure by default.

	What this patch provides:

	1) A new policy flag NSS_USE_ALG_IN_ANY_SIGNATURE was added. The
	cryptohi code which exports the NSS sign/verify high level code now
	checks the hash and signing algorithm against this new policy flag
	and fails if the policy isn't available. New key words were added to
	the policy parser for 'all-signature', which implies all signature
	flags at once, and 'signature', which maps to NSS_USE_ANY_SIGNATURE.
	NOTE: disable=all/signature and disable=all/all-signature are
	effective equivalent because cert-signatures eventually call the low
	level signature functions, but disable=all allow=rsa-pss/all-
	signature and disable=all allow=rsa-pss/signature are different in
	that the latter allows all rsa-pss signature and the latter allows
	rsa-pss signatures, but no on certificates (or on smime in the
	future) Also new keywords were added for rsa-pkcs, rsa-pss, and
	ecdsa for signature algorithms (along with dsa).

	2) This patch implements disable and enable. These functions only
	work on SSL configuration. In the future SMIME/CMS configuration
	could also be added. Because the policy system is parsed and handled
	by NSS, and SSL configuration is handled in SSL, we use the same
	Apply code we used to apply ssl policy to set the inital
	configuration. The configured enable/disable state is configured in
	the ALGORTHIM policy system, where one bit says the enable/disable
	value is active and another bit which gives it's state.

	3) two locks have been implented, policy-lock and ssl-lock. These
	are specified in the parser as flags (flags=policy-lock,ssl-lock).
	The policy locks all the policy changes: ssl_policy, algorithm
	policy, and options. It is implemented by two new exported
	functions: NSS_IsPolicyLocked() and NSS_LockPolicy(). The first
	allows applications to test if the policy is locked without having
	to try changing the policy. The various policy set functions check
	the NSS_IsPolicyLocked() function and returns SEC_ERROR_POLICY_LOCK
	if it's true. The ssl-lock changes the state of the policy to
	locked, and the state cannot be changed back without shutting down
	NSS. The second is implemented by setting a new Option called
	NSS_DEFAULT_LOCKS and the NSS_DEFAULT_SSL_LOCK flag. The idea is we
	can add an SMIME lock in the future. SSL checks the
	NSS_DEFAULT_SSL_LOCK flag before trying to set the cipher suite
	value, and blocks the change if it's set.

	4) sslpolicy tests were updated to test the enable, disable, flags
	=policy-lock, flags=ssl-lock and the new signature primitives.

	5) policy tests were updated to be able to run standalone (like all
	the other all.sh tests), as well as new tests to detect when no
	signing algorithms have been enabled.

	 What is not in the patch

	1) S/MIME signature policy has been defined for a while, but never
	hooked up. 2) S/MIME export policy needs to be connected back to the
	algorithm policy system just like the ssl cipher suites already are.
	3) S/MIME default configuration needs to be connected back to the
	policy system. 4) ECC Curve policy needs to be hooked up with the
	signature policy (probably should create a generic 'key meets
	policy' function and have every call it).

	[6f79a7695812]

	* automation/abi-check/expected-report-libnss3.so.txt,
	gtests/pk11_gtest/pk11_rsaoaep_unittest.cc, lib/nss/nss.def,
	lib/pk11wrap/pk11pub.h, lib/pk11wrap/pk11skey.c:
	Bug 1666891 - Add PK11_Pub{Wrap,Unwrap}SymKeyWithMechanism
	r=mt,rrelyea

	Summary

	This is useful for RSA-OAEP support.

	The CKM_RSA_PKCS_OAEP mechanism requires a CK_RSA_PKCS_OAEP_PARAMS
	be present for PKCS#11 calls. This provides required context for
	OAEP. However, PK11_PubWrapSymKey lacks a way of providing this
	context and historically silently converted CKM_RSA_PKCS_OAEP to
	CKM_RSA_PKCS when a RSA key is provided. Introducing a new call will
	let us indicate parameters and potentially support other mechanisms
	in the future. This call mirrors the earlier calls introduced for
	RSA-PSS: PK11_SignWithMechanism and PK11_VerifyWithMechanism.

	The CKM_RSA_PKCS_OAEP mechanism requires a CK_RSA_PKCS_OAEP_PARAMS
	be present for PKCS#11 calls. This provides required context for
	OAEP. However, PK11_PubUnwrapSymKey lacks a way of providing this
	context, and additionally lacked a way of indicating which mechanism
	type to use for the unwrap operation (instead detecting it by key
	type). Introducing a new call will let us indicate parameters and
	potentially support other mechanisms in the future.

	Signed-off-by: Alexander Scheel <ascheel@redhat.com>

	[33f920fcd175]

2020-10-23  Petr Sumbera  <petr.sumbera@oracle.com>

	* coreconf/config.gypi:
	Bug 1667989 - coreconf/config.gypi should allow correct linking on
	Solaris r=kjacobs,bbeurdouche

	[e3bd9c2f9259]

2020-10-23  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt,
	gtests/pk11_gtest/pk11_find_certs_unittest.cc, lib/nss/nss.def:
	Bug 1668123 - Export CERT_AddCertToListHeadWithData and
	CERT_AddCertToListTailWithData. r=jcj

	[0f15b05daeed]

2020-07-30  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* lib/ckfw/builtins/certdata.txt:
	Bug 1634584 - Set CKA_NSS_SERVER_DISTRUST_AFTER for Trustis FPS Root
	CA. r=kjacobs

	[7076e78ddafe]

2020-10-14  J.C. Jones  <jjones@mozilla.com>

	* lib/util/secasn1d.c:
	Bug 1663091 - Remove unnecessary assertions in the streaming ASN.1
	decoder r=kjacobs

	The streaming ASN.1 decoder had assertions that, on debug builds,
	blocked embedding indefinite-length fields inside of definite-length
	fields/contexts, however that behavior does work correctly, and is
	valid ASN.1: it tends to happen when wrapping a signature around
	existing ASN.1-encoded data, if that already-encoded data had an
	indefinite length.

	Really these two assertion were just overzealous. The conditional
	after the asserts handle the case well, and memory sanitizers have
	not found issue here either.

	[d0153cc0c464]

Differential Revision: https://phabricator.services.mozilla.com/D95093
2020-11-02 18:04:59 +00:00
ffxbld 879482e01a No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D95518
2020-11-02 14:35:29 +00:00
Simon Giesecke 55fc02e6ef Bug 1665462 - Use moving Vector::appendAll overload at a few places, or use move assignment. r=jwalden
Differential Revision: https://phabricator.services.mozilla.com/D90547
2020-10-29 15:04:13 +00:00
Jed Davis 4f544dfb07 Bug 1673770 - Extend the handling of fstatat-as-fstat to sandboxes that don't use a file broker. r=gcp
The fix for bug 1660901, to handle the subset of fstatat that is
equivalent to fstat, was incomplete: it was added to the existing
hook for the file broker, so processes that don't use a broker (like
GMP) didn't get the fix.  That wasn't a problem when the only use of
that feature was in content processes via GTK, but now that glibc has
reimplemented fstat that way, it's necessary for all processes.

Differential Revision: https://phabricator.services.mozilla.com/D95108
2020-10-29 17:41:28 +00:00
ffxbld bc7a07bac7 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D95151
2020-10-29 14:35:28 +00:00
Bob Owen 400cb18bfe Bug 1673194: Remove dynamic code disable for 64-bit RDD process. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D95050
2020-10-29 08:51:39 +00:00
Dragana Damjanovic f4599c1e24 Bug 1669679 - Rebuild cert-info when a resumption token is used for HTTP3 r=keeler,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D93359
2020-10-28 11:15:14 +00:00
Jed Davis 28fdbc26d8 Bug 1673202 - Call fstat directly in Linux sandbox fstatat interception. r=gcp
Sandbox policies handle the case of `fstatat(fd, "", AT_EMPTY_PATH|...)`
by invoking the SIGSYS handler (because seccomp-bpf can't tell if the
string will be empty when the syscall would use it), which makes the
equivalent call to `fstat`.

Unfortunately, recent development versions of glibc implement `fstat` by
calling `fstatat`, which causes unbounded recursion and stack overflow.
(This depends on the headers present at build time; see the bug for more
details.)  This patch switches it to use the `fstat` (or `fstat64` on
32-bit) syscall directly.

Differential Revision: https://phabricator.services.mozilla.com/D94798
2020-10-27 21:05:09 +00:00
Toshihito Kikuchi 83d95e2106 Bug 1671316 - Part1. Introduce CrossExecTransferManager. r=mhowell
This patch introduces a class `CrossExecTransferManager` to manage the data
transfer from the current process to a remote process via `WriteProcessMemory`.
The class also encapsulates a logic to bridge the gap between two executable's
imagebase.

Differential Revision: https://phabricator.services.mozilla.com/D94652
2020-10-27 14:09:00 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
ffxbld 72e61e1719 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D94734
2020-10-26 14:22:36 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Dana Keeler b014438572 Bug 1670984 - include CRLite stash revocation hits/library failures in CRLite telemetry r=jcj
Differential Revision: https://phabricator.services.mozilla.com/D94189
2020-10-23 20:57:48 +00:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dana Keeler 4ae1753875 Bug 1670985 - don't fall back to OCSP when the CRLite mode is "enforce" r=jcj
When the CRLite mode is "enforce" and a certificate is found to be covered by
CRLite, this patch makes it so the implementation will not fall back to
processing OCSP (whether stapled, cached, or fetched). This also updates
test_crlite_filters.js to use a more recent, realistic filter and stash.

Differential Revision: https://phabricator.services.mozilla.com/D94499
2020-10-23 17:04:18 +00:00
Bob Owen a8453ad25d Bug 1668876: Take chromium commit b8479b16bfe703cb09147f4d5cff0cfa3bd91366. r=tkikuchi
Differential Revision: https://phabricator.services.mozilla.com/D94583
2020-10-23 16:01:59 +00:00
Emilio Cobos Álvarez fb68da6916 Bug 1672482 - Move getdents allowance to SandboxPolicyCommon. r=jld,gcp
I think since it takes an FD this might be ok, but let me know if this
somehow doesn't cut it and a more nuanced fix is needed.

Since stuff like PR_GetNumberOfProcessors() uses it with some glibc
versions, which is pretty basic functionality, we probably need to make
it work in all processes.

Differential Revision: https://phabricator.services.mozilla.com/D94358
2020-10-23 09:05:29 +00:00
Valentin Gosu 118fbc2d87 Bug 1671479 - Hold mutex when calling TransportSecurityInfo::Get/SetSucceededCertChain r=keeler,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D93744
2020-10-21 20:04:46 +00:00
Jed Davis cc6e7ab133 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-22 21:23:32 +00:00
ffxbld 56031a2934 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D94446
2020-10-22 14:27:30 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Dorel Luca 5d3bd01bca Backed out 2 changesets (bug 1440203) for Backout conflicts with Bug 1654103. CLOSED TREE
Backed out changeset 6e44c037b2dc (bug 1440203)
Backed out changeset ab11665d8607 (bug 1440203)
2020-10-22 03:47:17 +03:00
Jed Davis 61a83c3467 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

The support code for Android, which doesn't support shm_open and can't
use the memfd backend because of issues with its SELinux policy (see bug
1670277), has been reorganized to reflect that we'll always use its own
API, ashmem, in that case.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-21 23:34:46 +00:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Jean-Yves Avenard c69d4669c4 Bug 1595994 - P13. Enable ffvpx in RDD on linux. r=mattwoodrow,gcp
Depends on D91689

Differential Revision: https://phabricator.services.mozilla.com/D91690
2020-10-20 23:28:00 +00:00
Jean-Yves Avenard a8439d3ed7 Bug 1595994 - P12. Allow ffvpx and the AppleDecoderModule in the RDD. r=haik,jolin
Ultimately, we should be able to remove everything that got added to the RDD sandbox from the content's one.

Fly-by fix; allow checking if AVX512 is supported in content sandbox.

Splitting sandbox setting from Utility to a new RDD one as per review comment in P12 considering it's no longer an IPC only sandbox.

Depends on D91688

Differential Revision: https://phabricator.services.mozilla.com/D91689
2020-10-20 23:27:52 +00:00
Jean-Yves Avenard b47c6221dd Bug 1595994 - PE: Loosen RDD sandbox. r=bobowen
For performant video decoding we need access to DXGI/D3D11 similarly to GPU
process.

Depends on D54883

Differential Revision: https://phabricator.services.mozilla.com/D56856
2020-10-20 23:27:00 +00:00
J.C. Jones f3f86339c2 Bug 1671713 - land NSS 58dc3216d518 UPGRADE_NSS_RELEASE, r=kjacobs
2020-10-13  Mike Hommey  <mh@glandium.org>

	* lib/freebl/freebl.gyp:
	Bug 1670839 - Use ARM crypto extension for AES, SHA1 and SHA2 on
	mac. r=kjacobs

	AFAICT, the Makefile equivalent already does.

	[58dc3216d518] [tip]

	* lib/freebl/sha1-armv8.c:
	Bug 1670839 - Only build sha1-armv8.c code when USE_HW_SHA1 is
	defined. r=kjacobs

	This matches what is done in sha256-armv8.c, and avoids
	inconsistency with sha1-fast.c, which will define the same functions
	in the case USE_HW_SHA1 is not defined.

	[54be084e3ba8]

2020-10-16  J.C. Jones  <jjones@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt, automation/abi-
	check/previous-nss-release, lib/nss/nss.h, lib/softoken/softkver.h,
	lib/util/nssutil.h:
	Set version numbers to 3.59 Beta
	[d4b21706e432]

Differential Revision: https://phabricator.services.mozilla.com/D94070
2020-10-20 14:39:49 +00:00
ffxbld 6612f94b33 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D94009
2020-10-19 14:31:18 +00:00
J.C. Jones cc8fbdccf6 Bug 1666567 - land NSS NSS_3_58_RTM UPGRADE_NSS_RELEASE, r=kjacobs
2020-10-16  J.C. Jones  <jjones@mozilla.com>

	* lib/nss/nss.h, lib/softoken/softkver.h, lib/util/nssutil.h:
	Set version numbers to 3.58 final
	[1f3db03bba02] [NSS_3_58_RTM] <NSS_3_58_BRANCH>

2020-10-12  J.C. Jones  <jjones@mozilla.com>

	* .hgtags:
	Added tag NSS_3_58_BETA1 for changeset 57bbefa79323
	[a8deadf7adbe]

Differential Revision: https://phabricator.services.mozilla.com/D93813
2020-10-16 17:35:33 +00:00
ffxbld db1c8d8a34 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D93667
2020-10-15 16:43:04 +00:00
Dan Minor c7c8e3f274 Bug 1669573 - Rename kTimeFormatSeconds and kTimeFormatNoSeconds; r=zbraniecki
This renames kTimeFormatSeconds to kTimeFormatLong and kTimeFormatNoSeconds to
kTimeFormatShort. This is consistent with the naming used for date format
selectors.

Differential Revision: https://phabricator.services.mozilla.com/D93011
2020-10-15 12:20:15 +00:00
Marco Bonardo 1019bbf009 Bug 1626016 - Remove createFixupURI and move postData inside URIFixupInfo. r=Gijs,geckoview-reviewers,preferences-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D93189
2020-10-13 10:20:16 +00:00
J.C. Jones 8e222a79cb Bug 1666567 - land NSS NSS_3_58_BETA1 UPGRADE_NSS_RELEASE, r=kjacobs
2020-10-12  Daiki Ueno  <dueno@redhat.com>

	* gtests/ssl_gtest/ssl_tls13compat_unittest.cc, lib/ssl/ssl3con.c,
	lib/ssl/sslimpl.h:
	Bug 1641480, TLS 1.3: tighten CCS handling in compatibility mode,
	r=mt

	This makes the server reject CCS when the client doesn't indicate
	the use of the middlebox compatibility mode with a non-empty
	ClientHello.legacy_session_id, or it sends multiple CCS in a row.

	[57bbefa79323] [NSS_3_58_BETA1]

2020-10-12  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt,
	automation/taskcluster/scripts/build_gyp.sh,
	automation/taskcluster/windows/build_gyp.sh, coreconf/config.gypi,
	coreconf/config.mk, cpputil/nss_scoped_ptrs.h,
	gtests/common/testvectors/hpke-vectors.h,
	gtests/pk11_gtest/manifest.mn, gtests/pk11_gtest/pk11_gtest.gyp,
	gtests/pk11_gtest/pk11_hpke_unittest.cc, lib/nss/nss.def,
	lib/pk11wrap/exports.gyp, lib/pk11wrap/manifest.mn,
	lib/pk11wrap/pk11hpke.c, lib/pk11wrap/pk11hpke.h,
	lib/pk11wrap/pk11pub.h, lib/pk11wrap/pk11wrap.gyp,
	lib/util/SECerrs.h, lib/util/secerr.h:
	Bug 1631890 - Add support for Hybrid Public Key Encryption (draft-
	irtf-cfrg-hpke-05). r=mt

	This patch adds support for Hybrid Public Key Encryption (draft-
	irtf-cfrg-hpke-05).

	Because the draft number (and the eventual RFC number) is an input
	to the key schedule, future updates will *not* be backwards
	compatible in terms of key material or encryption/decryption. For
	this reason, a default compilation will produce stubs that simply
	return an "Invalid Algorithm" error. To opt into using the HPKE
	functionality , compile with `NSS_ENABLE_DRAFT_HPKE` defined. Once
	finalized, this flag will not be required to access the functions.

	Lastly, the `DeriveKeyPair` API is not implemented as it adds
	complextiy around PKCS #11 and is unnecessary for ECH.

	[6e3bc17f0508]

2020-10-12  Makoto Kato  <m_kato@ga2.so-net.ne.jp>

	* automation/taskcluster/graph/src/extend.js, tests/common/cleanup.sh:
	Bug 1657255 - Update CI for aarch64. r=kjacobs

	Actually, we have the implementation of ARM Crypto extension, so CI
	is always run with this extension. It means that we don't run CI
	without ARM Crypto extension. So I would like to add NoAES and NoSHA
	for aarch64 CI.

	Also, we still run NoSSE4_1 on aarch64 CI, so we shouldn't run this
	on aarch64 hardware.

	[e8c370a8db13]

Differential Revision: https://phabricator.services.mozilla.com/D93268
2020-10-12 20:42:51 +00:00
ffxbld 4c9d801663 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D93223
2020-10-12 14:35:15 +00:00
Razvan Maries 5fa72e54df Backed out 2 changesets (bug 1440203) for causing bug 1670277. CLOSED TREE
Backed out changeset 0b10bf76fe35 (bug 1440203)
Backed out changeset 468878422866 (bug 1440203)
2020-10-10 03:39:33 +03:00
ffxbld 60a6414375 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D92940
2020-10-08 14:54:02 +00:00
Jed Davis 3680ce4b19 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-08 02:25:20 +00:00
Jed Davis 567fc3fb12 Bug 1664922 - Allow CPU information in the "utility" sandbox policy, for nsSystemInfo. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D90603
2020-10-07 17:31:37 +00:00
Kershaw Chang beca4c9d74 Bug 1652713 - Implement fallback mechanism when echConfig is enabled, r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D90673
2020-10-06 20:06:55 +00:00
Razvan Maries 75a5750a87 Backed out 5 changesets (bug 1662564, bug 1664922, bug 1440203) for Valgrind bustages. CLOSED TREE
Backed out changeset 9366b15ee97c (bug 1440203)
Backed out changeset bb512f5fdeda (bug 1440203)
Backed out changeset be90d6aec690 (bug 1664922)
Backed out changeset f6527a1d0f14 (bug 1662564)
Backed out changeset 3a2941fa7d4b (bug 1662564)
2020-10-07 08:38:13 +03:00
Dana Keeler 94aa501946 Bug 1669367 - avoid needing a CERTCertificate in nsNSSCertificate::GetSha256SubjectPublicKeyInfoDigest r=rmf
This patch reimplements nsNSSCertificate::GetSha256SubjectPublicKeyInfoDigest
to use mozilla::pkix instead of relying on having a CERTCertificate with the
subject public key info parsed out already.

Differential Revision: https://phabricator.services.mozilla.com/D92517
2020-10-07 00:17:40 +00:00
Dana Keeler e0531b8283 Bug 1667829 - CRLite: allow taking the log merge delay into account r=jcj
This patch adds the preference "security.pki.crlite_ct_merge_delay_seconds"
that adds a configurable delay between the earliest certificate timestamp and
the filter creation date. This allows the implementation to take into account
CT log merge delays (i.e. when an SCT exists for a certificate but that
certificate hasn't yet been merged into the log).
The default value is 28 hours in seconds. The minimum value is 0 seconds, and
the maximum value is one year in seconds.

Differential Revision: https://phabricator.services.mozilla.com/D92295
2020-10-07 00:16:49 +00:00
Jed Davis c4968e6653 Bug 1440203 - Support memfd_create in IPC shared memory. r=glandium
This commit also allows `memfd_create` in the seccomp-bpf policy for all
process types.

`memfd_create` is an API added in Linux 3.17 (and adopted by FreeBSD
for the upcoming version 13) for creating anonymous shared memory
not connected to any filesystem.  Supporting it means that sandboxed
child processes on Linux can create shared memory directly instead of
messaging a broker, which is unavoidably slower, and it should avoid
the problems we'd been seeing with overly small `/dev/shm` in container
environments (which were causing serious problems for using Firefox for
automated testing of frontend projects).

`memfd_create` also introduces the related operation of file seals:
irrevocably preventing types of modifications to a file.  Unfortunately,
the most useful one, `F_SEAL_WRITE`, can't be relied on; see the large
comment in `SharedMemory:ReadOnlyCopy` for details.  So we still use
the applicable seals as defense in depth, but read-only copies are
implemented on Linux by using procfs (and see the comments on the
`ReadOnlyCopy` function in `shared_memory_posix.cc` for the subtleties
there).

There's also a FreeBSD implementation, using `cap_rights_limit` for
read-only copies, if the build host is new enough to have the
`memfd_create` function.

Differential Revision: https://phabricator.services.mozilla.com/D90605
2020-10-06 19:20:29 +00:00
Jed Davis 5d2c793134 Bug 1664922 - Allow CPU information in the "utility" sandbox policy, for nsSystemInfo. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D90603
2020-10-06 20:21:32 +00:00
Dorel Luca 5c6d2146ce Backed out 5 changesets (bug 1652717, bug 1665878, bug 1666620, bug 1652713) for XPCshell failures in components/migration/tests/unit/xpcshell.ini. CLOSED TREE
Backed out changeset 6322b86e1df4 (bug 1666620)
Backed out changeset ab09fd84e0e4 (bug 1652717)
Backed out changeset 018c0eebe944 (bug 1652717)
Backed out changeset 1636234a4768 (bug 1665878)
Backed out changeset 395117cd7b25 (bug 1652713)
2020-10-06 22:39:34 +03:00
Kershaw Chang 99208e5b56 Bug 1652713 - Implement fallback mechanism when echConfig is enabled, r=dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D90673
2020-10-06 09:47:52 +00:00
ffxbld 4acd881913 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D92502
2020-10-06 10:21:24 +00:00
J.C. Jones 0a5ff268ea Bug 1666567 - land NSS c7d3b214dd41 UPGRADE_NSS_RELEASE, r=kjacobs
2020-10-05  Ricky Stewart  <rstewart@mozilla.com>

	* coreconf/config.gypi:
	Bug 1668328 - Enclose Python paths in `coreconf/config.gypi` in
	quotes r=kjacobs,mt

	This fixes a breakage if the Python path happens to have a space in
	it.

	[c7d3b214dd41] [tip]

Differential Revision: https://phabricator.services.mozilla.com/D92516
2020-10-06 01:25:28 +00:00
julianwels 341416588c Bug 1653026 - Added HTTPS-Only Mode upgrade info to browser UI state. r=mattwoodrow,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D86566
2020-10-06 00:34:55 +00:00
Dana Keeler 43f5c1c324 Bug 1666878 - osclientcerts: include the current thread id in logging in lib.rs r=kjacobs
A large portion of osclientcerts runs on a single thread, but the C API in
lib.rs doesn't. Thus, log lines from different threads can be interlaced,
causing confusion. This patch includes the current thread in those logs so they
can be de-interlaced.

Differential Revision: https://phabricator.services.mozilla.com/D92155
2020-10-05 20:37:08 +00:00
Kershaw Chang 71089ed718 Bug 1652677 - P2: Implement necko part of echconfig r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D89455
2020-10-05 15:16:46 +00:00
Brindusan Cristian 2a9b39efce Backed out 2 changesets (bug 1653026) for mochitest failures at WindowGlobalParent.cpp. CLOSED TREE
Backed out changeset 54c69c99b241 (bug 1653026)
Backed out changeset e70649f78910 (bug 1653026)
2020-10-03 10:49:04 +03:00
julianwels 30a6225652 Bug 1653026 - Added HTTPS-Only Mode upgrade info to browser UI state. r=mattwoodrow,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D86566
2020-10-03 01:22:19 +00:00
Bert Peers 5444eeeaf6 Bug 1668145 - Detect all Mac GPUs. r=jrmuizel,haik
This also adds a diagonstic assert to make sure the code works in all process types.
And it adds another item to the sandbox IOKit property name allowlist, so that
the detection works in content processes.

This landed before, in bug 1649490, but without the sandbox adjustment (so it
didn't work in content processes).

Differential Revision: https://phabricator.services.mozilla.com/D91950
2020-10-02 01:10:20 +00:00
ffxbld 98819106f1 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D92065
2020-10-01 14:37:46 +00:00
Sebastian Hengst a34f36ddbd Backed out 2 changesets (bug 1652677) on request from kershaw for causing bug 1667801
Backed out changeset 4a66e4016c18 (bug 1652677)
Backed out changeset df6bdf8157b1 (bug 1652677)
2020-09-30 13:14:00 +02:00
J.C. Jones 3ad29aac6b Bug 1666567 - land NSS 8fdbec414ce2 UPGRADE_NSS_RELEASE, r=kjacobs
2020-09-24  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt,
	gtests/pk11_gtest/pk11_hkdf_unittest.cc, lib/nss/nss.def,
	lib/pk11wrap/pk11pub.h, lib/pk11wrap/pk11skey.c,
	lib/ssl/tls13hkdf.c:
	Bug 1667153 - Add PK11_ImportDataKey API. r=rrelyea

	This patch adds and exports `PK11_ImportDataKey`, and refactors the
	null PSK TLS 1.3 code to use it.

	[8fdbec414ce2] [tip]

Differential Revision: https://phabricator.services.mozilla.com/D91627
2020-09-28 19:24:51 +00:00
ffxbld 49e215ac76 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D91597
2020-09-28 15:02:00 +00:00
Kershaw Chang 93e628b4ae Bug 1652677 - P2: Implement necko part of echconfig r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D89455
2020-09-25 07:35:04 +00:00
Razvan Maries e761feff33 Backed out 2 changesets (bug 1652677) for build bustages on nsHttpConnection.cpp. CLOSED TREE
Backed out changeset 7df7bfbfbc6e (bug 1652677)
Backed out changeset 435ff20fa8c6 (bug 1652677)
2020-09-24 22:01:09 +03:00
Dana Keeler 3d9ab91ab0 Bug 1605273 - only run CRLite on certificates with a CT SCT available r=jcj
Because CAs can back-date a certificate (i.e. set the "notBefore" field to
earlier than when a certificate actually existed), the "notBefore" field can't
be relied on when determining when CRLite information is recent enough to check
a certificate with. To that end, this patch instead uses the earliest timestamp
from the embedded SCTs in the certificate being checked.

Differential Revision: https://phabricator.services.mozilla.com/D90599
2020-09-24 18:10:05 +00:00
J.C. Jones 55cfe61a1d Bug 1666567 - land NSS 8ebee3cec9cf UPGRADE_NSS_RELEASE, r=kjacobs
2020-09-23  Dana Keeler  <dkeeler@mozilla.com>

	* gtests/mozpkix_gtest/pkixbuild_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_extension_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckExtendedKeyUsage_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixgtest.h,
	lib/mozpkix/include/pkix/pkixtypes.h, lib/mozpkix/lib/pkixbuild.cpp:
	Bug 1665715 - (2/2) pass encoded signed certificate timestamp
	extension (if present) in CheckRevocation r=jcj

	This will allow Firefox to make decisions based on the earliest
	known time that a certificate exists (with respect to certificate
	transparency) that a CA is unlikely to back-date. In particular,
	this is essential for CRLite. Note that if the SCT signature isn't
	validated, a CA could still make a certificate appear to have
	existed for longer than it really has. However, this change is not
	an attempt to catch malicious CAs. The aim is to avoid false
	positives in CRLite resulting from CAs backdating the notBefore
	field on certificates they issue.

	Depends on D90595

	[8ebee3cec9cf] [tip]

2020-09-18  Dana Keeler  <dkeeler@mozilla.com>

	* gtests/mozpkix_gtest/pkixbuild_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_extension_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckExtendedKeyUsage_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixgtest.h,
	lib/mozpkix/include/pkix/pkixtypes.h, lib/mozpkix/lib/pkixbuild.cpp:
	Bug 1665715 - (1/2) revert e8f2720c8254 (bug 1593141) because it's
	no longer necessary r=jcj

	Bug 1593141 added the certificate's notBefore field as an argument
	to TrustDomain::CheckRevocation so that Firefox could use it with
	CRLite. However, since CAs can backdate that field, we need to use
	the earliest embedded SCT timestamp instead.

	[c1f4d565ceda]

Differential Revision: https://phabricator.services.mozilla.com/D91211
2020-09-24 04:00:44 +00:00
Kershaw Chang d12fbcdc43 Bug 1652677 - P2: Implement necko part of echconfig r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D89455
2020-09-24 16:20:04 +00:00
ffxbld 0b15308f5d No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D91282
2020-09-24 14:23:18 +00:00
Bogdan Tara db9c89dbca Backed out 2 changesets (bug 1666567, bug 1605273) for test_crlite_filters.js failures CLOSED TREE
UPGRADE_NSS_RELEASE

Backed out changeset 9bc4c7e79cd6 (bug 1666567)
Backed out changeset 22753d184de6 (bug 1605273)
2020-09-24 06:57:27 +03:00
J.C. Jones e8346094ad Bug 1666567 - land NSS 8ebee3cec9cf UPGRADE_NSS_RELEASE, r=kjacobs
CLOSED TREE

2020-09-23  Dana Keeler  <dkeeler@mozilla.com>

	* gtests/mozpkix_gtest/pkixbuild_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_extension_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckExtendedKeyUsage_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixgtest.h,
	lib/mozpkix/include/pkix/pkixtypes.h, lib/mozpkix/lib/pkixbuild.cpp:
	Bug 1665715 - (2/2) pass encoded signed certificate timestamp
	extension (if present) in CheckRevocation r=jcj

	This will allow Firefox to make decisions based on the earliest
	known time that a certificate exists (with respect to certificate
	transparency) that a CA is unlikely to back-date. In particular,
	this is essential for CRLite. Note that if the SCT signature isn't
	validated, a CA could still make a certificate appear to have
	existed for longer than it really has. However, this change is not
	an attempt to catch malicious CAs. The aim is to avoid false
	positives in CRLite resulting from CAs backdating the notBefore
	field on certificates they issue.

	Depends on D90595

	[8ebee3cec9cf] [tip]

2020-09-18  Dana Keeler  <dkeeler@mozilla.com>

	* gtests/mozpkix_gtest/pkixbuild_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_extension_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckExtendedKeyUsage_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixgtest.h,
	lib/mozpkix/include/pkix/pkixtypes.h, lib/mozpkix/lib/pkixbuild.cpp:
	Bug 1665715 - (1/2) revert e8f2720c8254 (bug 1593141) because it's
	no longer necessary r=jcj

	Bug 1593141 added the certificate's notBefore field as an argument
	to TrustDomain::CheckRevocation so that Firefox could use it with
	CRLite. However, since CAs can backdate that field, we need to use
	the earliest embedded SCT timestamp instead.

	[c1f4d565ceda]

Differential Revision: https://phabricator.services.mozilla.com/D91211
2020-09-23 23:28:18 +00:00
Dana Keeler 500beadbba Bug 1605273 - only run CRLite on certificates with a CT SCT available r=jcj
Because CAs can back-date a certificate (i.e. set the "notBefore" field to
earlier than when a certificate actually existed), the "notBefore" field can't
be relied on when determining when CRLite information is recent enough to check
a certificate with. To that end, this patch instead uses the earliest timestamp
from the embedded SCTs in the certificate being checked.

Differential Revision: https://phabricator.services.mozilla.com/D90599
2020-09-23 22:24:39 +00:00
Bogdan Tara 24d9b1dbae Backed out changeset 7e50f86ea20b (bug 1666567) for security related bustage CLOSED TREE
UPGRADE_NSS_RELEASE
2020-09-24 03:57:00 +03:00
J.C. Jones 413b79889f Bug 1666567 - land NSS 8ebee3cec9cf UPGRADE_NSS_RELEASE, r=kjacobs
2020-09-23  Dana Keeler  <dkeeler@mozilla.com>

	* gtests/mozpkix_gtest/pkixbuild_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_extension_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckExtendedKeyUsage_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixgtest.h,
	lib/mozpkix/include/pkix/pkixtypes.h, lib/mozpkix/lib/pkixbuild.cpp:
	Bug 1665715 - (2/2) pass encoded signed certificate timestamp
	extension (if present) in CheckRevocation r=jcj

	This will allow Firefox to make decisions based on the earliest
	known time that a certificate exists (with respect to certificate
	transparency) that a CA is unlikely to back-date. In particular,
	this is essential for CRLite. Note that if the SCT signature isn't
	validated, a CA could still make a certificate appear to have
	existed for longer than it really has. However, this change is not
	an attempt to catch malicious CAs. The aim is to avoid false
	positives in CRLite resulting from CAs backdating the notBefore
	field on certificates they issue.

	Depends on D90595

	[8ebee3cec9cf] [tip]

2020-09-18  Dana Keeler  <dkeeler@mozilla.com>

	* gtests/mozpkix_gtest/pkixbuild_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_extension_tests.cpp,
	gtests/mozpkix_gtest/pkixcert_signature_algorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckExtendedKeyUsage_tests.cpp,
	gtests/mozpkix_gtest/pkixcheck_CheckSignatureAlgorithm_tests.cpp,
	gtests/mozpkix_gtest/pkixgtest.h,
	lib/mozpkix/include/pkix/pkixtypes.h, lib/mozpkix/lib/pkixbuild.cpp:
	Bug 1665715 - (1/2) revert e8f2720c8254 (bug 1593141) because it's
	no longer necessary r=jcj

	Bug 1593141 added the certificate's notBefore field as an argument
	to TrustDomain::CheckRevocation so that Firefox could use it with
	CRLite. However, since CAs can backdate that field, we need to use
	the earliest embedded SCT timestamp instead.

	[c1f4d565ceda]

Differential Revision: https://phabricator.services.mozilla.com/D91211
2020-09-23 23:28:18 +00:00
Jed Davis cd985e90bd Bug 1663550 - Fix the alignment of the stack for the sandbox's clone() trampoline. r=gcp
The ABI on ARM64 requires 16-byte stack alignment, and that includes the
small temporary stack that exists only so that we can `longjmp` off of
it in the child process after calling `clone`.

Differential Revision: https://phabricator.services.mozilla.com/D90001
2020-09-16 20:48:02 +00:00
Jed Davis e997e40530 Bug 1663550 - Update sandbox policy for various syscalls obsoleted on Linux/arm64. r=gcp
In addition to e.g. lacking `open` in favor of `openat`, Linux/arm64
also removes a number of older syscalls along similar lines, like `dup2`
in favor of `dup3`, and all variants of `select` other than `pselect6`.

Differential Revision: https://phabricator.services.mozilla.com/D90000
2020-09-16 20:23:22 +00:00
Jed Davis e149e83eea Bug 1663550 - Implement brokering for the remaining `at` syscalls in the Linux sandbox. r=gcp
Linux/arm64 omits syscalls that can be implemented in terms of newer
syscalls by inserting constant arguments; this means that all of the
basic filesystem operations use the `at` versions, like `unlinkat`
replacing both `unlink` and `rmdir`.  We've supported some of them when
x86 libcs started using them, but there are several others we were
missing; this patch adds them.

Differential Revision: https://phabricator.services.mozilla.com/D89999
2020-09-16 20:12:20 +00:00
Jed Davis 54eee381cc Bug 1663550 - Rearrange the broker glue to handle none of the non-`at` syscalls existing. r=gcp
Linux/arm64 seems to exclude any syscalls that were redundant when it was
created (specifically, that can be implemented in terms of another by
inserting constant arguments), which includes all the of the non-`at`
filesystem syscalls --- for example, `open` vs. `openat`.

This patch rearranges ifdefs to handle that case; later patches will
fill in the currently unhandled syscalls in the `at`-only side.

Differential Revision: https://phabricator.services.mozilla.com/D89998
2020-09-16 19:45:52 +00:00
Jed Davis 1cabbae048 Bug 1663550 - Minor cleanups for Linux sandbox policy. r=gcp
Not strictly part of ARM support, but worth committing, and in
particular printing the `AT_*` flags in hex is helpful for matching them
against headers when `*at` syscalls fail.

Differential Revision: https://phabricator.services.mozilla.com/D89997
2020-09-16 19:01:32 +00:00
Jed Davis 9afac8dfc8 Bug 1663550 - Remove obsolete sandbox rule allowing utime(). r=gcp
We no longer use GConf (bug 1433685), so we can remove the sandbox rule
allowing it to call utime().  That syscall doesn't exist on ARM or ARM64,
so this rule would have to be ifdef'ed if it were re-added.

Differential Revision: https://phabricator.services.mozilla.com/D89996
2020-09-16 18:53:23 +00:00
Jed Davis 4ec3f298b0 Bug 1663550 - Add "arm" and "arm64" architecture names to Linux sandbox telemetry. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D89995
2020-09-16 18:52:52 +00:00
Jed Davis 8ea790a391 Bug 1663550 - Add security/sandbox/chromium files needed for ARM/ARM64. r=bobowen
Chromium's Linux sandboxing code needs some architecture-specific files
for ARM and ARM64 that we don't currently include in our partial import.
These are copied from Chromium tag 81.0.4044.138 (matching the latest
import of the rest of security/sandbox/chromium) without changes.

Differential Revision: https://phabricator.services.mozilla.com/D89994
2020-09-15 14:46:35 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Andrea Marchesini 03a46b29e8 Bug 1635828 - Isolate HSTS per first-party when privacy.partition.network_state is set to true - part 2 - tests, r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D74078
2020-09-20 20:51:11 +00:00
Dana Keeler 3d53187b90 Bug 1662636 - osclientcerts: rework legacy key handling to avoid slow APIs r=kjacobs
Bug 1658042 attempted to identify keys that could only handle legacy crypto
using CryptFindCertificateKeyProvInfo. However, it appears that this API can
be incredibly slow and potentially involve network I/O. This patch reworks
the legacy crypto handling by using CryptAcquireCertificatePrivateKey with the
CRYPT_ACQUIRE_SILENT_FLAG flag to avoid showing UI at inopportune times.

Differential Revision: https://phabricator.services.mozilla.com/D90733
2020-09-22 23:51:09 +00:00
J.C. Jones f2b2199636 Bug 1666567 - land NSS c28e20f61e5d UPGRADE_NSS_RELEASE, r=kjacobs
2020-09-18  Kevin Jacobs  <kjacobs@mozilla.com>

        * automation/abi-check/previous-nss-release, lib/nss/nss.h,
        lib/softoken/softkver.h, lib/util/nssutil.h:
        Set version numbers to 3.58 Beta
        [c28e20f61e5d] [tip]

        * .hgtags:
        Added tag NSS_3_57_RTM for changeset cf7e3e8abd77
        [a963849538ca] <NSS_3_57_BRANCH>

        * lib/nss/nss.h, lib/softoken/softkver.h, lib/util/nssutil.h:
        Set version numbers to 3.57 final
        [cf7e3e8abd77] [NSS_3_57_RTM] <NSS_3_57_BRANCH>

Differential Revision: https://phabricator.services.mozilla.com/D91070
2020-09-22 22:31:15 +00:00
ffxbld 40f2c8cc60 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D90947
2020-09-22 02:55:14 +00:00
Narcis Beleuzu 4a31045523 Backed out 4 changesets (bug 1635828) for causing Bug 1666083
Backed out changeset 1f93614c3fde (bug 1635828)
Backed out changeset 04a8f6581dde (bug 1635828)
Backed out changeset 1bfeca8427e6 (bug 1635828)
Backed out changeset 8ec4db600c1f (bug 1635828)
2020-09-20 20:00:45 +03:00
Kevin Jacobs 14f9e3ce78 Bug 1660509 - land NSS NSS_3_57_RTM UPGRADE_NSS_RELEASE, r=jcj
2020-09-18  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/nss/nss.h, lib/softoken/softkver.h, lib/util/nssutil.h:
	Set version numbers to 3.57 final
	[cf7e3e8abd77] [NSS_3_57_RTM] <NSS_3_57_BRANCH>

2020-09-15  Kevin Jacobs  <kjacobs@mozilla.com>

	* .hgtags:
	Added tag NSS_3_57_BETA1 for changeset 56224882ccc3
	[f46f20c58c4f]

Differential Revision: https://phabricator.services.mozilla.com/D90726
2020-09-18 19:53:28 +00:00
Andrea Marchesini 0a3eef2b82 Bug 1635828 - Isolate HSTS per first-party when privacy.partition.network_state is set to true - part 2 - tests, r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D74078
2020-08-04 10:39:37 +00:00
Moritz Birghan 0c15bc6ad6 Bug 1664808 - Waiting for l10n strings to load r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D90578
2020-09-17 20:55:18 +00:00
ffxbld 3768ca343e No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D90609
2020-09-17 20:20:07 +00:00
Chris Peterson cf7da1e809 Bug 1665270 - Replace MOZ_MUST_USE with [[nodiscard]] in PSM security manager. r=keeler
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

We can also stop #including mozilla/Attributes.h because it was only needed for its MOZ_MUST_USE declaration.

Differential Revision: https://phabricator.services.mozilla.com/D90350
2020-09-16 23:25:38 +00:00
Kevin Jacobs ed0deeb271 Bug 1660509 - land NSS NSS_3_57_BETA1 UPGRADE_NSS_RELEASE, r=jcj
2020-09-15  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/release/nspr-version.txt:
	Bug 1660372 - NSS 3.57 should depend on NSPR 4.29. r=kaie

	[56224882ccc3] [NSS_3_57_BETA1]

Differential Revision: https://phabricator.services.mozilla.com/D90324
2020-09-17 05:29:26 +00:00
Toshihito Kikuchi d77b5bdf35 Bug 1662560 - Always retrieve the imagebase of the child process's executable from a process handle. r=mhowell
The earlier fix ea452bb92e6a proved the executable's imagebase in a child
process is not always the same as the local imagebase.  This patch applies
the new approach to retieve the imagebase from a handle to all channels.

Interestingly, we observed the launcher failures at `VirtualProtectEx` only
when launching a sandboxed process, not when launching the browser process.
In the long term, we may need to take care of all `WriteProcessMemory` calls
for a child process for greater safety, but given that observation, this
patch only updates `RestoreImportDirectory` and `InitializeDllBlocklistOOP`.

Differential Revision: https://phabricator.services.mozilla.com/D90316
2020-09-15 21:10:06 +00:00
Alexis Beingessner e5dd298d13 Bug 1654807 - update thin-vec to 0.2.1 for potential endianess fix. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87019
2020-09-14 17:32:40 +00:00
Kevin Jacobs 25560bb43a Bug 1660509 - land NSS 2a17c8655a74 UPGRADE_NSS_RELEASE, r=jcj
2020-09-14  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* coreconf/arch.mk:
	Bug 1660735 - Fix typo in coreconfig/arch.mk. r=kjacobs

	[2a17c8655a74] [tip]

	* coreconf/config.mk:
	Bug 1660734 - Fix typo in coreconf/config.mk. r=kjacobs

	[4ae56ec2411b]

2020-09-11  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/ckfw/builtins/nssckbi.h:
	Bug 1663049 - September 2020 batch of root changes,
	NSS_BUILTINS_LIBRARY_VERSION 2.44. r=jcj

	[141ef83ac10b]

	* lib/ckfw/builtins/certdata.txt:
	Bug 1663049 - Add SecureTrust's Trustwave Global root certificates
	to NSS. r=KathleenWilson,jcj

	[7dfc054a983e]

	* lib/ckfw/builtins/certdata.txt:
	Bug 1656077 - Remove Taiwan Government Root Certification Authority
	root cert. r=KathleenWilson,jcj

	Depends on D89841

	[32a0d8f751ef]

	* lib/ckfw/builtins/certdata.txt:
	Bug 1653092 - Disable server trust bit for OISTE WISeKey Global Root
	GA CA root cert. r=KathleenWilson,jcj

	Depends on D89840

	[1cdfb26b3220]

	* lib/ckfw/builtins/certdata.txt:
	Bug 1651211 - Remove EE Certification Centre Root CA root cert.
	r=KathleenWilson,jcj

	[089aeca370df]

2020-09-11  Danh  <congdanhqx@gmail.com>

	* coreconf/arch.mk, coreconf/config.mk, lib/freebl/Makefile:
	Bug 1659727 - Move makefile avx2 detection to config.mk. r=kjacobs

	Summary: Current code base use CPU_ARCH to detect if avx2 is
	supported in arch.mk However, when arch.mk included, CPU_ARCH
	haven't been initialised, CPU_ARCH will be initialised by the OS
	specific code later on.

	Move the AVX2 detection to config.mk, after all other initialisation
	done.

	Reviewers: kjacobs

	Reviewed By: kjacobs

	Subscribers: kjacobs

	Bug #: 1659727

	[c6dcb99e6121]

2020-09-08  Kevin Jacobs  <kjacobs@mozilla.com>

	* gtests/freebl_gtest/mpi_unittest.cc, lib/freebl/mpi/mpi.c:
	Bug 1605922 - Account for negative sign in mp_radix_size
	r=bbeurdouche

	[b64436ecbd79]

2020-09-09  Daiki Ueno  <dueno@redhat.com>

	* lib/freebl/Makefile:
	Bug 1659256, add gcc version check on AArch64 optimization,
	r=rrelyea

	Summary: As described in https://access.redhat.com/solutions/19458,
	gcc version in RHEL-7 is still 4.8.x and cannot compile the newly
	added aes-armv8.c. There is a version check already for 32-bit arm,
	but not for AArch64. This also removes NS_USE_GCC check added in bug
	1652032 in favor of the automatic detection using CC_IS_* macros.

	Reviewers: rrelyea

	Reviewed By: rrelyea

	Subscribers: jmux, kjacobs

	Bug #: 1659256

	[b971c77c0d68]

2020-09-08  Michael Shigorin  <mike@altlinux.org>

	* coreconf/config.gypi:
	Bug 1663346 - Build e2k architecture as 64-bit r=jcj
	[e524a577761d]

2020-09-05  Daiki Ueno  <dueno@redhat.com>

	* lib/freebl/fipsfreebl.c:
	Bug 1662738, run RNG self-tests only if NSPR is linked, r=rrelyea

	Summary: After the continuous DRBG test was added, RNG self-tests
	have no longer worked standalone. This moves the self-tests to the
	DO_REST block so it only runs when the program is also linked to
	NSPR.

	Reviewers: rrelyea

	Reviewed By: rrelyea

	Bug #: 1662738

	[e03296e73ba6]

2020-09-02  Khem Raj  <raj.khem@gmail.com>

	* lib/libpkix/pkix/util/pkix_logger.c:
	Bug 1661378 - pkix: Do not use NULL where 0 is needed Clang finds
	this error

	pkix_logger.c:316:32: error: cast to smaller integer type
	'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-pointer-to-enum-
	cast] logger->logComponent = (PKIX_ERRORCLASS)NULL;
	^~~~~~~~~~~~~~~~~~~~~ pkix_logger.c:617:32: error: cast to smaller
	integer type 'PKIX_ERRORCLASS' from 'void *' [-Werror,-Wvoid-
	pointer-to-enum-cast] logger->logComponent = (PKIX_ERRORCLASS)NULL;
	^~~~~~~~~~~~~~~~~~~~~ 2 errors generated.

	Signed-off-by: Khem Raj <raj.khem@gmail.com>
	[9213848965f6]

Differential Revision: https://phabricator.services.mozilla.com/D90130
2020-09-14 17:06:12 +00:00
ffxbld 651ca4559b No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D90123
2020-09-14 15:48:22 +00:00
Moritz Birghan 628ee042f6 Bug 1659810 - Refactoring the cert manager server tab to use a richlist r=keeler,fluent-reviewers,preferences-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D87498
2020-09-14 10:06:31 +00:00
Dana Keeler 5763aba6d5 Bug 1664011 - avoid CERTCertificate in nsIX509CertValidity implementation r=rmf
This patch modifies the implementation of nsIX509CertValidity to use
mozilla::pkix to decode notBefore/notAfter values from the given encoded
certificate rather than using a CERTCertificate. This will help in avoiding
CERTCertificate in the implementation of nsIX509Cert.
This patch also renames/moves the previous implementation (which was in
nsNSSCertValidity.{h,cpp} but was called nsX509CertValidity) to be more
consistent and to drop the unnecessary "ns" prefix. It is now in the files
X509CertValidity.{h,cpp} and is called X509CertValidity.

Differential Revision: https://phabricator.services.mozilla.com/D89644
2020-09-11 17:20:25 +00:00
Chris Peterson 55b64360f6 Bug 1662961 - Replace MOZ_MUST_USE with [[nodiscard]] in security/sandbox/linux. r=jld
The MOZ_MUST_USE macro is defined as clang's and gcc's nonstandard __attribute__((warn_unused_result)). Now that we compile as C++17 by default (bug 1560664), we can replace MOZ_MUST_USE with C++17's standard [[nodiscard]] attribute.

The [[nodiscard]] attribute must precede a function declaration's declaration specifiers (like static, extern, inline, or virtual). The __attribute__((warn_unused_result)) attribute does not have this order restriction.

Differential Revision: https://phabricator.services.mozilla.com/D89235
2020-09-09 17:02:45 +00:00
Dana Keeler 5c87e14fbc Bug 1660580 - avoid CERTCertificate in AppTrustDomain and AppSignatureVerification r=kjacobs,bbeurdouche
Limitations in the NSS PKCS7 API prevent completely avoiding CERTCertificate in
this implementation, but these changes avoid a large number of unnecessary
certificate decoding operations.

Differential Revision: https://phabricator.services.mozilla.com/D87930
2020-09-09 22:45:42 +00:00
ffxbld c9023a3ab0 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D89378
2020-09-07 14:23:46 +00:00
Julien Cristau ae8cb5feaf Bug 1660901 - ignore AT_NO_AUTOMOUNT in fstatat system call. r=jld
Per the manpage "Both stat() and lstat() act as though AT_NO_AUTOMOUNT
was set.", so don't bail if it's set in a call to fstatat.

Differential Revision: https://phabricator.services.mozilla.com/D89121
2020-09-06 20:20:39 +00:00
ffxbld 7e7f470965 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D89266
2020-09-03 22:45:48 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Jed Davis 7bf48bbf12 Bug 1660901 - Add some test cases for fstatat inside the content sandbox. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D88500
2020-08-28 09:33:53 +00:00
Jed Davis 08c45b9f68 Bug 1660901 - Support the fstat-like subset of fstatat in the Linux sandbox policies. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D88499
2020-08-28 09:23:58 +00:00
Kevin Jacobs ddc8978d1f Bug 1660509 - land NSS c100e11991f6 UPGRADE_NSS_RELEASE, r=jcj
2020-08-21  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/previous-nss-release, lib/nss/nss.h,
	lib/softoken/softkver.h, lib/util/nssutil.h:
	Set version numbers to 3.57 Beta
	[783f49ae6126]

2020-08-24  Kevin Jacobs  <kjacobs@mozilla.com>

	* gtests/ssl_gtest/ssl_auth_unittest.cc, lib/ssl/dtls13con.c,
	lib/ssl/dtlscon.c, lib/ssl/ssl3con.c, lib/ssl/sslimpl.h,
	lib/ssl/sslnonce.c:
	Bug 1653641 - Cleanup inaccurate DTLS comments, code review fixes.
	r=mt

	[0e1b5c711cb9]

2020-08-24  Robert Relyea  <rrelyea@redhat.com>

	* lib/freebl/fipsfreebl.c, lib/softoken/fipstest.c,
	lib/softoken/kbkdf.c, lib/softoken/lowpbe.c, lib/softoken/lowpbe.h,
	lib/softoken/pkcs11c.c, lib/softoken/pkcs11i.h,
	lib/softoken/sftkhmac.c, lib/softoken/sftkike.c:
	Bug 1660304 New FIPS IG requires self-tests for approved kdfs.
	r=ueno comments=kjacobs

	FIPS guidance now requires self-tests for our kdfs. It also requires
	self-tests for cmac which we didn't have in the cmac patch.

	Currently only one test per kdf is necessary. Specifially for
	SP-800-108, only one of the three flavors are needed (counter,
	feedback, or pipeline). This patch includes more complete testing
	but it has been turned off the currently extraneous tests under the
	assumption that NIST guidance may require them in the future. HKDF
	is currently not included in FIPS, but is on track to be included,
	so hkdf have been included in this patch.

	Because the test vectors are const strings, the patch pushes some
	const definitions that were missing in existing private interfaces.

	There are three flavors of self-tests: Function implemented in
	freebl are added to the freebl/fipsfreebl.c Functions implemented in
	pkcs11c.c have selftests completely implemented in
	softoken/fipstest.c Functions implemented in their own .c file have
	their selftest function implemented in that .c file and called by
	fipstests.c These are consistant with the previous choices for
	selftests.

	Some private interfaces that took in keys from pkcs #11 structures
	or outputted keys to pkcs #11 structures were modified to optionally
	take keys in by bytes and output keys as bytes so the self-tests can
	work in just bytes.

	[5dca54fe61c2]

2020-08-25  Daiki Ueno  <dueno@redhat.com>

	* lib/softoken/manifest.mn:
	Bug 1659252, disable building libnssdbm3.so if NSS_DISABLE_DBM=1,
	r=rrelyea

	Reviewers: rrelyea

	Reviewed By: rrelyea

	Bug #: 1659252

	[4d55d36ca6ef]

2020-08-24  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/pk11wrap/pk11cxt.c, lib/softoken/pkcs11c.c, lib/softoken/sdb.c,
	lib/softoken/sftkpwd.c:
	Bug 1651834 - Fix various static analyzer warnings. r=rrelyea

	[ab04fd73fd6d]

2020-08-28  Mike Hommey  <mh@glandium.org>

	* lib/freebl/blapii.h:
	Bug 1661810 - Define pre_align/post_align based on the compiler.
	r=jcj

	Things worked fine before we upgraded to clang 11 presumably because
	the stack was always 16-bytes aligned in the first place, or
	something akin to that, and the lack of pre_align/post_align doing
	anything didn't matter. The runtime misalignment of the stack may
	well be a clang > 9 bug, but keeping pre_align/post_align tied to
	the x86/x64 is a footgun anyways.

	[c100e11991f6] [tip]

Differential Revision: https://phabricator.services.mozilla.com/D88876
2020-08-31 15:56:19 +00:00
ffxbld ef863a6fcc No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D88854
2020-08-31 14:18:05 +00:00
Sylvestre Ledru 9c192aa9ca Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 09:23:02 +00:00
Mihai Alexandru Michis 261d01524b Backed out changeset d0f173a90792 (bug 1519636) for causing bustages.
CLOSED TREE
2020-08-31 10:14:58 +03:00
Sylvestre Ledru 939dd426e6 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D88713
2020-08-31 06:51:21 +00:00
ffxbld d847176371 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D88427
2020-08-27 14:42:57 +00:00
Julien Cristau dde737671d Bug 1661543 - Backed out 1 changesets (bug 1651449) for performance regression. a=backout CLOSED TREE
Backed out changeset 323e4aecc563 (bug 1651449)
2020-08-27 22:31:36 +02:00
Haik Aftandilian 6e9c6f97f9 Bug 1660045 - Patch 2 - Allow mappings from translated binary directories r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D87014
2020-08-27 07:04:35 +00:00
Toshihito Kikuchi eaaa31291a Bug 1630444: Part3 - Send the launcher process failure ping from the browser process. r=aklotz
This patch adds a new property `process_type` to the launcher process failure
ping, indicating which process type the browser process failed to initialize
as a sandboxed process.

Depends on D83639

Differential Revision: https://phabricator.services.mozilla.com/D83640
2020-08-26 19:01:27 +00:00
ffxbld 090583273a No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D88052
2020-08-24 18:34:41 +00:00
Kevin Jacobs d1d6b661e3 Bug 1655105 - land NSS NSS_3_56_RTM UPGRADE_NSS_RELEASE, r=jcj
2020-08-21  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/nss/nss.h, lib/softoken/softkver.h, lib/util/nssutil.h:
	Set version numbers to 3.56 final
	[809ff9ff0140] [NSS_3_56_RTM] <NSS_3_56_BRANCH>

2020-08-19  Kevin Jacobs  <kjacobs@mozilla.com>

	* .hgtags:
	Added tag NSS_3_56_BETA1 for changeset 52c965eaffa1
	[0d8ff40479d5]

Differential Revision: https://phabricator.services.mozilla.com/D87882
2020-08-21 16:10:59 +00:00
Dana Keeler 3ac5dbc513 Bug 1659786 - avoid CERTCertificate in CSTrustDomain and ContentSignatureVerifier r=rmf
Differential Revision: https://phabricator.services.mozilla.com/D87497
2020-08-20 19:28:07 +00:00
ffxbld 5e4f839c65 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D87750
2020-08-20 14:26:06 +00:00
Kevin Jacobs d343e2c8e6 Bug 1655105 - land NSS NSS_3_56_BETA1 UPGRADE_NSS_RELEASE, r=jcj
2020-08-19  Kevin Jacobs  <kjacobs@mozilla.com>

	* tests/libpkix/certs/PayPalEE.cert:
	Bug 1659792 - Update libpkix tests with unexpired PayPal cert. r=jcj

	The in-tree `PayPalEE.cert `expired today. This patch replaces it
	with a current copy that expires on 12 Jan 2022.

	CI breakage before patch: https://treeherder.mozilla.org/#/jobs?repo
	=nss&revision=2890f342de631bf6774ac747515a8b5736e20d3f CI with the
	fix applied: https://treeherder.mozilla.org/#/jobs?repo=nss-
	try&revision=bd28f21d8acbcb15502bd4fc606fc9c0ed09c810

	[52c965eaffa1] [NSS_3_56_BETA1]

2020-08-18  Kevin Jacobs  <kjacobs@mozilla.com>

	* tests/interop/interop.sh:
	Bug 1659814 - Pull updated tls-interop for dependency fix. r=jcj

	[70376af425ae]

	* automation/release/nspr-version.txt:
	Bug 1656519 - NSS 3.56 should depend on NSPR 4.28. r=kaie

	[2890f342de63]

Differential Revision: https://phabricator.services.mozilla.com/D87648
2020-08-19 21:02:09 +00:00
Simon Giesecke cfd7d0ea9c Bug 1659923 - Avoid unnecessary copies around Base64Encode. r=xpcom-reviewers,necko-reviewers,froydnj,valentin
This also adds some more variants of Base64Encode and Base64EncodeAppend.

Differential Revision: https://phabricator.services.mozilla.com/D87559
2020-08-19 17:45:16 +00:00
Dana Keeler 67e203a187 Bug 1596401 - rework certificate deletion so it happens immediately r=rmf
Differential Revision: https://phabricator.services.mozilla.com/D86775
2020-08-17 23:23:03 +00:00
Dana Keeler f56f7f0410 Bug 1658042 - osclientcerts: differentiate between keys that can and cannot do modern crypto r=kjacobs,rmf
The keys exposed by osclientcerts may be from tokens that cannot do modern
crypto (namely, ECDSA and RSA-PSS). This patch attempts to identify and
differentiate between these keys. Unfortunately, there is no good way of doing
this on macOS at this time, so the implementation assumes everything supports
modern crypto on that platform. Additionally, the Windows implementation can't
make this determination if the cryptographic service provider would show UI, so
again in those cases the implementation assumes modern crypto is available.

Differential Revision: https://phabricator.services.mozilla.com/D86440
2020-08-17 19:47:41 +00:00
ffxbld 5c66804a14 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D87287
2020-08-17 14:16:45 +00:00
Mike Hommey 4ec1f6d39f Bug 1659057 - Allow hw.memsize system call. r=spohl
This fixes the following error when running on Apple Silicon DTK:

AGX: agxs_util.cpp:355:size_t getSystemMemorySize(): !!! Verification failed: status == 0

Differential Revision: https://phabricator.services.mozilla.com/D87048
2020-08-14 13:40:34 +00:00
ffxbld 0d60e704b5 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D86996
2020-08-13 20:33:34 +00:00
Jean-Yves Avenard 35583748a1 Bug 1657521 - P4. Allow VP9 HW decoder in mac sandbox. r=haik
Differential Revision: https://phabricator.services.mozilla.com/D86546
2020-08-13 02:16:19 +00:00
Dana Keeler 576eb4cc71 bug 1598605 - add a test for decoding IPv6 subject alternative name entries r=kjacobs
Differential Revision: https://phabricator.services.mozilla.com/D56586
2020-08-12 17:41:35 +00:00
Bogdan Tara 98b30d23bf Backed out 5 changesets (bug 1657521) for assertion failure at Refs.h CLOSED TREE
Backed out changeset a0f450666c5b (bug 1657521)
Backed out changeset e97937bf5e3a (bug 1657521)
Backed out changeset 8d70f3cb5e3b (bug 1657521)
Backed out changeset 5c3c1ec039d2 (bug 1657521)
Backed out changeset 132eb437fdda (bug 1657521)
2020-08-12 11:14:44 +03:00
Jean-Yves Avenard 08ed820595 Bug 1657521 - P5. Allow VP9 HW decoder in mac sandbox. r=haik
Differential Revision: https://phabricator.services.mozilla.com/D86546
2020-08-12 04:08:58 +00:00
Dana Keeler e61827e4b0 Bug 1642592 - properly reinitialize insecure fallback hosts when clearing private data r=rmf
When the last private browsing context exits, observers are notified of the
event "last-pb-context-exited". Before this patch, the private browsing shared
TLS state object would clear its list of insecure fallback sites opon observing
this. However, this is not correct, because the list should be set to reflect
the current set of insecure fallback sites as parsed from the preference
"security.tls.insecure_fallback_hosts" (which is by default empty, but wouldn't
be if a user has modified it).

Differential Revision: https://phabricator.services.mozilla.com/D86586
2020-08-11 21:04:31 +00:00
Noemi Erli 68cd54888e Merge mozilla-central to autoland. a=merge CLOSED TREE 2020-08-11 18:56:44 +03:00
Noemi Erli 54c193f6bc Backed out changeset a93095760b1f (bug 1658042) for causing Bug 1658576 a=backout 2020-08-11 18:44:29 +03:00
Moritz Birghan ca3a2d02cd Bug 1649472 - Add telemetry for PHA in TLS 1.3 r=jcj,keeler
Differential Revision: https://phabricator.services.mozilla.com/D81715
2020-08-11 11:56:07 +00:00
Dana Keeler 3bccc9cac1 Bug 1658042 - osclientcerts: differentiate between keys that can and cannot do modern crypto r=kjacobs,rmf
The keys exposed by osclientcerts may be from tokens that cannot do modern
crypto (namely, ECDSA and RSA-PSS). This patch attempts to identify and
differentiate between these keys. Unfortunately, there is no good way of doing
this on macOS at this time, so the implementation assumes everything supports
modern crypto on that platform.

Differential Revision: https://phabricator.services.mozilla.com/D86440
2020-08-10 21:25:09 +00:00
Kevin Jacobs 5637d1775c Bug 1655105 - land NSS c06f22733446 UPGRADE_NSS_RELEASE, r=jcj
2020-08-07  Kevin Jacobs  <kjacobs@mozilla.com>

	* lib/pki/tdcache.c:
	Bug 1625791 - Call STAN_GetCERTCertificate to load CERTCertificate
	trust before caching. r=jcj,keeler

	When caching certificates, `td->cache->lock` must not be held when
	taking `slot->isPresentLock`. `add_cert_to_cache` holds then former
	when calling the sort function in `add_subject_entry`, which will [[
	https://searchfox.org/mozilla-central/rev/a3b25e347e2c22207c4b369b99
	246e4aebf861a7/security/nss/lib/pki/certificate.c#266 | call ]]
	`STAN_GetCERTCertificate` -> `fill_CERTCertificateFields` when
	`cc->nssCertificate` [[ https://searchfox.org/mozilla-central/rev/a3
	b25e347e2c22207c4b369b99246e4aebf861a7/security/nss/lib/pki/pki3hack
	.c#923 | is NULL ]].

	There are two problems with this:

	 # `fill_CERTCertificateFields` may end up locking
	`slot->isPresentLock` (bad ordering, bug 1651564) # The above may
	happen followed by another attempt to lock
	`td->cache->lock`(deadlock, this bug).

	By calling `STAN_GetCERTCertificate` prior to the first lock of
	`td->cache->lock`, we can prevent the problematic call to
	`fill_CERTCertificateFields` later on, because `cc->nssCertificate`
	will already be filled.

	[c06f22733446] [tip]

	* gtests/ssl_gtest/ssl_auth_unittest.cc, lib/ssl/ssl3con.c:
	Bug 1588941 - Send empty client cert msg when signature scheme
	selection fails. r=mt

	`ssl3_CompleteHandleCertificateRequest` does essentially two things:
	1) Calls the `getClientAuthData` hook for certificate selection, and
	2) calls `ssl_PickClientSignatureScheme` to select an appropriate
	signature scheme when a cert is selected.

	If the first function returns SECFailure, we default to sending an
	empty certificate message. If the latter fails, however, this
	bubbles up as a [[ https://searchfox.org/mozilla-central/rev/56bb74e
	a8e04bdac57c33cbe9b54d889b9262ade/security/nss/lib/ssl/tls13con.c#26
	70 | fatal error ]] (and an assertion failure) on the connection.
	Importantly, the signature scheme selection can fail for reasons
	that should not be considered fatal - notably when an RSA-PSS cert
	is selected, but the token on which the key resides does not
	actually support PSS.

	This patch treats the failure to find a usable signature scheme as a
	"no certificate" response, rather than killing the connection
	entirely.

	[41ecb7fe5546]

	* lib/freebl/Makefile, lib/freebl/freebl_base.gypi,
	lib/freebl/mpi/mpi_amd64_common.S, lib/freebl/mpi/mpi_amd64_gas.s:
	Bug 1656981 - Use 64x64->128 multiply and MP_COMBA on x86_64 Mac.
	r=mt

	This patch makes two MPI changes for MacOS:

	1. Rename `mpi_amd64_gas.s` to `mpi_amd64_common.S` and add defines
	for macho64, allowing Intel Macs to take advantage of the 64x64->128
	multiply code. 2. Define and use `NSS_USE_COMBA` on Intel Macs.

	Performance results with `rsaperf -n none -p 10 -e -x 65537`
	(default 2048-bit key): Before: `12629.12 operations/s. one
	operation every 79 microseconds` With 64x64->128 assembly: `29431.65
	operations/s. one operation every 33 microseconds` With MP_COMBA and
	64x64->128 assembly: `30332.99 operations/s. one operation every 32
	microseconds`

	[330bdab498a3]

	* lib/ssl/sslimpl.h:
	Bug 1656429 - Clang-format fixup, r=bustage
	[07083076fc92]

2020-08-05  Martin Thomson  <mt@lowentropy.net>

	* gtests/ssl_gtest/ssl_0rtt_unittest.cc,
	gtests/ssl_gtest/tls_connect.cc, lib/ssl/ssl3exthandle.c,
	lib/ssl/sslimpl.h, lib/ssl/tls13con.c, lib/ssl/tls13replay.c:
	Bug 1656429 - Correct RTT estimate used in anti-replay, r=kjacobs

	This was never a security problem, but the more time that passes
	between the handshake and sending a ticket, the more likely we are
	to reject 0-RTT. Eventually, 0-RTT only works if it is delayed in
	the network by a surprising amount.

	[b4a1c57eb569]

Differential Revision: https://phabricator.services.mozilla.com/D86454
2020-08-10 17:59:40 +00:00
ffxbld 0d46e87486 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D86553
2020-08-10 14:20:05 +00:00
Valentin Gosu 5e3e1f6296 Bug 1651672 - Clear and remove DataStorageClass::TRRBlacklist r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D86520
2020-08-10 09:46:32 +00:00
Dana Keeler 1be997b53b Bug 1651449 - rework intermediate caching to make use of nsNSSComponent's background task queue r=kjacobs,rmf
nsNSSComponent has a background task queue that can be used for importing
intermediates from TLS connections instead of using the certificate
verification thread pool.

This patch also addresses places where PSM was directly accessing the isperm
member of CERTCertificate, which is protected by a lock.

Differential Revision: https://phabricator.services.mozilla.com/D86051
2020-08-07 20:30:20 +00:00
Simon Giesecke 1e02318b49 Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83817
2020-08-07 07:49:47 +00:00
ffxbld 06d4ceb48a No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D86217
2020-08-06 14:22:37 +00:00
Kevin Jacobs cb86341c99 Bug 1655105 - land NSS afa38fb2f0b5 UPGRADE_NSS_RELEASE, r=jcj
2020-07-27  Jan-Marek Glogowski  <glogow@fbihome.de>

	* lib/freebl/Makefile:
	Bug 1652032 Disable all freebl assembler code for MSVC arm64
	r=rrelyea,bbeurdouche

	There are two places, where NSS tries to compile either x86_64 MSVC
	assembler or GCC aarch64 code, which will fail the build. And also
	drop the non-MSVC arch build flags for them.

	AFAI could identify, there isn't any armasm64 compatible asm code in
	the whole NSS library, so I don't even adapt AS for the build. The
	cross-build finishes this way.

	[d98bbb6168f4]

2020-07-24  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* cmd/bltest/blapitest.c, coreconf/config.gypi, coreconf/config.mk,
	lib/freebl/alg2268.c, lib/freebl/deprecated/alg2268.c,
	lib/freebl/freebl_base.gypi, lib/freebl/ldvector.c,
	lib/freebl/loader.c, lib/freebl/loader.h, lib/freebl/manifest.mn,
	lib/softoken/lowpbe.c, lib/softoken/pkcs11c.c:
	Bug 1652729 - Add build flag to disable RC2 and relocate to
	lib/freebl/deprecated. r=kjacobs

	[e6c6f1d2d544]

2020-07-27  Robert Relyea  <rrelyea@redhat.com>

	* gtests/softoken_gtest/manifest.mn,
	gtests/softoken_gtest/softoken_dh_vectors.h,
	gtests/softoken_gtest/softoken_gtest.cc,
	gtests/softoken_gtest/softoken_gtest.gyp, lib/freebl/blapi.h,
	lib/freebl/dh.c, lib/freebl/ldvector.c, lib/freebl/loader.c,
	lib/freebl/loader.h, lib/softoken/manifest.mn,
	lib/softoken/pkcs11.c, lib/softoken/pkcs11c.c,
	lib/softoken/pkcs11i.h, lib/softoken/pkcs11u.c,
	lib/softoken/sftkdhverify.c, lib/softoken/softoken.gyp:
	Bug 1648822 Add stricter validation of DH keys when in FIPS mode.

	Update: FIPS now also requires us to do y^q mod p testing on key
	generation (always). We now do that in FIPS mode only, but in all
	modes we do full DH verification for DH and ECDH. Because of this,
	the path has now separated out the prime checks, which are now only
	done for the DH operation if we aren't using a known prime and the
	subprime value has been provided. I've also learned we can accept
	keys that we do full validation on in FIPS mode, so I've added that
	to this patch, though we still can't generate those kinds of keys
	without adding the subprime at keygen time.

	The new FIPS standard is dh operations must use approved primes.
	Approved primes are those selected in the tls and ike RFCs.
	Currently tls and ike have modes with checks whether the primes are
	approved, but the check may not always happen. The safest thing to
	do in FIPS mode is only allow those primes. In addition, FIPS
	requires 1< y < p-1 (or technically 2<=y<=p-2, since y is an integer
	those two tests are identical).

	While making changes I realized we would want a mode where we can do
	more strict checks on the prime while not requiring that the prime
	be an approved prime. We already allow for strict checking if q is
	supplied with the private key, but there were a couple of issues
	with that check:

	 1. there was no way of actually setting q in the current NSS
	pk11wrap interfaces. 2. If the prime was a safe prime, but g was an
	actual generator, then we would fail the y^q mod p = 1 tests for 50%
	of the keys, even though those keys are safe. 3. We weren't checking
	primality of p and q.

	So the old code:

	 if (q) { check y^q mod p = 1 if not fail }

	 check 1 <y < p-1 (done in DH_Derive).

	New code:

	 if (! p is approved prime) { if (FIPS) fail; if (q) { y_test = y if
	(p,q-> p is a safe prime) { y_test = 1 } check prime is prime Fail
	if not check subprime is subprime fail if not y_test^q mod p = 1 } }
	check 1 < y < p-1 (done in DH_Derive)

	This means:

	Existing code non-fips without setting the subprime continues to run
	as before. Non-fips code which sets the subprime now runs slower,
	but p and q are checked if p or q where not prime, the derive fails
	(which it should). In FIPS mode only approved primes will succeed
	now. Non-fips code can now set the subprime to q=(p-1)/2 if it
	doesn't have an explicit q value (like in tls). If the derive
	succeeds, we know that p is a safe prime. If p is approved, the
	checks are skipped because we already know that p is a safe prime.
	Code can optionally do a test derive on a new p and remember it's
	safe so that we know longer need to check ever call (though if q is
	not (p-1)/2, you will need to continue to do the checks each call
	because y could still be a small subgroup).

	This patch:

	gtests/softoken_gtest

	 1. Added New dh tests to softoken_gtests. The tests were added to
	softoken_gtests because we need to test both non-FIPS and FIPS mode.
	Test vectors include a category, so the same test vectors can be
	used in FIPS and non-FIPS even though each class may have different
	results. Most of the test vectors where created either by dhparams
	command in openssl, dsaparams in openssl, and the nss makepqg
	command. Each vector includes a label, prime, base, optional
	subprime, optional public key, test type, and key class (basically
	size). 2. If public key is not supplied, we use a generated public
	key. 3. If subPrime is supplied to wet it on the private key after
	generation.

	lib/freebl/dh.c

	 add primality tests to KEA_VerifyKey().

	lib/softokn/

	 1. Allow CKA_SUBPRIME to be set after key generation or import.
	This affects how we test for it's existance, since it is now always
	there on the key, we check it's length to make sure it's non-zero.
	2. We implement the psuedocode above as real code. 3. We create two
	new functions: sftl_VerifyDH_Prime which return SECSuccess if Prime
	is an approved prime. sftk_IsSafePrime which returns SECSuess of
	both prime and subprime look reasonable, and sets a Bool to PR_TRUE
	is subprime -> prime is safe (subprime = (prime-1)/2. These
	functions are implemented in sftkdhverify.c 4.Cleanup incorrect
	nominclature on primes (safe primes are not strong primes).
	[0be91fa2217a]

	* gtests/softoken_gtest/softoken_dh_vectors.h,
	gtests/softoken_gtest/softoken_gtest.cc:
	Fix more of the timeout issues on tests. (Drop expensive 4098 dh
	tests ).
	[4014c075a31b]

2020-07-29  Makoto Kato  <m_kato@ga2.so-net.ne.jp>

	* coreconf/config.gypi, lib/freebl/Makefile, lib/freebl/blinit.c,
	lib/freebl/freebl.gyp, lib/freebl/sha1-armv8.c,
	lib/freebl/sha_fast.c, lib/freebl/sha_fast.h:
	Bug 1650702 - Use ARM's crypt extension for SHA1. r=kjacobs

	ARM Crypto extension has SHA1 acceleration. Using this, SHA1 is 3
	times faster on ARMv8 CPU. The following data is AWS's a1 instance
	(Cortex-A72).

	Before ====== ``` # mode in opreps cxreps context op time(sec)
	thrgput sha1_e 954Mb 31M 0 0.000 10000.000 10.000 95Mb ```

	After ===== ``` # mode in opreps cxreps context op time(sec) thrgput
	sha1_e 2Gb 94M 0 0.000 10000.000 10.000 288Mb ```

	[68b6eb737689]

2020-07-29  Jan-Marek Glogowski  <glogow@fbihome.de>

	* manifest.mn:
	Bug 1653975 - Set "all" as the default Makefile target r=jcj,rrelyea

	Just reorder the rules in manifest.mn, so all is again the first
	rule. This restores pre-3.53 Makefile defaults.

	[eb52747b7000]

2020-07-31  Makoto Kato  <m_kato@ga2.so-net.ne.jp>

	* lib/freebl/blapii.h, lib/freebl/blinit.c, nss-tool/hw-support.c:
	Bug 1654142 - Add CPU feature detection for Intel SHA extension.
	r=kjacobs

	[e6b77a9c417a]

2020-08-03  Nathan Froyd  <froydnj@mozilla.com>

	* coreconf/detect_host_arch.py:
	Bug 1656986 - special-case arm64 in detect_host_arch.py; r=jcj

	This case comes up when attempting to build NSS on ARM64 Mac. If we
	don't do this, we wind up detecting arm64 as "arm", with predictably
	bad consequences.

	[afa38fb2f0b5] [tip]

Differential Revision: https://phabricator.services.mozilla.com/D85888
2020-08-04 19:54:56 +00:00
Dana Keeler f468d1bd79 Bug 1656992 - osclientcerts: disable AIA fetching when looking for issuer certificates (macOS) r=kjacobs
When the macOS osclientcerts backend looks for issuer certificates, it can
result in network I/O unless it is specifically disabled. The Windows backend
already handles this, so this only applies to macOS.

Differential Revision: https://phabricator.services.mozilla.com/D85799
2020-08-04 18:06:14 +00:00
Mihai Alexandru Michis e7f08a598b Backed out 3 changesets (bug 1635828) for causing bc failures in browser_tab_detach_restore.js
CLOSED TREE

Backed out changeset 30c58380f352 (bug 1635828)
Backed out changeset d232cb3c4779 (bug 1635828)
Backed out changeset 7c47f9b403ae (bug 1635828)
2020-08-04 13:35:45 +03:00
Andrea Marchesini 263f055dd1 Bug 1635828 - Isolate HSTS per first-party when privacy.partition.network_state is set to true - part 2 - tests, r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D74078
2020-08-04 09:45:40 +00:00
Moritz Birghan c8319be878 Bug 634697 - Add permanent storage to user's client certificate selection r=keeler,baku,fluent-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D58820
2020-08-03 13:24:34 +00:00
ffxbld 8d979b9aee No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D85756
2020-08-03 14:13:18 +00:00
ffxbld 22530e66a4 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=jcristau
Differential Revision: https://phabricator.services.mozilla.com/D85411
2020-07-31 14:47:51 +00:00
R. Martinho Fernandes b2ff7fc0a5 Bug 1654835 - Remove CERTCertificate from PublicKeyPinningService.cpp r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D84726
2020-07-30 08:44:59 +00:00
Haik Aftandilian d9488224c3 Bug 1655655 - Some MP4 Videos Fail to Play on Big Sur r=spohl
Allow access to the "com.apple.trustd.agent" service in the content process sandbox. VTDecompressionSessionCreate() fails without it, causing playback failure for some MP4 videos.

Translate deprecated OS version numbers so that sandbox version checks don't need to check for 10.16.

Differential Revision: https://phabricator.services.mozilla.com/D85213
2020-07-29 21:59:32 +00:00
Victor Porof 75bdf2b80e Bug 1597898 - Part 1: Update RKV dependency to safe-mode, r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D54279
2020-07-29 17:38:20 +00:00
Butkovits Atila a07dcc53eb Backed out changeset 441baa36ba93 (bug 634697) for failure at test_sss_readstate.js. CLOSED TREE 2020-07-29 19:39:44 +03:00
Moritz Birghan 1bea811e47 Bug 634697 - Add permanent storage to user's client certificate selection r=keeler,baku,fluent-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D58820
2020-07-29 15:20:10 +00:00
Olli Pettay bccd166233 Bug 1654088, make WindowWatcher methods to use CStrings and not char and make window.open throw the correct exception, r=farre,geckoview-reviewers,agi*
Differential Revision: https://phabricator.services.mozilla.com/D84604
2020-07-27 21:36:24 +00:00
Jeff Muizelaar b083673982 Bug 1654699. Update core-foundation/core-graphics. r=kvark,keeler,jcj,chunmin
This includes updates to authenticator, cubeb-coreaudio,
metal, gfx-backend-vulkan, gfx-backend-metal, freetype

libloading is duplicated because of ash

Differential Revision: https://phabricator.services.mozilla.com/D84688
2020-07-24 22:35:25 +00:00
Csoregi Natalia ea1ddfabbf Backed out changeset 9702b4a4f53c (bug 1654699) for Gtest failures. CLOSED TREE 2020-07-24 21:29:52 +03:00
J.C. Jones ee419dca67 Bug 1649545 - land NSS NSS_3_55_RTM UPGRADE_NSS_RELEASE, r=keeler
2020-07-24  J.C. Jones  <jjones@mozilla.com>

	* lib/nss/nss.h, lib/softoken/softkver.h, lib/util/nssutil.h:
	Set version numbers to 3.55 final
	[6705eec655c8] [NSS_3_55_RTM] <NSS_3_55_BRANCH>

2020-07-22  Kai Engert  <kaie@kuix.de>

	* lib/nss/nssinit.c:
	Bug 1653310 - Backed out changeset ca207655b4b7, because with
	updated NSPR this workaround is no longer required. r=kjacobe
	[a448fe36e58b]

2020-07-21  Kevin Jacobs  <kjacobs@mozilla.com>

	* .hgtags:
	Added tag NSS_3_55_BETA1 for changeset 0768baa431e7
	[2572e14f17d6]

Differential Revision: https://phabricator.services.mozilla.com/D84845
2020-07-24 17:08:52 +00:00
Dana Keeler b4495c0f15 Bug 1654117 - prevent osclientcerts from loading on macOS <10.14 r=spohl
osclientcerts requires functions that are available starting in macOS 10.14, so
it shouldn't be possible to enable it in earlier versions.

Differential Revision: https://phabricator.services.mozilla.com/D84764
2020-07-24 16:25:08 +00:00
Jeff Muizelaar b17ab0c2e7 Bug 1654699. Update core-foundation/core-graphics. r=kvark,keeler,jcj,chunmin
This includes updates to authenticator, cubeb-coreaudio,
metal, gfx-backend-vulkan, gfx-backend-metal, freetype

libloading is duplicated because of ash

Differential Revision: https://phabricator.services.mozilla.com/D84688
2020-07-24 15:59:54 +00:00
Andreea Pavel 5995f3a608 Backed out 3 changesets (bug 1597898) for breaking raptor tests on win on a CLOSED TREE
Backed out changeset 5159ffa5705c (bug 1597898)
Backed out changeset 3cfb899ae94c (bug 1597898)
Backed out changeset ac992b048e32 (bug 1597898)
2020-07-24 18:54:28 +03:00
Victor Porof 9dd8820847 Bug 1597898 - Part 1: Update RKV dependency to safe-mode, r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D54279
2020-07-24 13:51:20 +00:00
Mihai Alexandru Michis c3d9e17fa4 Backed out changeset 45fc4a780b2b (bug 1654699) for causing failures regarding AudioStream position.
CLOSED TREE
2020-07-23 23:13:52 +03:00
Jeff Muizelaar 4b666af85b Bug 1654699. Update core-foundation/core-graphics. r=kvark,keeler,chunmin
This includes updates to authenticator, cubeb-coreaudio,
metal, gfx-backend-vulkan, gfx-backend-metal, freetype

libloading is duplicated because of ash

Differential Revision: https://phabricator.services.mozilla.com/D84688
2020-07-23 17:01:14 +00:00
ffxbld faed2506ca No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D84699
2020-07-23 14:25:47 +00:00
Mihai Alexandru Michis c92d36d257 Backed out changeset afc05ca167e7 (bug 1652463) for causing mochitest media spi failures. 2020-07-22 18:37:47 +03:00
Kevin Jacobs 99b3679870 Bug 1649545 - land NSS NSS_3_55_BETA1 UPGRADE_NSS_RELEASE, r=jcj
2020-07-21  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* cmd/bltest/blapitest.c:
	Bug 1653202 - Fix issue disabling other mechanisms when SEED is
	deprecated in cmd/bltest/blapitest.c. r=kjacobs

	[0768baa431e7] [NSS_3_55_BETA1]

2020-07-21  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/release/nspr-version.txt:
	Bug 1652331 - NSS 3.55 should depend on NSPR 4.27. r=kaie

	[3deefc218cd9]

2020-07-20  Billy Brumley  <bbrumley@gmail.com>

	* lib/freebl/ec.c:
	Bug 1631573: Remove unnecessary scalar padding in ec.c
	r=kjacobs,bbeurdouche

	Subsequent calls to ECPoints_mul and ECPoint_mul remove this
	padding.

	Timing attack countermeasures are now applied more generally deeper
	in the call stack.

	[aeb2e583ee95]

2020-07-20  Kai Engert  <kaie@kuix.de>

	* lib/nss/nssinit.c:
	Bug 1653310 - On macOS check if nssckbi exists prior to loading it.
	r=kjacobs

	[ca207655b4b7]

Differential Revision: https://phabricator.services.mozilla.com/D84420
2020-07-21 23:37:38 +00:00
Kashav Madan ae956c4eef Bug 1653674 - Unskip passing fission tests, r=kmag
It's possible that some of these are still failing intermittently. We can't
really know without first unskipping them.

https://github.com/annygakh/audit-tests

Differential Revision: https://phabricator.services.mozilla.com/D84017
2020-07-21 15:42:48 +00:00
Bob Owen 6094408d95 Bug 1652463: Add rule to allow socket process to create server side of our IPC pipes. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D83976
2020-07-20 18:00:42 +00:00
Kevin Jacobs e3e0baf90e Bug 1649545 - land NSS 615362dff5ad UPGRADE_NSS_RELEASE, r=jcj
2020-07-18  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* gtests/pk11_gtest/pk11_cipherop_unittest.cc, lib/softoken/pkcs11c.c:
	Bug 1636771 - Disable PKCS11 incremental mode for ChaCha20.
	r=kjacobs,rrelyea

	Depends on D74801

	[615362dff5ad] [tip]

	* gtests/pk11_gtest/pk11_chacha20poly1305_unittest.cc,
	lib/freebl/chacha20poly1305.c:
	Bug 1636771 - Fix incorrect call to Chacha20Poly1305 by PKCS11.
	r=jcj,kjacobs,rrelyea

	[a5e82e40f03e]

2020-07-16  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* lib/softoken/pkcs11c.c:
	Bug 1637222 - Enforce IV length check for DES. r=kjacobs,jcj

	[0c70232cb6d3]

Differential Revision: https://phabricator.services.mozilla.com/D84043
2020-07-20 17:19:03 +00:00
Andrew Osmond d933968108 Bug 1582954 - Use posix_fallocate if available to avoid lazy allocation for shared memory. r=jld
WebRender makes extensive use of shared memory buffers, particularly for
images decoded in the content process. These images can be arbitrarily
large, and there being insufficient memory for an allocation must be
handled gracefully.

On Linux, we will currently crash with a SIGBUS signal during image
decoding instead of just displaying the broken image tag. This is
because the pages backing the shared memory are only allocated when we
write to them. This blocks shipping WebRender on Linux.

This patch uses posix_fallocate to force the reservation of the pages,
and allows failing gracefully if they are unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D80650
2020-07-20 17:47:52 +00:00
ffxbld 20a3d243c6 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D84173
2020-07-20 14:26:08 +00:00
Matthew Noorenberghe 5b0ffb7f93 Bug 1644807 - Switch to Primary Password user-facing terminology in security/ .properties files. r=keeler,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D84027
2020-07-18 06:25:28 +00:00
Matthew Noorenberghe 62c8ce5865 Bug 1644807 - Switch to Primary Password terminology for the prompt to enter it. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D84026
2020-07-17 23:13:34 +00:00
Matthew Noorenberghe 84673bbd55 Bug 1644807 - Switch to Primary Password user-facing terminology in security/ .ftl files. r=keeler,fluent-reviewers,Pike
Differential Revision: https://phabricator.services.mozilla.com/D83898
2020-07-17 23:12:24 +00:00
Kevin Jacobs 4e97e34c45 Bug 1649545 - land NSS ca068f5b5c17 UPGRADE_NSS_RELEASE, r=jcj
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
2020-07-16 22:37:42 +00:00
Dana Keeler 0ca7b665de Bug 1653029 - pass a span of bytes to RootCABinNumber instead of NSS types r=rmf,kjacobs
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
2020-07-16 21:17:53 +00:00
ffxbld ec8efdbd5d No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D83814
2020-07-16 17:22:56 +00:00
Simon Giesecke fea9dab7f2 Bug 1651714 - Reduce expensive includes for TabMessageUtils.h. r=smaug
With these changes, on my Linux analysis with ClangBuildAnalyzer, the
top two expensive headers, DOMTypes.h and TabMessageUtils.h are no longer
among the 30 most expensive headers.

Differential Revision: https://phabricator.services.mozilla.com/D82935
2020-07-15 13:24:20 +00:00
Dana Keeler 2e61ac107e Bug 1645492 - only show certificates with corresponding error overrides in the "Servers" tab of the certificate manager r=kjacobs
Before this patch, the "Servers" tab of the certificate manager would show
built-in distrust records that had corresponding certificates (lately, this has
only consisted of two DigiNotar look-alike roots that were added many years ago
to block the real DigiNotar roots and potential cross-signs).
This patch changes the implementation to only show certificates that actually
have a corresponding error override in the "Servers" tab.

Differential Revision: https://phabricator.services.mozilla.com/D83190
2020-07-15 15:27:04 +00:00
Dorel Luca 326e14fb76 Backed out changeset 928233ea49ee (bug 634697) for causing leaks. CLOSED TREE 2020-07-15 16:39:11 +03:00
Moritz Birghan b22dbe4f47 Bug 634697 - Add permanent storage to user's client certificate selection r=keeler,baku,fluent-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D58820
2020-07-15 11:49:00 +00:00
Frederik Braun a7153982e8 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Jed Davis 08546b4b69 Bug 1650751 - Add FMODE_NONOTIFY to ignored file flags in Linux sandbox. r=gcp
As of kernel 5.8 (commit [e9c15badb][]), Linux will set the internal
`FMODE_NONOTIFY` flag on files that don't exist in the filesystem,
including (unnamed) pipes and sockets.  Although this flag isn't
properly part of the userspace API, it will be returned by F_GETFL, so
userspace code that tries to change file flags will pass it to F_SETFL.

The implementation of `F_SETFL` has an allow list of flags userspace can
change (`SETFL_MASK`) and ignores all others, but our sandbox has a list
of flags *known* to be ignored, because currently unknown flags could
potentially be accepted by the kernel in the future.

This patch adds `FMODE_NONOTIFY` as an ignored flag.

[e9c15badb]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e9c15badbb7b20ccdbadf5da14e0a68fbad51015

Differential Revision: https://phabricator.services.mozilla.com/D83205
2020-07-13 12:18:00 +00:00
Jed Davis 43278156c3 Bug 1651701 - Allow rseq in the Linux sandboxes. r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D83142
2020-07-13 12:56:24 +00:00
ffxbld bf224e945b No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D83330
2020-07-13 14:49:40 +00:00
Mike Hommey 2ae63de7b8 Bug 1651287 - Build the STS preload list as a .inc file. r=rstewart,nalexander
This has the side effect of moving it out of export per previous changes.

Differential Revision: https://phabricator.services.mozilla.com/D82646
2020-07-10 22:40:03 +00:00
Kris Maglione 9d78661f88 Bug 1649221: Update ChromeUtils.generateQI callers to pass strings. r=mccr8,remote-protocol-reviewers,marionette-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,preferences-reviewers,agi,whimboo,Bebe,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D81594
2020-07-10 23:58:28 +00:00
Dana Keeler 2a34187e89 Bug 1629002 - osclientcerts: add support for CryptoAPI-only keys r=mhowell,kjacobs
Evidently, keys stored on some tokens can only be accessed via the deprecated
CryptoAPI interface. This patch adds support for such keys.

Differential Revision: https://phabricator.services.mozilla.com/D82789
2020-07-10 22:55:43 +00:00
Kevin Jacobs 6a6ed41ab7 Bug 1649545 - land NSS 58c2abd7404e UPGRADE_NSS_RELEASE, r=jcj
2020-06-26  Kevin Jacobs  <kjacobs@mozilla.com>

	* automation/abi-check/expected-report-libssl3.so.txt, automation/abi-
	check/previous-nss-release, lib/nss/nss.h, lib/softoken/softkver.h,
	lib/util/nssutil.h:
	Set version numbers to 3.55 beta
	[332ab7db68ba]

2020-06-25  Kevin Jacobs  <kjacobs@mozilla.com>

	* tests/all.sh:
	Bug 1649190 - Run cipher, sdr, and ocsp tests under standard test
	cycle.
	[f373809abfc0]

2020-06-15  Kevin Jacobs  <kjacobs@mozilla.com>

        * gtests/common/testvectors/p256ecdsa-sha256-vectors.h,
        gtests/common/testvectors/p384ecdsa-sha384-vectors.h,
        gtests/common/testvectors/p521ecdsa-sha512-vectors.h,
        gtests/common/testvectors_base/test-structs.h,
        gtests/common/wycheproof/genTestVectors.py,
        gtests/pk11_gtest/pk11_ecdsa_unittest.cc:
        Bug 1649226 - Add Wycheproof ECDSA tests.
        [41292ff7f545]

2020-06-30  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* lib/pkcs12/p12d.c:
	Bug 1649322 - Fix null pointer passed as argument in
	pk11wrap/pk11pbe.c:1246 r=kjacobs
	[cc43ebf5bf88]

2020-06-30  Danh  <congdanhqx@gmail.com>

	* coreconf/arch.mk, coreconf/config.mk, lib/freebl/Makefile:
	Bug 1646594 - Enable AVX2 if applicable on x86_64 with make 4.3
	r=bbeurdouche
	[b579895aceb0]

2020-07-02  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

	* lib/ssl/ssl3con.c:
	Bug 1649316 - Prevent memcmp to be called with a zero length in
	ssl/ssl3con.c:6621 r=kjacobs
	[8fe9213d0551]

2020-07-02  Alexander Scheel  <ascheel@redhat.com>

	* lib/cryptohi/secvfy.c:
	Bug 1649487 - Fix bad assert in VFY_EndWithSignature. r=jcj
	[c9438b528103]

2020-07-06  Dana Keeler  <dkeeler@mozilla.com>

	* automation/abi-check/expected-report-libnss3.so.txt,
	gtests/pk11_gtest/pk11_find_certs_unittest.cc, lib/nss/nss.def,
	lib/pk11wrap/pk11cert.c, lib/pk11wrap/pk11pub.h:
	Bug 1649633 - add PK11_FindEncodedCertInSlot r=kjacobs,jcj

	PK11_FindEncodedCertInSlot can be used to determine the PKCS#11
	object handle of an encoded certificate in a given slot. If the
	given certificate does not exist in that slot, CK_INVALID_HANDLE is
	returned.
	[32fe710a942f]

	* gtests/pk11_gtest/pk11_find_certs_unittest.cc:
	Bug 1649633 - follow-up to make test comparisons in
	pk11_find_certs_unittest.cc yoda comparisons r=kjacobs
	[424dae31a1c1]


2020-07-07  Kevin Jacobs  <kjacobs@mozilla.com>

        * gtests/pk11_gtest/pk11_rsapkcs1_unittest.cc, lib/freebl/rsapkcs.c:
        Bug 1067214 - Check minimum padding in RSA_CheckSignRecover.
        r=rrelyea

        This patch adds a check to `RSA_CheckSignRecover` enforcing a
        minimum padding length of 8 bytes for PKCS #1 v1.5-formatted
        signatures. In practice, RSA key size requirements already ensure
        this requirement is met, but smaller (read: broken) key sizes can be
        used via configuration overrides, and NSS should just follow the
        spec.
        [e5324bd5a885]

2020-07-08  Kevin Jacobs  <kjacobs@mozilla.com>

        * gtests/ssl_gtest/libssl_internals.c,
        gtests/ssl_gtest/libssl_internals.h,
        gtests/ssl_gtest/ssl_record_unittest.cc,
        gtests/ssl_gtest/tls_agent.cc, gtests/ssl_gtest/tls_agent.h,
        lib/ssl/dtls13con.c, lib/ssl/dtls13con.h, lib/ssl/ssl3con.c,
        lib/ssl/ssl3prot.h, lib/ssl/sslspec.h, lib/ssl/sslt.h,
        lib/ssl/tls13con.c, lib/ssl/tls13exthandle.c:
        Bug 1647752 - Update DTLS 1.3 implementation to draft-38. r=mt

        This patch updates DTLS 1.3 to draft-38. Specifically:

         # `ssl_ct_ack` value changes from 25 to 26. # AEAD limits in
        `tls13_UnprotectRecord` enforce a maximum of 2^36-1 (as we only
        support GCM/ChaCha20 AEADs) decryption failures before the
        connection is closed. # Post-handshake authentication will no longer
        be negotiated in DTLS 1.3. This allows us to side-step the more
        convoluted state machine requirements.
        [132a87fc8689]

2020-07-09  Benjamin Beurdouche  <bbeurdouche@mozilla.com>

        * lib/pk11wrap/pk11pbe.c, lib/pkcs12/p12d.c:
        Bug 1649322 - Fix null pointer passed as argument in
        pk11wrap/pk11pbe.c:1246 r=kjacobs

        This is a fixup patch that reverts https://hg.mozilla.org/projects/n
        ss/rev/cc43ebf5bf88355837c5fafa2f3c46e37626707a and adds a null
        check around the memcpy in question.
        [80bea0e22b20]

2020-07-09  J.C. Jones  <jjones@mozilla.com>

        * lib/softoken/pkcs11.c:
        Bug 1651520 - slotLock race in NSC_GetTokenInfo r=kjacobs

        Basically, NSC_GetTokenInfo doesn't lock slot->slotLock before
        accessing slot after obtaining it, even though slotLock is defined
        as its lock. [0]

        [0] https://searchfox.org/nss/rev/a412e70e55218aaf670f1f10322fa734d8
        a9fbde/lib/softoken/pkcs11i.h#320-321
        [58c2abd7404e] [tip]

Differential Revision: https://phabricator.services.mozilla.com/D82466
2020-07-09 23:05:48 +00:00
Jed Davis 3bfc3ec49f Bug 1640345 - Add a hidden pref to prevent sandboxed content processes from connecting to the X server. r=gcp
This adds the boolean pref security.sandbox.content.headless (on Linux
only) which does two things:

1. Sets the MOZ_HEADLESS env var for content processes, so that they
don't initialize GTK and don't connect to the X server.

2. Disallows brokered access to parts of the filesystem used only for
graphics -- most critically connecting to the X11 socket itself, but
also opening GPU device nodes and the parts of sysfs used by Mesa, for
example.

This is experimental; use at your own risk.

Setting this pref will break native widgets, so it's also necessary to
set widget.disable-native-theme-for-content

Additionally, it breaks Flash and WebGL; see bug 1638466 for the latter.

Differential Revision: https://phabricator.services.mozilla.com/D81425
2020-07-01 21:10:36 +00:00
Jed Davis 30edd06026 Bug 1644917 - Part 2: Cache as much of the content sandbox file policy as possible. r=gcp,Gijs
Now that filesystem broker policy entries that depend on prefs can be
cached in the "common" policy object, let's do this wherever possible.

Partially fixes bug 1600189.

Differential Revision: https://phabricator.services.mozilla.com/D81424
2020-07-02 11:26:11 +00:00
Jed Davis c3572e2dda Bug 1644917 - Part 1: Construct content sandbox "common" policy lazily. r=gcp,Gijs
When the SandboxBrokerPolicyFactory is constructed, prefs aren't
available, which constrains the cached subset of the content process
policy to entries that don't depend on prefs.  Delaying the computation
until a content process is started removes that restriction.

(This also delays the reading of dynamic linker configuration to discover
library directories, so a test needs to be adjusted.)

Differential Revision: https://phabricator.services.mozilla.com/D81423
2020-07-02 11:27:21 +00:00
Jed Davis c9ea5d4842 Bug 1644917 - Part 0: Make AddDynamicPathList a static non-member function. r=gcp
Not strictly necessary, but I noticed this while I was making changes:
AddDynamicPathList can be a simple static function instead of a private
static method, and doesn't need to be in the header.

Differential Revision: https://phabricator.services.mozilla.com/D81422
2020-07-01 20:49:19 +00:00
ffxbld 70e23b89d1 No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D82904
2020-07-09 14:21:42 +00:00
Nika Layzell 22a65a237e Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-08 20:15:59 +00:00
Mihai Alexandru Michis 1ba2a3f6f6 Backed out 3 changesets (bug 1650163) for causing bustages in nsContentSecurityManager.cpp
CLOSED TREE

Backed out changeset 51d7c644a1e6 (bug 1650163)
Backed out changeset 3d2b6908447a (bug 1650163)
Backed out changeset 79141707d47b (bug 1650163)
2020-07-08 21:18:44 +03:00
Nika Layzell c850a94434 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-08 14:54:48 +00:00
Toshihito Kikuchi 2810e91249 Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-07-08 12:54:35 +00:00
Toshihito Kikuchi 0e041b91bd Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-07-08 12:54:33 +00:00
Toshihito Kikuchi b7f3f014fe Bug 1639030 - Part 1: Update with_update and after_update patches. r=bobowen
This commit updates files under security/sandbox/chromium-shim/patches/
to prepare our codebase for Chromium sandbox update.  See patch files for
the details of each patch.

This also removes the following patches from with_update no longer needed.

1) update_chromium_linux_x86_syscalls.patch is included in
   b4f3df4e77
2) ifdef_out_ApplyMitigationsToCurrentThread.patch cannot be used because
   we use ApplyMitigationsToCurrentThread since the following commit.
   4bed2eb502
3) mingw_base_win_get_caller.patch is included in
   d8b73eb8f0
4) fix_incorrect_int_use_in_Kernel32BaseVersion.patch is fixed by
   https://hg.mozilla.org/mozilla-central/rev/dc9d71fb3bac807a37dbfba35d609ac4ffff1980
5) revert_removal_of_AlterEnvironment_on_Windows.patch is altered by adding
   environment_internal.h/cc as a different commit.
6) mingw_undefine_MemoryBarrier.patch is no longer needed as
   base::subtle::MemoryBarrier was removed by
   bdbaaf4e7e
7) public_siginfo_fields.patch is included in
   6bd491daaf

Differential Revision: https://phabricator.services.mozilla.com/D79558
2020-07-08 12:54:18 +00:00
Manish Giri 6e3170ab3d Bug 1650306 - Address the defects found by the pylint/no-else-return rule. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D82508
2020-07-08 09:24:49 +00:00
Narcis Beleuzu 8359f16846 Backed out 7 changesets (bug 1650163, bug 1649477) for bustages on JSActor.cpp . CLOSED TREE
Backed out changeset 4a21afb65254 (bug 1650163)
Backed out changeset c41753a56f5a (bug 1650163)
Backed out changeset 5fb444c35764 (bug 1650163)
Backed out changeset 830aa93d2b0c (bug 1649477)
Backed out changeset eca6e9dce450 (bug 1649477)
Backed out changeset 5b217aa88289 (bug 1649477)
Backed out changeset 8959d02b840f (bug 1649477)
2020-07-08 04:09:27 +03:00
Nika Layzell df351180c3 Bug 1650163 - Part 1: Switch native remoteType values to nsCString, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D82104
2020-07-06 20:30:58 +00:00
R. Martinho Fernandes 821813e242 Bug 1574259 - Improve resource management in ReauthenticateUserWindows r=dmajor,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D82393
2020-07-07 14:46:41 +00:00
Doug Thayer f9aaa02d04 Bug 1623943 - Exit from IdleSaveIntermediateCerts if shutting down r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D81612
2020-07-06 17:57:03 +00:00
Doug Thayer c4aa10a200 Bug 1623943 - Early exit from healer task if app is shutting down r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D81611
2020-07-06 17:56:51 +00:00
Dana Keeler 8b5037b2d1 Bug 1649518 - 3/3: enable osclientcerts by default in nightly r=jcj,johannh
Differential Revision: https://phabricator.services.mozilla.com/D81890
2020-07-06 19:29:17 +00:00
ffxbld b1db909e2e No Bug, mozilla-central repo-update HSTS HPKP remote-settings - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D82375
2020-07-06 14:28:26 +00:00
Dorel Luca feebf13084 Backed out 3 changesets (bug 1639030) for MDA failures in dom/media/test/test_eme_autoplay.html. CLOSED TREE
Backed out changeset e614d160ab92 (bug 1639030)
Backed out changeset e93c2e3b1e62 (bug 1639030)
Backed out changeset c40a82e96834 (bug 1639030)
2020-07-06 16:16:42 +03:00
Toshihito Kikuchi 1f41e7ebe4 Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-07-06 04:04:19 +00:00
Toshihito Kikuchi 0cbcab5ebb Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Apply a workaround for Clang's bug to compile *_interception.cc
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-07-06 04:04:12 +00:00
Toshihito Kikuchi 8e7730db34 Bug 1639030 - Part 1: Update with_update and after_update patches. r=bobowen
This commit updates files under security/sandbox/chromium-shim/patches/
to prepare our codebase for Chromium sandbox update.  See patch files for
the details of each patch.

This also removes the following patches from with_update no longer needed.

1) update_chromium_linux_x86_syscalls.patch is included in
   b4f3df4e77
2) ifdef_out_ApplyMitigationsToCurrentThread.patch cannot be used because
   we use ApplyMitigationsToCurrentThread since the following commit.
   4bed2eb502
3) mingw_base_win_get_caller.patch is included in
   d8b73eb8f0
4) fix_incorrect_int_use_in_Kernel32BaseVersion.patch is fixed by
   https://hg.mozilla.org/mozilla-central/rev/dc9d71fb3bac807a37dbfba35d609ac4ffff1980
5) revert_removal_of_AlterEnvironment_on_Windows.patch is altered by adding
   environment_internal.h/cc as a different commit.
6) mingw_undefine_MemoryBarrier.patch is no longer needed as
   base::subtle::MemoryBarrier was removed by
   bdbaaf4e7e
7) public_siginfo_fields.patch is included in
   6bd491daaf

Differential Revision: https://phabricator.services.mozilla.com/D79558
2020-07-06 04:03:59 +00:00
Sylvestre Ledru caf785c695 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D82178
2020-07-04 09:38:43 +00:00
Dorel Luca 751ff32a41 Backed out 3 changesets (bug 1639030) for build bustage. CLOSED TREE
Backed out changeset d7bd92ae8de6 (bug 1639030)
Backed out changeset dc961d2004fd (bug 1639030)
Backed out changeset 2c6cfddbc1af (bug 1639030)
2020-07-03 23:26:12 +03:00
Toshihito Kikuchi e77485c628 Bug 1639030 - Part 3: Roll-up patch to apply remaining mozilla changes to chromium sandbox. r=bobowen
This commit applies patches under security/sandbox/chromium-shim/patches/after_update/.

Differential Revision: https://phabricator.services.mozilla.com/D79561
2020-07-03 19:15:53 +00:00
Toshihito Kikuchi 617828f9d5 Bug 1639030 - Part 2: Roll-up of chromium sandbox update and patches to get a running browser. r=bobowen
This commit does:
- Sync files under security/sandbox/chromium/ with Chromium 81.0.4044.138
- Update files under security/sandbox/chromium-shim/
- Apply patches under security/sandbox/chromium-shim/patches/with_update/
- Apply a workaround for Clang's bug to compile *_interception.cc
- Add mozilla::AddWin32kLockdownPolicy to apply MITIGATION_WIN32K_DISABLE before SUBSYS_WIN32K_LOCKDOWN

Differential Revision: https://phabricator.services.mozilla.com/D79560
2020-07-03 19:15:30 +00:00
Toshihito Kikuchi 197278374e Bug 1639030 - Part 1: Update with_update and after_update patches. r=bobowen
This commit updates files under security/sandbox/chromium-shim/patches/
to prepare our codebase for Chromium sandbox update.  See patch files for
the details of each patch.

This also removes the following patches from with_update no longer needed.

1) update_chromium_linux_x86_syscalls.patch is included in
   b4f3df4e77
2) ifdef_out_ApplyMitigationsToCurrentThread.patch cannot be used because
   we use ApplyMitigationsToCurrentThread since the following commit.
   4bed2eb502
3) mingw_base_win_get_caller.patch is included in
   d8b73eb8f0
4) fix_incorrect_int_use_in_Kernel32BaseVersion.patch is fixed by
   https://hg.mozilla.org/mozilla-central/rev/dc9d71fb3bac807a37dbfba35d609ac4ffff1980
5) revert_removal_of_AlterEnvironment_on_Windows.patch is altered by adding
   environment_internal.h/cc as a different commit.
6) mingw_undefine_MemoryBarrier.patch is no longer needed as
   base::subtle::MemoryBarrier was removed by
   bdbaaf4e7e
7) public_siginfo_fields.patch is included in
   6bd491daaf

Differential Revision: https://phabricator.services.mozilla.com/D79558
2020-07-03 19:15:17 +00:00
Kershaw Chang b615d8681a Bug 1640612 - Allow socket process to read /etc, r=gcp
Differential Revision: https://phabricator.services.mozilla.com/D80718
2020-06-26 08:32:46 +00:00
Kershaw Chang af6512b101 Bug 1640612 - Allow FIONREAD ioctl for socket process, r=jld
Differential Revision: https://phabricator.services.mozilla.com/D79071
2020-06-26 08:32:48 +00:00
Kershaw Chang f700a7ee35 Bug 1640612 - Deal with uname() for socket process, r=jld
Differential Revision: https://phabricator.services.mozilla.com/D78148
2020-06-26 08:32:50 +00:00
ffxbld 079e757071 No Bug, mozilla-central repo-update HSTS HPKP remote-settings tld-suffixes - a=repo-update r=RyanVM
Differential Revision: https://phabricator.services.mozilla.com/D82025
2020-07-02 14:34:09 +00:00
Haik Aftandilian 3547934f67 Bug 1648838 - Remove OS-specific sandboxing code for unsupported macOS versions (up to 10.11 inclusive) r=spohl
Remove macOS 10.11 (and earlier) specific rules from the content and Flash sandbox profiles.

Differential Revision: https://phabricator.services.mozilla.com/D81813
2020-07-01 14:27:13 +00:00
Jon Bauman a415128250 Bug 1649312 - No derogatory language: Remove references to grandfather in comments r=njn,zbraniecki,keeler,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D81628
2020-07-01 15:23:26 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke e3c223da3e Bug 1648010 - Fix uses of NS_LITERAL_STRING with C string literals. r=geckoview-reviewers,agi,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80861
2020-07-01 08:34:12 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Jean-Yves Avenard 488ccd8244 Bug 1648326 - Don't dispatch runnable on the running taskqueue. r=bobowen,jld
The current taskqueue is blocked until the current function has finished; Running the event loop would only process events on the running thread.

Additionally, we make mIPCLaunchThread an nsISerialEventTarget to guarantee that at shutdown the tasks are run in order regardless of the IPC Launch Thread type.

Differential Revision: https://phabricator.services.mozilla.com/D81511
2020-07-01 06:46:59 +00:00
Dana Keeler 01d493c65b Bug 1647505 - update the list of Google roots in PreloadedHPKPins.json DONTBUILD NPOTB r=jcj,kjacobs
Differential Revision: https://phabricator.services.mozilla.com/D81626
2020-06-30 16:15:35 +00:00
Noemi Erli 9c9875dead Backed out 4 changesets (bug 1644917, bug 1640345) for causing failures in browser_preferences_usage.js CLOSED TREE
Backed out changeset 0f8b6494d3eb (bug 1640345)
Backed out changeset 4da77f0a0687 (bug 1644917)
Backed out changeset 54904fe41df8 (bug 1644917)
Backed out changeset ef0321787c8f (bug 1644917)
2020-06-30 05:27:44 +03:00
Dana Keeler 5269943007 Bug 1648855 - osclientcerts: re-scan OS storage only when NSS is searching for all certificates/keys r=kjacobs
Differential Revision: https://phabricator.services.mozilla.com/D81411
2020-06-30 00:07:14 +00:00
Jed Davis 0940e5ba82 Bug 1640345 - Add a hidden pref to prevent sandboxed content processes from connecting to the X server. r=gcp
This adds the boolean pref security.sandbox.content.headless (on Linux
only) which does two things:

1. Sets the MOZ_HEADLESS env var for content processes, so that they
don't initialize GTK and don't connect to the X server.

2. Disallows brokered access to parts of the filesystem used only for
graphics -- most critically connecting to the X11 socket itself, but
also opening GPU device nodes and the parts of sysfs used by Mesa, for
example.

This is experimental; use at your own risk.

Setting this pref will break native widgets, so it's also necessary to
set widget.disable-native-theme-for-content

Additionally, it breaks Flash and WebGL; see bug 1638466 for the latter.

Differential Revision: https://phabricator.services.mozilla.com/D81425
2020-06-29 22:32:10 +00:00
Jed Davis 172a1b1ced Bug 1644917 - Part 2: Cache as much of the content sandbox file policy as possible. r=gcp
Now that filesystem broker policy entries that depend on prefs can be
cached in the "common" policy object, let's do this wherever possible.
Should also fix bug 1621231.

Differential Revision: https://phabricator.services.mozilla.com/D81424
2020-06-29 22:32:07 +00:00
Jed Davis 771b8498b1 Bug 1644917 - Part 1: Construct content sandbox "common" policy lazily. r=gcp
When the SandboxBrokerPolicyFactory is constructed, prefs aren't
available, which constrains the cached subset of the content process
policy to entries that don't depend on prefs.  Delaying the computation
until a content process is started removes that restriction.

Differential Revision: https://phabricator.services.mozilla.com/D81423
2020-06-29 22:32:05 +00:00
Jed Davis 0808445a13 Bug 1644917 - Part 0: Make AddDynamicPathList a static non-member function. r=gcp
Not strictly necessary, but I noticed this while I was making changes:
AddDynamicPathList can be a simple static function instead of a private
static method, and doesn't need to be in the header.

Differential Revision: https://phabricator.services.mozilla.com/D81422
2020-06-29 22:32:03 +00:00
Nihanth Subramanya 359cdd5536 Bug 1555557 - Do cert override file writes off the main thread. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D35375
2020-06-29 17:00:58 +00:00
Kershaw Chang 7588e2e7ca Bug 1645083 - Remove probes: SESSION_RESUMPTION_WITH_*, r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D80006
2020-06-29 07:50:29 +00:00