Commit Graph
136 Commits
Author SHA1 Message Date
David Keeler 614510b526 bug 1401796 - fix HSTS preload script to keep preexisting hosts if there was a connection error r=jcj DONTBUILD NPOTB
Bug 1255425 changed an 'of' to an 'in', which caused the code that would keep
preexisting entries on the preload list if there was a connection error to loop
over the indices in the array and not the values themselves. Thanks, JavaScript.

MozReview-Commit-ID: DvVWhpImp8n
2017-09-25 11:00:21 -07:00
Ryan VanderMeulen 8bd764656b Backed out changeset 121e4d470c11 (bug 1391703) for breaking periodic HSTS/HPKP updates. 2017-08-25 10:16:27 -04:00
Cykesiopka 66eba1cec9 Bug 1391703 - Introduce common JSM for security/manager/tools/ scripts. r=keeler
PSM has various xpcshell scripts under the security/manager/tools/ folder. At
the moment, these scripts:
  1. Duplicate code.
  2. Aren't testable.

This patch introduces a common, unit tested JSM that these scripts can use.

MozReview-Commit-ID: 5NKRUeJgG8f
2017-08-23 14:46:37 +08:00
Eric Rahm ff56fd077d Bug 1382001 - Part 2: Use a DAFSA for kSTSPreloadList. r=keeler
This switches the STS preload list over to a more compact representation by
using a DAFSA. `getHSTSPreloadList.js` is updated to output data in the gperf
format expected by `make_dafsa.py`. We then add a generated file that gets
created by pumping `nsSTSPreloadList.inc` through `make_dafsa.py`.

`nsSiteSecurityService` is updated to use the DAFSA which either returns -1
(kNotFound) if an entry is not present or (0, 1) indicating whether or not to
use subdomains.

`nsSTSPreloadList.inc` is an automated conversion to the new gperf-like format.
2017-08-11 14:12:04 -07:00
Wes Kocher 5662a0562f Backed out 3 changesets (bug 1382001) at developer's request a=backout
Backed out changeset 1fe47b777980 (bug 1382001)
Backed out changeset bd6770fadff3 (bug 1382001)
Backed out changeset 29353fb6613b (bug 1382001)

MozReview-Commit-ID: F4S2q5WAxe4
2017-08-10 18:03:05 -07:00
Eric Rahm d89b279acd Bug 1382001 - Part 3: Fix eslint. r=me
MozReview-Commit-ID: 2RdpKeV7OL2
2017-08-10 17:51:23 -07:00
Eric Rahm 7c42f46fb4 Bug 1382001 - Part 2: Use a DAFSA for kSTSPreloadList. r=keeler
This switches the STS preload list over to a more compact representation by
using a DAFSA. `getHSTSPreloadList.js` is updated to output data in the gperf
format expected by `make_dafsa.py`. We then add a generated file that gets
created by pumping `nsSTSPreloadList.inc` through `make_dafsa.py`.

`nsSiteSecurityService` is updated to use the DAFSA which either returns -1
(kNotFound) if an entry is not present or (0, 1) indicating whether or not to
use subdomains.

`nsSTSPreloadList.inc` is an automated conversion to the new gperf-like format.
2017-08-10 17:29:11 -07:00
Cykesiopka 8d34e6f164 Bug 1388088 - Fix incorrect Cu.import() URL to unbreak HSTS periodic updates. r=keeler
The preload script currently imports XPCOMUtils.jsm like so:
> Cu.import("resource:///modules/XPCOMUtils.jsm");

As explained in Bug 1383215 comments [21, 24], this has been incorrect for
years, but happened to work.

The import URL is changed so it points at the correct thing now:
> Cu.import("resource://gre/modules/XPCOMUtils.jsm");

MozReview-Commit-ID: J6j594sJs60
2017-08-08 00:44:02 +08:00
Cykesiopka 2cb6293a05 Bug 1387853 - Update Google roots in PreloadedHPKPins.json to fix periodic Static HPKP updates. r=keeler
Some entries in the existing list referred to roots that were removed from in
upstream NSS in Bug 1380941 (the equivalent change landed in Firefox's copy of
NSS in Bug 1370890). This broke the periodic HPKP script because it would still
try to find the roots within our built-in roots.

Running dumpGoogleRoots.js and pasting the output into the appropriate section
of PreloadedHPKPins.json fixes this.

MozReview-Commit-ID: Ck6WobCk9gl
2017-08-08 07:38:23 +08:00
Masatoshi Kimura 0af76969af Bug 1375125 - Stop using nsILocalFile in the tree. r=froydnj
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.

