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

55 Коммитов

Автор SHA1 Сообщение Дата
longsonr 6edb9f65b4 Bug 1710185 - export SECKEY_EncryptedPrivateKeyInfoTemplate r=bbeurdouche
Differential Revision: https://phabricator.services.mozilla.com/D114682
2021-05-08 15:21:50 +00:00
Benjamin Beurdouche 7135b629a9 Bug 1709791 - Expose HASH_GetHashTypeByOidTag in nss.symbols. r=beurdouche
Differential Revision: https://phabricator.services.mozilla.com/D114471
2021-05-06 10:29:35 +00:00
Simon Giesecke 7d2448b7d5 Bug 1641178 - Add NSSCipherStrategy. r=dom-workers-and-storage-reviewers,jcj,janv
Differential Revision: https://phabricator.services.mozilla.com/D73290
2021-03-12 09:31:57 +00:00
Dana Keeler 69dcaa6539 Bug 1694542 - cache intermediate certificates on the socket thread when it is idle r=mbirghan,rmf
Firefox sometimes caches intermediate certificates from verified connections in
case they are useful in the future. This operation involves modifying the NSS
cert database, and so should only be done on the socket thread (ideally when it
is idle).

Differential Revision: https://phabricator.services.mozilla.com/D106230
2021-03-10 17:09:03 +00:00
Butkovits Atila 22e752e996 Backed out changeset 8f7c25b71590 (bug 1641178) for causing GTest failures. CLOSED TREE 2021-02-24 18:14:23 +02:00
Simon Giesecke e09b49aa3d Bug 1641178 - Add NSSCipherStrategy. r=dom-workers-and-storage-reviewers,jcj,janv
Differential Revision: https://phabricator.services.mozilla.com/D73290
2021-02-24 13:18:24 +00:00
Kershaw Chang 119a94bbef Bug 1684040 - P3: Encrypt and decrypt DNS packet r=necko-reviewers,kjacobs,valentin
Differential Revision: https://phabricator.services.mozilla.com/D101684
2021-01-26 17:44:45 +00:00
Mihai Alexandru Michis 51b7d9634a Backed out 3 changesets (bug 1684040) for causing bustages in DNSPacket.cpp
CLOSED TREE

Backed out changeset 3c771d45563a (bug 1684040)
Backed out changeset 76e79151d53c (bug 1684040)
Backed out changeset 7a993eb7bfde (bug 1684040)
2021-01-26 16:15:12 +02:00
Kershaw Chang 33da037c55 Bug 1684040 - P3: Encrypt and decrypt DNS packet r=necko-reviewers,kjacobs,valentin
Differential Revision: https://phabricator.services.mozilla.com/D101684
2021-01-26 12:43:03 +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
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
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
Benjamin Beurdouche 290b838cb5 Bug 1615438 - Use CKA_NSS_SERVER_DISTRUST_AFTER from NSS for certificate validation. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D74662
2020-05-28 20:35:48 +00:00
Andy Grover bb914e65cb Bug 1614711 - Update to Neqo 0.1.14 for support for QUIC draft 25 r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D62655

--HG--
extra : moz-landing-system : lando
2020-02-13 22:18:07 +00:00
Dana Keeler 16bb37cff1 bug 1573542 - be more efficient about finding client certificates r=jcj,kjacobs
Before this patch, Firefox would call CERT_FindUserCertsByUsage to gather all
known client certificates. This function enumerates all known certificates and
filters some of them out. When there are many certificates that are not client
certificates (e.g. roots and intermediates), this is inefficient. Since this is
likely to be the case for most users, this patch optimizes this task by instead
first searching for private keys and then gathering all certificates that have
corresponding public keys.

Differential Revision: https://phabricator.services.mozilla.com/D46187

--HG--
extra : moz-landing-system : lando
2019-09-18 23:28:05 +00:00
Dragana Damjanovic c667e010d5 Bug 1578883 - Expose some functions needed for Quic. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D44727

--HG--
extra : moz-landing-system : lando
2019-09-05 19:51:32 +00:00
J.C. Jones aca1e19c11 Bug 1569221 - Change TLSServer.cpp to support the modern SSL_ConfigServerCert r=keeler
This patch does not change the existing servers to use the new mechanism, rather
attempting to be minimalist. I filed Bug 1569222 for that.

