Bug 1030135: Set is_moz if the pinset name contains mozilla, set bucket id for pinsets containing the string mozilla (r=keeler)
authorMonica Chew <mmc@mozilla.com>
Thu, 02 Oct 2014 16:45:13 -0700
changeset 208761 086b51f4ba0b61befd338d38aae0ad5de0504848
parent 208760 9ce49a02b32fca0810c5a9043cdaf08de39f51f8
child 208762 929d78de0f8a7ea4d0e0e2d9e91e363ec2aadd4b
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerskeeler
bugs1030135
milestone35.0a1
Bug 1030135: Set is_moz if the pinset name contains mozilla, set bucket id for pinsets containing the string mozilla (r=keeler)
security/manager/tools/PreloadedHPKPins.json
security/manager/tools/genHPKPStaticPins.js
--- a/security/manager/tools/PreloadedHPKPins.json
+++ b/security/manager/tools/PreloadedHPKPins.json
@@ -215,17 +215,17 @@
       "pins": "mozilla_services", "test_mode": false, "id": 5 },
     { "name": "cdn.mozilla.net", "include_subdomains": true,
       "pins": "mozilla", "test_mode": false },
     { "name": "cdn.mozilla.org", "include_subdomains": true,
       "pins": "mozilla", "test_mode": false },
     { "name": "media.mozilla.com", "include_subdomains": true,
       "pins": "mozilla", "test_mode": false },
     { "name": "services.mozilla.com", "include_subdomains": true,
-      "pins": "mozilla_services", "test_mode": true },
+      "pins": "mozilla_services", "test_mode": true, "id": 6 },
     { "name": "include-subdomains.pinning.example.com",
       "include_subdomains": true, "pins": "mozilla_test",
       "test_mode": false },
     // Example domain to collect per-host stats for telemetry tests.
     { "name": "exclude-subdomains.pinning.example.com",
       "include_subdomains": false, "pins": "mozilla_test",
       "test_mode": false, "id": 0 },
     { "name": "test-mode.pinning.example.com", "include_subdomains": true,
--- a/security/manager/tools/genHPKPStaticPins.js
+++ b/security/manager/tools/genHPKPStaticPins.js
@@ -455,17 +455,18 @@ function writeEntry(entry) {
   if (entry.hasOwnProperty("test_mode")) {
     testMode = entry.test_mode;
   }
   if (testMode) {
     printVal += "true, ";
   } else {
     printVal += "false, ";
   }
-  if (entry.is_moz || (entry.pins == "mozilla")) {
+  if (entry.is_moz || (entry.pins.indexOf("mozilla") != -1 &&
+                       entry.pins != "mozilla_test")) {
     printVal += "true, ";
   } else {
     printVal += "false, ";
   }
   if (entry.id >= 256) {
     throw("Not enough buckets in histogram");
   }
   if (entry.id >= 0) {