MozReview-Commit-ID: 4ecl3RZhOwC
2017-08-04 17:49:22 +09:00
David Keeler 78410afcc2 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
2017-08-03 16:17:11 -07:00
Nathan Froyd 8335babfc9 Bug 1372670 - part 3 - add spinEventLoopUntil to nsIThreadManager; r=erahm,florian 2017-06-21 12:59:28 -04:00
Kate McKinley 8335b9a82e Bug 1363546 - Store and report HSTS upgrade source r=francois,keeler,mayhemer p=francois
Add a field to the HSTS cache which indicates the source of the HSTS
entry if known, from the preload list, organically seen header, or HSTS
priming, or unknown otherwise. Also adds telemetry to collect the source
when upgrading in NS_ShouldSecureUpgrade.

MozReview-Commit-ID: 3IwyYe3Cn73
2017-05-23 15:31:37 -07:00
David Keeler 58a0201d3e bug 1349312 - part 1/2: patch CT implementation to include debug-only test logs r=Cykesiopka,jcj
MozReview-Commit-ID: Gay4bliuiDc

This modifies getCTKnownLogs.py to inject 3 debug-only Certificate Transparency
log keys and 2 organizations ("Mozilla Test Org 1" and "2") for use with
integration tests. Also updates CTKnownLogs.h as generated by the python script.

The debug logs use the "default", "secp256r1", and "alternate" keys that are
already present in our testing infrastructure (see pykey.py).
2017-04-19 14:02:26 -07:00
David Keeler 44b297ed96 bug 1356499 - put NCSCCS pins into production mode r=mgoodwin
As requested by James Burton<[email protected]> and vouched for (via email) by
Lucas Garron <[email protected]>.

MozReview-Commit-ID: HD9laXzJpRg
2017-04-25 14:33:07 -07:00
Franziskus Kiefer 1bb1d92d05 Bug 1345368 - root hashes follow-up 2017-04-13 10:42:05 +02:00
Franziskus Kiefer 85f31a7ad5 Bug 1345368 - land NSS 7228445b43ac, r=me 2017-04-10 06:00:57 +02:00
Mark Banner 7945b07153 Bug 1342459 - Enable no-undef on browser/base, and clean up unnecessary no-undef references. r=mossop
MozReview-Commit-ID: KVrAnAjMD1E
2017-04-03 11:46:56 +01:00
Cykesiopka 9e9b4824a1 Bug 1350868 - Make HSTS preload script preload test domains for use in tests. r=keeler
This lets us migrate off depending on real preloaded domains and onto
domains that are guaranteed to have the correct characteristics.

MozReview-Commit-ID: 4TyOfdIA9I7
2017-03-29 07:21:01 +08:00
Cykesiopka d490973d2b Bug 1319252 - Remove nsIX509Cert.getAllTokenNames(). r=keeler,mossop
nsIX509Cert.getAllTokenNames() is only used (improperly) to determine if a
certificate is a built-in. nsIX509Cert.isBuiltInRoot should be used instead.

MozReview-Commit-ID: LBwI8nTc05C
2017-03-19 16:02:26 +08:00
Sam Foster 56364d223b Bug 1344308 - Extend toolkit's eslint rules and fix lint errors in PSM r=jaws
* Remove eslint rules for PSM which are redundant with toolkit/.eslintrc.js
* Fix missing plugins block in mochitest.eslintrc.js
* Disable brace-style checking in mixed-content mochitests which use boilerplate where calls to runTest and afterNavigationTest all use opening brace on newline. I've left this for a follow-up.
* Fix lint errors resulting from new rules defined by toolkit's eslintrc.js

MozReview-Commit-ID: EepCLrzAsdM
2017-03-07 10:15:49 -08:00
Jonathan Hao b00c3630c6 Bug 1323644 - Isolate the HSTS and HPKP storage by first party domain (PSM) r=Cykesiopka,keeler
MozReview-Commit-ID: HhFFqtpBNjO
2017-02-14 10:29:10 +08:00
David Major c93b8c136b Bug 1335294: Remove const from data tables under security/ for better codegen on Windows. r=keeler
MozReview-Commit-ID: 3k1Gpm0ugY2
2017-02-13 09:41:20 +13:00
Cykesiopka e99d55a74b Bug 1331983 - Avoid non-smart string IDL types in nsIX509CertDB.idl. r=gcp,keeler,nwgh
Smart string classes like nsCString are safer to use than raw |char*| strings,
and are typically easier to deal with as well.