Differential Revision: https://phabricator.services.mozilla.com/D39518

--HG--
extra : moz-landing-system : lando
2019-07-26 20:09:43 +00:00
Dana Keeler 5a208d1853 bug 1557092 - add fast path to avoid calling CERT_CreateSubjectList for most certificate verifications r=jcj,KevinJacobs
Differential Revision: https://phabricator.services.mozilla.com/D34042

--HG--
extra : moz-landing-system : lando
2019-06-11 22:45:26 +00:00
Ehsan Akhgari 4cb428d268 Bug 1555205 - Move db/sqlite3 to third_party/; r=mak
Differential Revision: https://phabricator.services.mozilla.com/D32939

--HG--
rename : db/sqlite3/README => third_party/sqlite3/README
rename : db/sqlite3/README.MOZILLA => third_party/sqlite3/README.MOZILLA
rename : db/sqlite3/src/moz.build => third_party/sqlite3/src/moz.build
rename : db/sqlite3/src/sqlite.symbols => third_party/sqlite3/src/sqlite.symbols
rename : db/sqlite3/src/sqlite3.c => third_party/sqlite3/src/sqlite3.c
rename : db/sqlite3/src/sqlite3.h => third_party/sqlite3/src/sqlite3.h
extra : moz-landing-system : lando
2019-05-29 10:16:29 +00:00
Michal Novotny 242a096333 Bug 1546975 - Cache SSL resumption tokens in necko, r=mayhemer
SSLTokensCache is a simple memory only storage for resumption tokens which are get and set using API for external TLS session caches in NSS.

Differential Revision: https://phabricator.services.mozilla.com/D29465

--HG--
extra : moz-landing-system : lando
2019-05-09 22:04:43 +00:00
Kai Engert 2fda622819 Bug 1529227, Don't export NSS CMS functions not required by Firefox, r=keeler 2019-02-28 10:21:31 +01:00
Kai Engert 3073a61c44 Bug 1526473, Export NSS_CMSSignedData_GetDigestAlgs and NSS_CMSSignedData_HasDigests in security/nss.symbols, r=jcj 2019-02-09 03:35:00 +01:00
Byron Campen [:bwc] 68bc15c3ce Bug 1494311: Making the mtransport API a little more IPC friendly, and establishing a proper base-class. r=mt,mjf
Differential Revision: https://phabricator.services.mozilla.com/D17272

--HG--
extra : moz-landing-system : lando
2019-01-29 14:56:19 +00:00
Robert Helmer a8e1af1e15 Bug 1421501 - export NSS [Init,Shutdown]Context symbols r=fkiefer
MozReview-Commit-ID: Kmhn1dBSYUD

--HG--
extra : rebase_source : 0b89ae88453de99d2e3a8a347fea5afd82aa07bf
2018-08-09 08:35:48 -07:00
Cosmin Sabou 0bd06ad763 Backed out 7 changesets (bug 1421501) for causing build bustages. CLOSED TREE
Backed out changeset 492f05d220b1 (bug 1421501)
Backed out changeset 844232d77d0d (bug 1421501)
Backed out changeset 3affc66728b0 (bug 1421501)
Backed out changeset 4d7c3c02ce8d (bug 1421501)
Backed out changeset e27d93ac79a0 (bug 1421501)
Backed out changeset a6c9888b5179 (bug 1421501)
Backed out changeset f7f9e47f0608 (bug 1421501)
2018-08-23 22:46:07 +03:00
Robert Helmer 84023e4e83 Bug 1421501 - export NSS [Init,Shutdown]Context symbols r=fkiefer
MozReview-Commit-ID: Kmhn1dBSYUD

