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

151 Коммитов

Автор SHA1 Сообщение Дата
David Keeler 8b85837b61 bug 1372656 - load loadable roots on a background thread r=Cykesiopka,jcj
In a profile, loading the loadable roots PKCS#11 module (i.e. the built-in root
CA module) accounted for about 60% of the time to initialize PSM/NSS. Since we
only need the roots module loaded when we're actually looking for an issuing
certificate or querying a certificate's trust, we can do the load
asynchronously (where it hopefully finishes before we actually need it, because
otherwise we'll have to wait anyway).

MozReview-Commit-ID: JyY6NtpQAUj

--HG--
extra : rebase_source : f63a697b18a409dd042289afa2b727b09f81f19f
2017-06-08 16:10:00 -07:00
David Keeler f60f796fb1 bug 1356623 - remove now-unnecessary CNNIC certificate whitelist r=jcj
As a result of CNNIC issuing an unconstrained intermediate certificate that
misissued an end-entity certificate for google.com (see bug 1146026 and
bug 1177209), we implemented a system that would in theory enable Firefox to
continue to trust certificates that were valid at the time but not newly issued
certificates. This consisted of a whitelist added in bug 1151512. The CNNIC
roots have since been removed from NSS in bug 1380868. We can now remove the
whitelist in Firefox.

MozReview-Commit-ID: 7VXOuvwzbct

--HG--
extra : rebase_source : 20e6e39c40417a9b7f2962e06cf9de85e3e08ee8
2017-08-03 16:17:11 -07:00
Nicholas Nethercote 3e439bb4f8 Bug 1376638 - Minimize uses of prmem.h. r=glandium.
It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)

This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.

--HG--
extra : rebase_source : 0f781bca68b5bf3c4c191e09e277dfc8becffa09
2017-06-30 19:05:41 -07:00
David Keeler 3ddfb3c1ce bug 1364159 - potentially avoid calling CERT_CreateSubjectCertList in NSSCertDBTrustDomain::FindIssuer r=Cykesiopka,jcj
CERT_CreateSubjectCertList is not an inexpensive function call, since it
enumerates the certificate database (i.e. reads from disk a lot). If we're
verifying for a TLS handshake, however, we should already have in memory a
certificate chain sent by the peer (there are some cases where we won't, such as
session resumption (see bug 731478)). If we can, we should use those
certificates before falling back to calling CERT_CreateSubjectCertList.

MozReview-Commit-ID: ASjVGsELb1O

--HG--
extra : rebase_source : 1efc635d4a98079c87f77ef3794e4b2f20eec59f
2017-05-11 16:41:12 -07:00
David Keeler 455ab646d3 bug 1337950 - work around failing to load a FIPS PKCS#11 module DB in NSS initialization r=Cykesiopka,jcj
Firefox essentially does not support running NSS in FIPS mode any longer. This
has always been the case on Android from what I can tell and it has been the
case on OS X since at least version 34 (see bug 1047584). It became the case on
Windows as of version 53 (see bug 1295937). Unfortunately, before this patch,
if a user attempted to run an affected version of Firefox using a profile
directory containing an NSS database collection that had FIPS enabled, NSS
initialization would fail and fall back to running in no DB mode, which had the
side-effect of making any saved passwords and certificates unavailable. This
patch attempts to detect and work around this failure mode by moving the
PKCS#11 module DB (which is where the FIPS bit is set) to a backup location and
basically running with a fresh, non-FIPS module DB. This allows Firefox to
initialize NSS with the preexisting key and certificate databases available.

MozReview-Commit-ID: 1E4u1ngZyRv

--HG--
rename : security/manager/ssl/tests/unit/test_sdr_preexisting.js => security/manager/ssl/tests/unit/test_broken_fips.js
rename : security/manager/ssl/tests/unit/test_sdr_preexisting/key3.db => security/manager/ssl/tests/unit/test_broken_fips/key3.db
extra : rebase_source : 887f457e998d6e57c6536573fbe3cb10547fe154
2017-04-20 10:31:22 -07:00
David Keeler 07f34ebd2f bug 1352262 - make OCSP timeout values configurable r=Cykesiopka,jcj
The default OCSP timeout for soft-fail DV is still 2 seconds. This patch makes
it configurable on the interval (0, 5] seconds.

The default OCSP timeout for EV and hard-fail DV is still 10 seconds. This patch
makes it configurable on the interval (0, 20] seconds.

MozReview-Commit-ID: CPd8pwYrJhj