MozReview-Commit-ID: 2PdrCa6cbpe
2017-02-09 23:11:29 +08:00
Phil Ringnalda c71c5d0871 Merge m-c to a CLOSED TREE autoland 2017-02-01 20:42:06 -08:00
Phil Ringnalda 9854db1db2 Backed out changeset b03c9f4ac1b0 (bug 1335294) for Windows PGO bustage
CLOSED TREE
2017-02-01 19:17:21 -08:00
David Major 4f2b90c05d Bug 1335294: Add constexpr to data tables under security/ for better codegen on Windows. r=keeler
MozReview-Commit-ID: 3OMBGfLKP9I
2017-02-01 14:59:57 +13:00
J.C. Jones 9aece17c3b Bug 1335466 - Regenerate the CA RootHashes.inc r=keeler
This is a maintenance re-run since Firefox 50, to include new roots.

MozReview-Commit-ID: HSs2P6S65A7
2017-02-01 16:45:07 -07:00
Cykesiopka 76ae0bbf79 Bug 1329248 - Enable 26 more ESLint rules for PSM. r=mgoodwin
The "no-mixed-spaces-and-tabs" rule is also disabled since there's no point
having it enabled when the "no-tabs" rule is also enabled.

MozReview-Commit-ID: 49addnnmmvf
2017-01-14 13:18:03 +08:00
Florian Quèze 6459975a67 Bug 1329182 - remove trailing newURI null parameters in the rest of the tree, r=jaws. 2017-01-09 20:27:26 +01:00
Cykesiopka 702c39b3be Bug 1324184 - Enable "no-tabs", "no-template-curly-in-string" and "quotes" ESLint rules for PSM. r=keeler
Also sorts the rule list alphabetically.

MozReview-Commit-ID: 9LwgwfiViom
2016-12-21 00:43:17 +08:00
David Keeler 0cad676aa4 bug 857627 - 2/4: remove nsIX509Cert.nickname r=Cykesiopka,jcj
In general, any code that was using nsIX509Cert.nickname should be able to use
the attribute displayName (if using nickname for display purposes) or the
attribute dbKey (if using nickname as a unique identifier for a certificate).