--HG--
extra : rebase_source : 1deef9e50a578b4ff24f3d44fafe4992838d0ceb
2018-08-09 08:35:48 -07:00
Gurzau Raul ac1914ecba Backed out 6 changesets (bug 1421501) for bustages on security/nss/lib/freebl/mpi/mp_comba.c on a CLOSED TREE
Backed out changeset cae4910806c7 (bug 1421501)
Backed out changeset 600a005d3613 (bug 1421501)
Backed out changeset 7381597721d2 (bug 1421501)
Backed out changeset 1ee0d35a041f (bug 1421501)
Backed out changeset 772dea1abb7f (bug 1421501)
Backed out changeset c119767aec7b (bug 1421501)
2018-08-23 17:13:42 +03:00
Robert Helmer 7a1006824c Bug 1421501 - export NSS [Init,Shutdown]Context symbols r=fkiefer
MozReview-Commit-ID: Kmhn1dBSYUD

--HG--
extra : rebase_source : 1deef9e50a578b4ff24f3d44fafe4992838d0ceb
2018-08-09 08:35:48 -07:00
Franziskus Kiefer 3d0b306faa Bug 1464828 - DAR API with libsecret and NSS back-end, r=keeler,m_and_m,froydnj
This implements an API in `nsIOSKeyStore.idl` and `OSKeyStore.cpp` to encrypt and decrypt bytes with a key that is stored in the OS key store.
There are two OS adapters in this patch.
Libsecret is used on Linux if available.
The NSS key store is used as fallback if no OS specific key store is implemented.

Differential Revision: https://phabricator.services.mozilla.com/D1858

--HG--
extra : rebase_source : 99d7d646968a46a13ffa61885bb246f6d3e443e4
2018-07-26 16:05:35 +02:00
Kai Engert b8bea43ef3 Bug 1470914, NSS 3.39 beta revision 4a086733554e UPGRADE_NSS_RELEASE r=me 2018-07-25 15:17:58 +02:00
David Keeler bb80df018c bug 1301547 - remove ancient workaround in client certificate code r=franziskus
Apparently a prehistoric server implementation would send a
certificate_authorities field that didn't include the outer DER SEQUENCE tag, so
PSM attempted to detect this and work around it. Telemetry indicates this is
unnecessary now: https://mzl.la/2Lbi1Lz

--HG--
extra : rebase_source : 6669586d657efb243070a4ceb231583b40823543
extra : amend_source : e87f7c84c6c1a51637914bde5950268409b70571
2018-07-16 16:30:15 -07:00
Felipe Gomes 254ff126ef Bug 1429148 - Add nsIPK11Token.isInternalKeyToken. r=keeler,MattN
MozReview-Commit-ID: Gdd7MxDXoTC

--HG--
extra : rebase_source : a367c07755046657d7f2133d4858ea6e6b0c219a
2018-02-20 20:43:41 -03:00
David Keeler 5bfa1a1ac8 bug 1430906 - don't hold around a test key forever in mozilla::pkix gtests r=franziskus
Before this patch, mozilla::pkix gtests would generate a public/private key pair
and stash it in a global variable. Since this wasn't part of XPCOM nor tracked
by the PSM/NSS shutdown machinery, it wouldn't get released at the appropriate
time. The solution to this is to generate the key and then essentially export it
as data, so no NSS objects are held alive. Since NSS considers private keys
stored in the persistent database sensitive and won't export them in the clear,
we "encrypt" the key material with an empty password so we can import it when
necessary. (While the gtests don't use persistent keys, the test utilties in the
gtests are also used by some xpcshell tests that do use persistent keys, hence
the need to encrypt the key material.)

--HG--
extra : rebase_source : df10c25a462a3ba0396f5ba4a43a52fb924548ff
extra : amend_source : d95722891e49a99c471046cd9c758e914a02838e
2018-01-12 13:57:51 -08:00
Kai Engert e1c5635b55 Bug 1420060, restrict export of symbols to Windows, suggested by Masatoshi Kimura, r=kaie 2018-01-11 15:04:17 +01:00
Kai Engert 46f290697e Bug 1420060, export new NSS APIs in Firefox' specific API export list, r=franziskus 2018-01-11 14:42:09 +01:00
Andreea Pavel 5967533f02 Backed out 4 changesets (bug 1428538, bug 1420060) for mochitest mass failures UPGRADE_NSS_RELEASE on a CLOSED TREE
Backed out changeset 7604bcd50b63 (bug 1420060)
Backed out changeset 7ce1e0ca10e1 (bug 1420060)
Backed out changeset 617446a093ba (bug 1428538)
Backed out changeset fb3c27bdee46 (bug 1420060)
2018-01-11 17:35:54 +02:00
Kai Engert ec3151d097 Bug 1420060, additional bustage fix as suggested by Masatoshi Kimura, r=kaie, CLOSED TREE 2018-01-11 15:04:17 +01:00
Kai Engert 69aae135c3 Bug 1420060, trivial bustage fix, export new NSS APIs in Firefox' specific API export list 2018-01-11 14:42:09 +01:00
Franziskus Kiefer 1db8f13af3 Bug 1401594 - land NSS NSS_3_34_BETA1 UPGRADE_NSS_RELEASE, r=me
MozReview-Commit-ID: 8ckNdJ29KWZ