--HG--
extra : rebase_source : 45bd7d06ea013f0a776ea18be9408dedb18271d8
2017-03-31 15:21:40 -07:00
David Keeler 47263aefb3 bug 1349762 - handle two GlobalSign EV root transfers r=Cykesiopka,jcj
(adapted from bug 1349762 comment 0)
Google Trust Services (GTS) recently purchased two roots from GlobalSign that
are both enabled for EV treatment: "GlobalSign Root CA - R2" and "GlobalSign ECC
Root CA - R4".

However, GTS does not have an EV audit, so we are going to turn off EV treatment
for both of those root certificates.

But "GlobalSign Root CA - R2" has intermediate cert "GlobalSign Extended
Validation CA - SHA256 - G2" that continues to be controlled by GlobalSign, to
be used to migrate their customers off dependence on that root.

This patch removes EV treatment for "GlobalSign ECC Root CA - R4". It also
removes EV treatment for all chains rooted in "GlobalSign Root CA - R2" unless
the "GlobalSign Extended Validation CA - SHA256 - G2" intermediate is in the
chain.

MozReview-Commit-ID: Ej9L9zTwoPN

--HG--
extra : rebase_source : 575f1a48646cf728d879d0cf53c888654e4a32ad
2017-04-03 17:17:38 -07:00
David Keeler 8fa9a9c682 bug 1294580 - prevent end-entity certificates from being their own trust anchors r=Cykesiopka
MozReview-Commit-ID: KaZaFG8AWwl

--HG--
extra : rebase_source : 8cba6d29febc73e65ff54bc754ab9d016e140d6f
2017-02-24 12:32:41 -08:00
Jonathan Hao 4489e44dc2 Bug 1323644 - Isolate the HSTS and HPKP storage by first party domain (PSM) r=Cykesiopka,keeler
MozReview-Commit-ID: HhFFqtpBNjO

--HG--
extra : rebase_source : 980dfd035efc4886a7ca393923c2c2783cc76a7d
2017-02-14 10:29:10 +08:00
Tom Tromey 5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00
Tom Tromey f8ab4ddf02 Bug 1060419 - remove unneeded includes of prprf.h, r=froydnj
MozReview-Commit-ID: JifhpA3oOeH

--HG--
extra : rebase_source : 08460997dc3fd91f3065c718e17b41bb4acf8bae
2016-12-09 10:00:01 -10:00
Cykesiopka df8dcae128 Bug 1330365 - Use mozilla::TimeStamp instead of NSPR's PRIntervalTime for OCSP timeout code. r=keeler
mozilla::TimeStamp is generally superior to PRIntervalTime, and switching lets
us get rid of yet another NSPR dependency.

This patch also:
 1. Gets rid of code in nsNSSHttpRequestSession::createFcn() that limits the
    max OCSP timeout. This is a relic from when NSS was used for OCSP requests,
    and is no longer necessary.
 2. Converts all uses of PR_NOT_REACHED() to MFBT asserts while we're nearby.

MozReview-Commit-ID: KvgOWWhP8Km

--HG--
extra : rebase_source : ea832a1acc4423cf6cfc98862af6b1c29a83ce56
2017-01-14 13:12:43 +08:00
Andrea Marchesini 359ae91eac Bug 1328653 - Merging all the various *OriginAttributes to just one, r=huseby 2017-01-12 17:38:48 +01:00
Cykesiopka 56c6899d8e Bug 1325107 - Stop using PR_ASSERT() in PSM. r=mgoodwin
PR_ASSERT() is an unnecessary dependency on NSPR.
We can use MOZ_ASSERT() instead, which accomplishes the same task but doesn't
depend on NSPR.

MozReview-Commit-ID: 9gyWUkv3KxQ

--HG--
extra : rebase_source : 313ce6c8de3db3ce72635e37f09d28316ae02c51
2017-01-02 14:11:30 +08:00
David Keeler d339ca2730 bug 1312827 - make the certificate blocklist only apply to TLS server certificates r=jcj,mgoodwin
(Note that content signature verification does not use the unified certificate
verifier and thus will still consult OneCRL.)

MozReview-Commit-ID: 6KvHOngpabT

--HG--
extra : rebase_source : 601f4d8d1c66befb77d0c07a2d84f3f04416f996
2016-12-22 16:57:20 -08:00
Wes Kocher 8ca106c96d Backed out changeset 25d339813371 (bug 1312827) for browser_certViewer.js failures a=backout 2016-12-23 13:03:10 -08:00
David Keeler 981d1d04d5 bug 1312827 - make the certificate blocklist only apply to TLS server certificates r=jcj,mgoodwin
MozReview-Commit-ID: 6KvHOngpabT