MozReview-Commit-ID: G9CfMJDfLqe
2016-11-18 13:12:29 -08:00
Sergei Chernov f507518bbf Bug 1317951, part 2 - Certificate Transparency - basic support for disqualified logs. r=keeler
MozReview-Commit-ID: 4y2JYFnO9Xm
2016-11-29 22:51:46 +02:00
Julien Vehent 172b2851ad bug 1301956 - add more Mozilla resources to preloaded pins r=keeler,rbarnes DONTBUILD NPOTB
Also trims the pinset for said Mozilla resources to just DigiCert and Let's
Encrypt (as a backup).
2016-11-29 13:15:32 -08:00
Sergei Chernov bb2e3bd410 Bug 1308787 - Certificate Transparency - script for generating the static list of known logs. r=Cykesiopka,keeler
MozReview-Commit-ID: 9z7Ac5OQqOP
2016-11-08 13:54:39 +02:00
Mark Banner 233309fbe2 Bug 1251003 - Change .eslintrc files to .eslintrc.js to avoid obsolete config file format. r=mossop
MozReview-Commit-ID: JrbFxQ5rj6I
2016-10-18 08:38:10 +01:00
David Keeler 057bec9813 bug 1282008 - update CNNIC whitelist to remove expired certificates r=rbarnes
MozReview-Commit-ID: 1OopsrAxXrv
2016-10-06 14:45:51 -07:00
Carsten "Tomcat" Book 9c3068b78c merge mozilla-inbound to mozilla-central a=merge 2016-09-08 12:01:17 +02:00
Thomas Wisniewski a1a4c002e4 Bug 918751 - Throw NetworkErrors instead of failures where appropriate for some XHR web platform tests. r=bz, r=keeler, r=Mossop, r=paul 2016-09-03 18:45:08 -04:00
David Keeler 302a6a8ceb bug 1300305 - update preloaded HPKP information to deal with "Equifax Secure CA" removal DONTBUILD NPOTB r=Cykesiopka
The root with the nickname "Equifax Secure CA" was removed from NSS in bug
1296689 (confusingly, "Equifax Secure CA" doesn't appear in the subject DN of
that certificate, which is "OU=Equifax Secure Certificate
Authority,O=Equifax,C=US"). This removes the dependency on that root as well as
fixes dumpGoogleRoots.js to automatically handle this sort of thing in the
future.

MozReview-Commit-ID: KIEPBnliufX
2016-09-06 10:45:48 -07:00
David Keeler edc5ae373b bug 1298056 - fix HSTS preload update script so it will continue when requests result in errors r=jcj DONTBUILD NPOTB a=KWierso
MozReview-Commit-ID: b697Aa4iqQ
2016-08-26 14:18:39 -07:00
Thomas Wisniewski a23b5fbd86 Bug 709991 - Fire onerror instead of throwing on network errors for async XHRs. r=bz 2016-07-30 00:24:56 -04:00
Cykesiopka c4adadea47 Bug 1280331 - Update HPKP preload script URL to deal with renaming of transport_security_state_static.certs. r=keeler
https://chromium.googlesource.com/chromium/src/net/+/4361f2ad66b6af0a8acfb42f34b95bfbcad3926a
renamed transport_security_state_static.certs to
transport_security_state_static.pins, so the URL needs to be updated to avoid
a 404.

MozReview-Commit-ID: 1FmYdi0mMcI
2016-06-21 16:11:57 -07:00
David Keeler f7bdcad952 bug 1266563 - regenerate CA telemetry hash table r=jcj
MozReview-Commit-ID: 1NXDU2ejfzl
2016-06-03 16:12:38 -07:00
Nathan Froyd ce69e56e22 Bug 1255425 - part 2 - pack kSTSPreloadList into a more efficient format; r=keeler
Entries in kSTSPreloadList currently look like:

class nsSTSPreload
{
  public:
    const char *mHost;
    const bool mIncludeSubdomains;
};

This is inefficient for a couple of reasons:

* The structure has a bunch of wasted space: it takes 8 bytes on 32-bit
  platforms and 16 bytes on 64-bit platforms, even though it only uses 5
  and 9 bytes, respectively.

* The |const char*| requires additional space in the form of relocations
  (at least on Linux/Android), which doubles the space cost of
  individual entries.  (The space cost of the relocations is mitigated
  somewhat on Linux and Android because of elfhack, but there's still
  extra cost in the on-disk format and during the load of libxul to
  process those relocations.)

* The relocations the structure requires means that the data in it can't
  be shared between processes, which is important for e10s with multiple
  content processes.

We can make it more efficient by structuring it like so:

static const char kSTSPreloadHosts[] = {
  // One giant character array containing the hosts, in order:
  //   "example.com\0example.org\0example.test\0..."
  // Use an array rather than a literal string due to compiler limitations.
};

struct nsSTSPreload
{
  // An index into kSTSPreloadHosts for the hostname.
  uint32_t mHostIndex: 31;
  // We use the same datatype for both members so that MSVC will pack
  // the bitfields into a single uint32_t.
  uint32_t mIncludeSubdomains: 1;
};

nsSTSPreload now has no wasted space and is significantly smaller,
especially on 64-bit platforms (saves ~29K on 32-bit platforms and ~85K
on 64-bit platforms).  This organization does add a couple extra
operations to searching for preload list entries, depending on your
platform, but the space savings make it worth it.
2016-03-24 15:09:28 -04:00
Nathan Froyd 0102478fd1 Bug 1255425 - part 1 - clearly delineate steps when outputting HSTS preload list; r=keeler
The main loop of |output| tweaks entries, filters out entries based on
some conditions, and writes out the actual entries we're going to use.
Let's separate those three steps so it's clearer what's happening where.
2016-03-11 15:35:47 -05:00
Cykesiopka 2f86602233 Bug 1253108 - Enable ESLint "strict" rule for PSM. r=keeler
MozReview-Commit-ID: 4wElZ8Guq9z
2016-03-19 03:07:13 -07:00
Cykesiopka 6c90f0c49c Bug 1251011 - Enable ESLint "no-undef" rule for PSM. r=keeler r=mossop
MozReview-Commit-ID: 1lbwWWkJjqq
2016-03-16 16:50:33 -07:00
Nicholas Nethercote 010738d0b0 Bug 1255655 - Const-ify kPinset_* arrays. r=cykesiopka. 2016-03-11 13:54:41 +11:00
Cykesiopka fe6f41d55e Bug 1253958 - Make getHSTSPreloadList.js and genHPKPStaticPins.js gracefully handle trailing whitespace in URL entries. r=dkeeler
MozReview-Commit-ID: Kyc7JzxVEo0
2016-03-06 16:02:52 -08:00