--HG--
extra : rebase_source : 9766af247842aabce5e46c4a8d1d03c3f70d21f7
2017-11-01 15:38:36 +01:00
David Keeler 175158cc25 Bug 1411458 - Confirm we actually have a PKCS#7 signedData content info. r=jcj
MozReview-Commit-ID: GKfL1C0EPWt
2017-10-25 09:54:13 -07:00
David Keeler 3961574fa2 bug 1381154 - remove smartcard monitoring threads r=jcj,mgoodwin
Modified from bug 1248818 comment 11:
Before this patch, if a user had a smart card (PKCS#11 device) with removable
slots, Firefox would launch a thread for each module and loop, calling
SECMOD_WaitForAnyTokenEvent to be alerted to any insertions/removals. At
shutdown, we would call SECMOD_CancelWait, which would cancel any waiting
threads. However, since that involved calling 3rd party code, we really had no
idea if these modules were behaving correctly (and, indeed, they often weren't,
judging by the shutdown crashes we were getting).
The real solution is to stop relying on PKCS#11, but since that's unlikely in
the near future, the next best thing would be to load these modules in a child
process. That way, misbehaving modules don't cause Firefox to hang/crash/etc.
That's a lot of engineering work, though, so what this patch does is avoids the
issue by never calling SECMOD_WaitForAnyTokenEvent (and thus we never have to
call SECMOD_CancelWait, etc.). Instead, every time Firefox performs an operation
that may be affected by a newly added or removed smart card, it first has NSS
refresh its view of any removable slots. This is similar to how we ensure the
loadable roots module has been loaded (see bug 1372656).

MozReview-Commit-ID: JpmLdV7Vvor

--HG--
extra : rebase_source : d3503d19fa9297106d661a017a38c30969fa39b4
2017-09-28 14:27:21 -07:00
Kai Engert 2d9f082720 Bug 1401594 - "Upgrade Firefox 58 to use NSS 3.34" r=franziskus
MozReview-Commit-ID: 2ExI2oh0bPY

--HG--
extra : rebase_source : aa820344a3bbe16bb87186dddd0e8585d54981ae
2017-09-20 08:17:00 +02:00
Franziskus Kiefer 13f706ca4e Bug 1386955 - land NSS a83094ccf952 UPGRADE_NSS_RELEASE, r=me
MozReview-Commit-ID: 9F66BeXNp3a

--HG--
extra : rebase_source : aac70379cd6e09112bec2af693eda051eba8d84c
2017-09-12 14:46:59 +02:00
David Keeler 5938a7bd62 bug 1393143 - remove a few unused attributes and methods on PKCS#11 interfaces r=Cykesiopka
MozReview-Commit-ID: FKO6G6ZKjAZ

--HG--
extra : rebase_source : 265ca140aa62ebf0694849d44d3d7574c0496309
2017-08-17 16:11:57 -07:00
Franziskus Kiefer 0738b607f4 Bug 1386955 - land NSS 4bf658832d89 UPGRADE_NSS_RELEASE, r=me
MozReview-Commit-ID: 7V3T5SpKqi7

--HG--
extra : rebase_source : 165b8ba5806ed4423f5c6048b9776f9f2ffb10cc
2017-09-05 12:52:00 +02:00
Sajjad Arshad f9ecfce269 Bug 1391506 - Creating max version, fallback limit, and alt server hello flag values for the tlsFlags r=keeler
Additional-Author: Patrick McManus <mcmanus@ducksong.com>

MozReview-Commit-ID: AmsvDtvDGPt

--HG--
extra : rebase_source : fc537ef1a50db23b9e77cd48d3941d7e32228bec
2017-08-29 09:04:08 -04:00
Franziskus Kiefer 3d4912c914 Bug 1345368 - land NSS 57e38a8407b3, r=me
UPGRADE_NSS_RELEASE

--HG--
extra : rebase_source : 64f2e33d0ca49b6870882d204e899442af785ba4
extra : amend_source : 7277b5d0c15a2d51726d216f57bfed7958b45c8a
2017-05-16 17:12:24 +02:00
David Keeler af0ce9fbd6 bug 1357226 - work around a library inefficiency with EC keys when verifying ECDSA signatures r=fkiefer,jcj
Calling VFY_VerifyDigestDirect causes the provided SECKEYPublicKey to be
reimported to the softoken regardless of if it already exists on it. EC keys
must be verified upon import (to see if the point is on the curve to avoid some
small subgroup attacks), and so repeatedly doing this with a static key (say,
for example, a key corresponding to a built-in certificate transparency log) is
inefficient. This patch alters the certificate transparency implementation to
import these keys each once and then use PK11_Verify for ECDSA signature
verification, which doesn't have the same drawback.

Since this change causes CertVerifier to hold an NSS resource (via its
MultiLogCTVerifier having a list of CTLogVerifier, each of which now has a
SECKEYPublicKey), nsNSSComponent has to make sure it goes away before shutting
down NSS. This patch ensures this happens in nsNSSComponent::ShutdownNSS().

MozReview-Commit-ID: 6VSmz7S53y2

--HG--
extra : rebase_source : 4994db9de80a6c1aec3d7e322ff30d040140ce92
2017-04-11 14:11:28 -07:00
Cykesiopka 7995951109 Bug 1338897 - Avoid using NSS Base64 functions in PSM. r=keeler
The NSS Base64 functions are less safe and convenient to use than the XPCOM ones.
They're also an unnecessary dependency on NSS.

The NSS Base64 functions behave slightly differently than the XPCOM ones:
1. ATOB_ConvertAsciiToItem() / NSSBase64_DecodeBuffer() silently ignore invalid
   characters like CRLF, space and so on. Base64Decode() will return an error
   if these characters are encountered.
2. BTOA_DataToAscii() will produce output that has CRLF inserted every 64
   characters. Base64Encode() doesn't do this.

For the reasons listed below, no unexpected compatibility issues should arise:
1. AppSignatureVerification.cpp already filters out CRLF and spaces for Manifest
   and Signature values before decoding.
2. ExtendedValidation.cpp is only given what should be valid hard-coded input to
   decode.
3. ContentSignatureVerifier.cpp already splits on CRLF for when it needs to
   decode PEM certs. Spaces shouldn't be likely.
   For Content-Signature header verification, examination of real input to a
   running instance of Firefox suggests CRLF and spaces will not be present in
   the header to decode.
4. nsCryptoHash.cpp encode is affected, but we actually don't want the CRLF
   behaviour.
5. nsDataSignatureVerifier.cpp decode is affected, but we add whitespace
   stripping to maintain backwards compatibility.
6. nsKeygenHandler.cpp encode is affected, but the previous CRLF behaviour was
   arguably a bug, since neither WHATWG or W3C specs specified this.

MozReview-Commit-ID: IWMFxqVZMeX

--HG--
extra : rebase_source : 4863b2e5eabef0555e8e1ebe39216d0d9393f3e9
2017-03-17 23:31:40 +08:00
Cykesiopka d80bc035b4 Bug 1342736 - Remove nsIX509CertDB.verifySignedManifestAsync(). r=mgoodwin
verifySignedManifestAsync() was added in Bug 1059216 to support Trusted Hosted
Apps.

However, Bug 1196988 removed THA and no add-ons use this method, so there's no
point in keeping it around.

MozReview-Commit-ID: 6xBRxvRZfjh

--HG--
extra : rebase_source : 5b8cf9c5863187b55325a8f9929bbe52c6478ec5
2017-02-26 20:25:36 +08:00