--HG--
extra : rebase_source : e7af425fa2418880e8ecf7a890661797d76bcc8b
2016-12-22 16:57:20 -08:00
Cykesiopka e8b35af2ec Bug 1313715 - Avoid unnecessary uses of PR_SetError() under security/apps/ and security/certverifier/. r=keeler
The PR_SetError() + PR_GetError() pattern is error prone and unnecessary.

Also fixes Bug 1254403.

MozReview-Commit-ID: DRI69xY4vxC

--HG--
extra : rebase_source : aa07c0dfb5cc2a203e772b415b7a75b27d9bad3c
2016-12-14 20:10:25 +08:00
Jonathan Hao 88a5aac5aa Bug 1315143 - Make OCSP use Origin Attribute framework (PSM). r=Cykesiopka,keeler
--HG--
extra : rebase_source : 6ee53f5f4ce6a0cc842eb27c6890bdfde9563237
2016-11-14 18:26:15 +08:00
Carsten "Tomcat" Book 788a6efc4c Backed out changeset 81a11a25d25d (bug 1315143) 2016-11-14 12:52:16 +01:00
Jonathan Hao 06ffb1f775 Bug 1315143 - Make OCSP use Origin Attribute framework (PSM). r=mayhemer
--HG--
extra : rebase_source : 5047ebd0245729109635ba5ad99dc3f6a18b57ae
2016-11-14 18:26:15 +08:00
Jonathan Hao 736db2051a Bug 1312794 - Annotate OCSP requests by first party domain. (adapted from Tor Browser patch #13670) r=keeler
--HG--
extra : rebase_source : 1ba4d78756f9170c1ba05738dda06b9ad00a3231
2016-11-03 17:53:52 +08:00
David Keeler 544761d217 bug 1309707 - revoke StartCom and WoSign certificates issued after 21 October 2016 r=Cykesiopka,jcj
MozReview-Commit-ID: 1itMZuWY9HO

--HG--
extra : rebase_source : 5e46c04d959ab1b6e7c961e0b5d4fff7ad6417bc
2016-10-12 17:02:33 -07:00
David Keeler b3a0669843 bug 1227638 - deterministically load EV information r=Cykesiopka,mgoodwin
Previously PSM would load EV information on-demand (i.e. just before verifying a
certificate). This simplifies this operation, removes a dubious optimization
(loading the EV information on another thread while opening a network
connection), and relocates the loading operation to when we are likely to have
good disk locality (i.e. when we've just loaded the built-in roots module).

This also removes the now-unused MOZ_NO_EV_CERTS build flag.

MozReview-Commit-ID: 8Rnl4ozF95V

--HG--
extra : rebase_source : 5b2e76079c256f7e3c55b1d4ec0d9f654fec44f6
2016-09-30 18:08:08 -07:00
Jonathan Hao 8c7b033b68 Bug 1264562 - Part 5: Double key OCSP cache with firstPartyDomain (adapted from Tor Browser patch #13670) r=keeler
--HG--
extra : rebase_source : cfca6f16dcd315c03704e75ed63181466a8eb5c4
2016-10-18 17:08:39 +08:00
Jonathan Hao d9e14ecf6a Bug 1264562 - Part 4: Instantiates an NSSCertDBTrustDomain containing the first party domain (adapted from Tor Browser patch #13670) r=keeler
--HG--
extra : rebase_source : c43aa11ae06a3281219d1c70c0ec274c258e43c8
2016-10-04 16:49:55 +08:00
Wes Kocher 13054d32fc Backed out changeset 003ec40aa484 (bug 1227638) for android Cpp failures a=backout 2016-10-17 15:08:41 -07:00
David Keeler ec181af1f7 bug 1227638 - deterministically load EV information r=Cykesiopka,mgoodwin
Previously PSM would load EV information on-demand (i.e. just before verifying a
certificate). This simplifies this operation, removes a dubious optimization
(loading the EV information on another thread while opening a network
connection), and relocates the loading operation to when we are likely to have
good disk locality (i.e. when we've just loaded the built-in roots module).

This also removes the now-unused MOZ_NO_EV_CERTS build flag.

MozReview-Commit-ID: 8Rnl4ozF95V

--HG--
extra : rebase_source : 344b68c81af1ed3fb038e4e96c3c50e939d32c3d
2016-09-30 18:08:08 -07:00
Cykesiopka a5b764f858 Bug 495357 - Update some documentation concerning SaveIntermediateCerts(). r=kaie,me
Original patch by Wan-Teh Chang.

MozReview-Commit-ID: 3ElvC7DanYJ
2016-10-11 19:39:00 +02:00
Sergei Chernov 976d5c3f1d Bug 1293231 - Certificate Transparency - basic telemetry reports; r=Cykesiopka,keeler
MozReview-Commit-ID: EGvuZADObJo

--HG--
extra : rebase_source : 9a059c9f8e2fdf9bfc693b0b5649808b1beeb67b
2016-08-11 13:41:50 +03:00
David Keeler b1cb7643ef bug 1302140 - add policy to disable SHA-1 except for certificates issued by non-built-in CAs r=jcj,rbarnes
MozReview-Commit-ID: 2uwHPxk0VhZ

--HG--
extra : rebase_source : 1c7b5d2559139fa8286342decf4e4f7c83317e29
2016-09-14 15:11:15 -07:00
Sebastian Hengst d8888f81d1 Backed out changeset 2df66e8b7411 (bug 1302140) for Windows build bustage in CertVerifier.cpp. r=backout on a CLOSED TREE 2016-09-21 20:47:08 +02:00
David Keeler d374bc442a bug 1302140 - add policy to disable SHA-1 except for certificates issued by non-built-in CAs r=jcj,rbarnes
MozReview-Commit-ID: 2uwHPxk0VhZ

--HG--
extra : rebase_source : 5b1342abc2eb260ec91464b3a1d331baf8968460
2016-09-14 15:11:15 -07:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Cykesiopka 2c9b1285df Bug 1289455 - Obviate manual CERT_DestroyCertificate() calls in PSM. r=dkeeler
MozReview-Commit-ID: Aoi1VWvkNjp

--HG--
extra : transplant_source : B%8F9%E7%E8%84%7D%D1%7B%5Due%ED%9A%E8%DE%05%5B%E2D
2016-08-05 23:57:44 +08:00
Sergei Chernov edb1f658f6 Bug 1275238 - Certificate Transparency support in mozilla::pkix; r=keeler
MozReview-Commit-ID: HZwzSgxarTw

--HG--
extra : transplant_source : %BF%F9%A8T%C6x%82%03%3Ez%9F%3BT%E3%1B%11s%294%F4
2016-06-15 11:11:00 +03:00
David Keeler baead5135e bug 1277240 - don't import trust anchors in SaveIntermediateCerts r=Cykesiopka
MozReview-Commit-ID: KHwA2LJSeUS

--HG--
extra : rebase_source : e1f7a469d2dc8608adf4b0172f99d9adb192bbb5
2016-06-02 13:17:14 -07:00
Cykesiopka 0b04616a47 Bug 1271496 - Stop using Scoped.h in non-exported PSM code. r=keeler
Scoped.h is deprecated in favour of the standardised UniquePtr.

This patch removes use of Scoped.h everywhere in PSM except ScopedNSSTypes.h,
which is exported. Other consumers of ScopedNSSTypes.h can move off Scoped.h
at their own pace.

This patch also changes parameters and return types of various functions to make
ownership more explicit.

MozReview-Commit-ID: BFbtCDjENzy

--HG--
extra : transplant_source : %0B%C7%9F%40%FA9%A4%F2%5E%0D%92%1C%A6%A49%94%C3%7E%1Cz
2016-05-23 19:50:26 -07:00
Cykesiopka 1d22abcec2 Bug 1271953 - Remove nss_addEscape(). r=mgoodwin
The function basically duplicates existing Mozilla string class functionality.

MozReview-Commit-ID: 9IFEXuT9cW1

--HG--
extra : rebase_source : 0d0c4492a63f7a168b6092fdb2e1bf8ec09d5308
2016-05-16 09:04:09 -07:00
Cykesiopka 6b12fc8650 Bug 1271501 - Use mozilla::BitwiseCast instead of reinterpret_cast in PSM. r=keeler
mozilla::BitwiseCast does the same thing, but provides static asserts that
mitigate some of the risk of using reinterpret_cast.

MozReview-Commit-ID: ENQ8QC6Nl9o

--HG--
extra : rebase_source : c1725c8363c0f7f9877601de5ab5f152ef4d0439
2016-05-18 21:20:56 -07:00
David Keeler c17f3a2733 bug 982932 - only allow Netscape-stepUp to be used for serverAuth for old CA certificates r=Cykesiopka,jcj
MozReview-Commit-ID: 88JhIU1pUji

--HG--
rename : security/manager/ssl/tests/unit/test_cert_eku/ee-int-nsSGC.pem.certspec => security/manager/ssl/tests/unit/test_cert_eku/ee-int-nsSGC-recent.pem.certspec
rename : security/manager/ssl/tests/unit/test_cert_eku/int-nsSGC.pem.certspec => security/manager/ssl/tests/unit/test_cert_eku/int-nsSGC-recent.pem.certspec
extra : rebase_source : 2f6251679a6f31cccb6d88bb51c567de9cc9bc76
2016-05-05 16:11:11 -07:00
Cykesiopka 8f7bebaa5c Bug 160122 - Stop using PR_smprintf in PSM. r=keeler
The (more) modern Mozilla string classes can be used instead, which at the very
least provide built in automatic memory management and performance improvements.

MozReview-Commit-ID: 4l2Er5rkeI0

--HG--
extra : transplant_source : %A1%16%AB%02m%CA%25HfW%40%96Mq%0D%F0%91%9C%99%29
2016-05-10 23:38:55 -07:00
Cykesiopka 391584fd9d Bug 1270005 - Replace uses of ScopedPK11SlotInfo with UniquePK11SlotInfo in PSM. r=keeler
ScopedPK11SlotInfo is based on Scoped.h, which is deprecated in favour of the
standardised UniquePtr.

Also changes PK11SlotInfo parameters of various functions to make ownership more
explicit, and replaces some manual management of PK11SlotInfo pointers.

MozReview-Commit-ID: JtNH2lJsjwx

--HG--
extra : rebase_source : 9d764e0dd3a1f2df14c16f8f14a3c5392770c9a1
2016-05-09 18:02:40 -07:00
Cykesiopka 128f004a1f Bug 1267905 - Replace uses of ScopedCERTCertList with UniqueCERTCertList. r=keeler
ScopedCERTCertList is based on Scoped.h, which is deprecated in favour of the
standardised UniquePtr.

Also changes CERTCertList parameters of various functions to make ownership more
explicit.

MozReview-Commit-ID: EXqxTK6inqy

--HG--
extra : transplant_source : %9B%A9a%94%D1%7E%2BTa%9E%9Fu%9F%02%B3%1AT%1B%F1%F6
2016-05-05 14:56:36 -07:00
Cykesiopka 372fe1a598 Bug 1260643 - Convert most uses of ScopedCERTCertificate in PSM to UniqueCERTCertificate. r=keeler
MozReview-Commit-ID: JnjoUd7d2M0

--HG--
extra : transplant_source : %99x%B6%F5%09%97%E6%60%B6%3C%3C%C2%D5vt%27%0C-%96%1B
2016-04-20 01:14:22 -07:00
Mark Goodwin 23e56a0fd2 Bug 1252882 - Add a Content Signature Service r=keeler,r=franziskus,r=Cykesiopka
MozReview-Commit-ID: 2nS6vN3iDKe
2016-04-13 13:26:01 +01:00
Cykesiopka b883b2533f Bug 1259909 - Obviate char PORT_Free() calls in PSM. r=keeler
Also converts the longer |UniquePtr<char, void(&)(void*)> foo(..., PORT_Free)|
to the shorter and equivalent |UniquePORTString foo(...)|.

MozReview-Commit-ID: LlrTNUYBP4V

--HG--
extra : transplant_source : afU%FB%0EC%3E%E0pm%A3-%0E%C8%83%CF%0A%B1%9E%ED
2016-04-09 01:03:59 -07:00
Cykesiopka efe5b47ede Bug 1260644 - Use UniquePLArenaPool to manage PLArenaPools in PSM. r=keeler
MozReview-Commit-ID: HyLXbWoHMGz

--HG--
extra : rebase_source : 6164b7df51e11c4d3814a06bd41765d40be85a9d
2016-04-04 17:35:24 -07:00
Cykesiopka bdfc5290f6 Bug 1004149 - Return mozilla::pkix::Result values in nsNSSHttpInterface functions. r=keeler
MozReview-Commit-ID: Kx1E3HLP7zC

--HG--
extra : transplant_source : %F0%068%83%E21dM-%FE%7C%EC1%1E%05h%E6%1D%271
2016-03-18 21:11:03 -07:00
David Keeler 2f0004e1be bug 1228175 - fix IsCertBuiltInRoot r=Cykesiopka,mgoodwin
When a built-in root certificate has its trust changed from the default value,
the platform has to essentially create a copy of it in the read/write
certificate database with the new trust settings. At that point, the desired
behavior is that the platform still considers that certificate a built-in root.
Before this patch, this would indeed happen for the duration of that run of the
platform, but as soon as it restarted, the certificate in question would only
appear to be from the read/write database, and thus was not considered a
built-in root. This patch changes the test of built-in-ness to explicitly
search the built-in certificate slot for the certificate in question. If found,
it is considered a built-in root.

MozReview-Commit-ID: HCtZpPQVEGZ

--HG--
extra : rebase_source : 759e9c5a7bb14f14a77e62eae2ba40c085f04ccd
2016-03-04 17:06:33 -08:00