@blamejs/pki 0.8.59 → 0.8.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/lib/acme.js +15 -7
  3. package/lib/alt-sig.js +3 -1
  4. package/lib/asn1-der.js +82 -34
  5. package/lib/attrcert-sign.js +19 -16
  6. package/lib/byte-writer.js +63 -13
  7. package/lib/cbor-det.js +9 -3
  8. package/lib/cmc-build.js +26 -18
  9. package/lib/cmp-build.js +35 -33
  10. package/lib/cmp-session.js +19 -9
  11. package/lib/cms-decrypt.js +37 -23
  12. package/lib/cms-digest.js +2 -3
  13. package/lib/cms-encrypt.js +38 -33
  14. package/lib/cms-sign.js +65 -43
  15. package/lib/cms-verify.js +8 -4
  16. package/lib/composite-kem.js +28 -29
  17. package/lib/crl-sign.js +24 -17
  18. package/lib/crmf-sign.js +11 -17
  19. package/lib/csr-sign.js +5 -2
  20. package/lib/ct.js +38 -25
  21. package/lib/est.js +12 -9
  22. package/lib/guard-bytes.js +5 -1
  23. package/lib/guard-crypto.js +506 -14
  24. package/lib/guard-der.js +6 -1
  25. package/lib/guard-intrinsic.js +12 -4
  26. package/lib/guard-list.js +64 -0
  27. package/lib/guard-name.js +1 -1
  28. package/lib/guard-secret.js +3 -2
  29. package/lib/hpke.js +34 -27
  30. package/lib/http-digest.js +5 -7
  31. package/lib/http-transport.js +12 -3
  32. package/lib/inspect.js +10 -2
  33. package/lib/jose.js +3 -1
  34. package/lib/key.js +41 -29
  35. package/lib/lint.js +236 -152
  36. package/lib/mime.js +9 -5
  37. package/lib/ocsp.js +26 -24
  38. package/lib/path-validate.js +43 -13
  39. package/lib/pbes2.js +12 -9
  40. package/lib/pkcs11-uri.js +3 -1
  41. package/lib/pkcs12-build.js +19 -17
  42. package/lib/pki-build.js +17 -13
  43. package/lib/possession.js +3 -1
  44. package/lib/rc2.js +6 -2
  45. package/lib/revocation-fetch.js +78 -19
  46. package/lib/scep.js +21 -14
  47. package/lib/schema-attrcert.js +4 -2
  48. package/lib/schema-c509.js +94 -78
  49. package/lib/schema-cmc.js +5 -2
  50. package/lib/schema-cmp.js +6 -3
  51. package/lib/schema-cms.js +7 -4
  52. package/lib/schema-crl.js +1 -1
  53. package/lib/schema-crmf.js +1 -1
  54. package/lib/schema-csr.js +3 -3
  55. package/lib/schema-engine.js +36 -18
  56. package/lib/schema-pkcs1.js +7 -3
  57. package/lib/schema-pkcs12.js +9 -6
  58. package/lib/schema-pkix.js +19 -3
  59. package/lib/schema-sec1.js +4 -1
  60. package/lib/schema-tsp.js +7 -4
  61. package/lib/shbs.js +10 -9
  62. package/lib/sign-scheme.js +2 -2
  63. package/lib/sigstore.js +9 -9
  64. package/lib/smime.js +19 -16
  65. package/lib/tlog.js +20 -13
  66. package/lib/tuf.js +7 -4
  67. package/lib/validator-cose.js +2 -2
  68. package/lib/validator-keydesc.js +4 -1
  69. package/lib/validator-tls.js +7 -2
  70. package/lib/webauthn-mds.js +3 -7
  71. package/lib/webauthn.js +4 -11
  72. package/lib/webcrypto.js +70 -49
  73. package/lib/x509-sign.js +20 -15
  74. package/package.json +1 -1
  75. package/sbom.cdx.json +6 -6
package/lib/lint.js CHANGED
@@ -46,6 +46,13 @@ var path = require("./path-validate");
46
46
  var compositeSig = require("./composite-sig");
47
47
  var C = require("./constants");
48
48
  var ipUtils = require("./ip-utils");
49
+ var intrinsic = require("./guard-intrinsic");
50
+
51
+ /** @internal A store at an index runs a setter inherited from the prototype chain, which takes
52
+ * the element being appended, and this defines the index instead. The certificate, CSR and CRL
53
+ * signers read the findings below through `assertBuildClean` before they sign, so a finding that
54
+ * never lands is an artifact emitted past the check that exists to refuse it. */
55
+ var _push = guard.list.append;
49
56
 
50
57
  var MS_PER_DAY = C.TIME.days(1);
51
58
 
@@ -72,9 +79,42 @@ function _worst(findings) {
72
79
  return w;
73
80
  }
74
81
 
82
+ /** @internal An own-property read and an own-property write, both taken when the module loads.
83
+ *
84
+ * A record built as an object literal carries `Object.prototype`, so assigning a field it holds no
85
+ * own slot for runs an inherited setter with the record as the receiver, and reading a field it does
86
+ * not own answers from the prototype. Both decide things here. The severity the signers' producer
87
+ * check refuses on lives on a finding: an inherited setter handed the finding can delete that
88
+ * severity, and an inherited getter can then supply one, which turns a refusal into a signature.
89
+ * Defining the slot consults no setter, and an own read answers only from the record itself. */
90
+ function _own(record, key) {
91
+ return record !== null && record !== undefined && intrinsic.hasOwn(record, key) ? record[key] : undefined;
92
+ }
93
+ function _define(record, key, value) {
94
+ intrinsic.defineProperty(record, key, { value: value, writable: true, enumerable: true, configurable: true });
95
+ }
96
+
97
+ /** @internal One of this module's own answers re-based on no prototype, so a key it does not carry
98
+ * reads as absent rather than from `Object.prototype`. Every consumer asks an answer for the key the
99
+ * other arm would have carried, and naming those keys in a list here would be one more thing to keep
100
+ * in step with the consumers: no prototype needs no list. These records never leave the module.
101
+ * Copied by own enumerable key, which is every key a literal defines. */
102
+ function _rebase(answer) {
103
+ var out = intrinsic.create(null);
104
+ if (answer === null || answer === undefined) return out;
105
+ var keys = intrinsic.keys(answer);
106
+ for (var i = 0; i < keys.length; i++) _define(out, keys[i], answer[keys[i]]);
107
+ return out;
108
+ }
109
+
75
110
  function _finding(rule, detail) {
76
111
  var f = { id: rule.id, severity: rule.severity, source: rule.source, citation: rule.citation, message: rule.message };
77
- if (detail && detail.context) f.context = detail.context;
112
+ if (detail !== null && detail !== undefined) {
113
+ /** @internal ONE read, tested and stored: read twice, the second read is a different value when
114
+ * the first ran a getter. */
115
+ var context = _own(detail, "context");
116
+ if (context) _define(f, "context", context);
117
+ }
78
118
  return f;
79
119
  }
80
120
 
@@ -97,15 +137,22 @@ function _derivedCert(o) {
97
137
  * since a caller can neuter the buffer between the check and the read. */
98
138
  function _derBytesOf(input) {
99
139
  if (!guard.bytes.isByteSource(input)) return null;
140
+ /** @internal No prototype, because the consumer asks this record for the key the other arm carries:
141
+ * a successful read is asked for `fatal` and a failed one for `der`. Carried on a plain literal,
142
+ * the key the arm does not hold answered from `Object.prototype`, so an inherited getter at `fatal`
143
+ * supplied a verdict for bytes that read correctly, and the producer check the signers run reads
144
+ * its severity off exactly that. */
145
+ var out = intrinsic.create(null);
100
146
  try {
101
- return { der: guard.bytes.snapshotSource(input, LintError, "lint/bad-input", "pki.lint input") };
147
+ _define(out, "der", guard.bytes.snapshotSource(input, LintError, "lint/bad-input", "pki.lint input"));
102
148
  } catch (e) {
103
149
  /** @internal A byte source whose backing buffer was detached is still a byte source, and it
104
150
  * fails at the door rather than at the parse. The data path answers with a verdict either
105
151
  * way, or one neutered buffer aborts the scan of a whole corpus. */
106
- return { fatal: { id: "lint/unparseable", severity: "fatal", source: "engine", citation: "pki.lint",
107
- message: "input is a byte source whose bytes could not be read", context: { code: e.code } } };
152
+ _define(out, "fatal", { id: "lint/unparseable", severity: "fatal", source: "engine", citation: "pki.lint",
153
+ message: "input is a byte source whose bytes could not be read", context: { code: e.code } });
108
154
  }
155
+ return out;
109
156
  }
110
157
 
111
158
  function _ingest(input) {
@@ -182,13 +229,13 @@ function _runLints(rules, cert, ctx) {
182
229
  rules.forEach(function (rule) {
183
230
  if (rule.appliesTo && !rule.appliesTo(cert, ctx)) { counts.na++; return; }
184
231
  if (!_effective(rule, cert)) { counts.ne++; return; }
185
- ran.push(rule.id);
232
+ _push(ran, rule.id);
186
233
  var res = rule.check(cert, ctx);
187
234
  if (res == null || res === false) { counts.pass++; return; }
188
235
  var details = Array.isArray(res) ? res : [res];
189
236
  details.forEach(function (d) {
190
237
  var f = _finding(rule, d === true ? null : d);
191
- findings.push(f);
238
+ _push(findings, f);
192
239
  counts[f.severity] = (counts[f.severity] || 0) + 1;
193
240
  });
194
241
  });
@@ -233,7 +280,7 @@ function _sanDnsNames(ctx) {
233
280
  function _subjectAttributes(cert) {
234
281
  var out = [];
235
282
  ((cert.subject && cert.subject.rdns) || []).forEach(function (rdn) {
236
- rdn.forEach(function (a) { out.push(a); });
283
+ rdn.forEach(function (a) { _push(out, a); });
237
284
  });
238
285
  return out;
239
286
  }
@@ -242,7 +289,7 @@ function _subjectValuesOf(cert, name) {
242
289
  var dotted = oid.byName(name);
243
290
  var out = [];
244
291
  _subjectAttributes(cert).forEach(function (a) {
245
- if (a.type === dotted && typeof a.value === "string") out.push(a.value);
292
+ if (a.type === dotted && typeof a.value === "string") _push(out, a.value);
246
293
  });
247
294
  return out;
248
295
  }
@@ -387,7 +434,7 @@ var RFC5280_RULES = [
387
434
  (cert.extensions || []).forEach(function (e) {
388
435
  var fixed = CERT_FIXED_CRITICALITY[e.oid];
389
436
  if (fixed === undefined || fixed.critical !== false || e.critical !== true) return;
390
- rows.push({ context: { extension: e.name || e.oid, oid: e.oid, required: "non-critical", was: "critical", scope: "extensions", citation: fixed.citation } });
437
+ _push(rows, { context: { extension: e.name || e.oid, oid: e.oid, required: "non-critical", was: "critical", scope: "extensions", citation: fixed.citation } });
391
438
  });
392
439
  return rows.length ? rows : null;
393
440
  },
@@ -430,7 +477,7 @@ var RFC5280_RULES = [
430
477
  check: function (cert) {
431
478
  var out = [];
432
479
  (cert.extensions || []).forEach(function (e) {
433
- if (e.critical === true && _isUnknownExtension(e.oid)) out.push({ context: { oid: e.oid, name: e.name || null } });
480
+ if (e.critical === true && _isUnknownExtension(e.oid)) _push(out, { context: { oid: e.oid, name: e.name || null } });
434
481
  });
435
482
  return out.length ? out : null;
436
483
  },
@@ -451,7 +498,7 @@ var RFC5280_RULES = [
451
498
  if (!dec) return;
452
499
  try { dec(e.value); }
453
500
  catch (err) {
454
- out.push({ context: { oid: e.oid, name: e.name || null, code: err.code } });
501
+ _push(out, { context: { oid: e.oid, name: e.name || null, code: err.code } });
455
502
  }
456
503
  });
457
504
  return out.length ? out : null;
@@ -502,7 +549,7 @@ var RFC5280_RULES = [
502
549
  (cert.extensions || []).forEach(function (e) {
503
550
  var row = CERT_RECOMMENDED_NON_CRITICAL[e.oid];
504
551
  if (row === undefined || e.critical !== true) return;
505
- rows.push({ context: { extension: e.name || e.oid, oid: e.oid, recommended: "non-critical", was: "critical", citation: row } });
552
+ _push(rows, { context: { extension: e.name || e.oid, oid: e.oid, recommended: "non-critical", was: "critical", citation: row } });
506
553
  });
507
554
  return rows.length ? rows : null;
508
555
  },
@@ -523,8 +570,8 @@ var RFC5280_RULES = [
523
570
  message: "the certificate carries a unique identifier, which a conforming CA must not generate",
524
571
  check: function (cert) {
525
572
  var which = [];
526
- if (cert.issuerUniqueID) which.push("issuerUniqueID");
527
- if (cert.subjectUniqueID) which.push("subjectUniqueID");
573
+ if (cert.issuerUniqueID) _push(which, "issuerUniqueID");
574
+ if (cert.subjectUniqueID) _push(which, "subjectUniqueID");
528
575
  return which.length ? { context: { fields: which } } : null;
529
576
  },
530
577
  },
@@ -685,7 +732,7 @@ function _subjectIsEmpty(cert) {
685
732
  /** @internal Every policy qualifier of every PolicyInformation, as its qualifier OID. */
686
733
  function _policyQualifierIds(ctx) {
687
734
  var out = [];
688
- _eachPolicyQualifier(ctx, function (qid) { out.push(qid); });
735
+ _eachPolicyQualifier(ctx, function (qid) { _push(out, qid); });
689
736
  return out;
690
737
  }
691
738
 
@@ -746,14 +793,14 @@ function _smimeKuNamedAnywhere(modes) {
746
793
  var out = [];
747
794
  modes.forEach(function (m) {
748
795
  m.required.concat(m.optional).forEach(function (bit) {
749
- if (out.indexOf(bit) === -1) out.push(bit);
796
+ if (out.indexOf(bit) === -1) _push(out, bit);
750
797
  });
751
798
  });
752
799
  return out;
753
800
  }
754
801
  function _smimeKuAsserted(value) {
755
802
  var out = [];
756
- KU_BIT_NAMES.forEach(function (bit) { if (value[bit] === true) out.push(bit); });
803
+ KU_BIT_NAMES.forEach(function (bit) { if (value[bit] === true) _push(out, bit); });
757
804
  return out;
758
805
  }
759
806
  /** @internal Whether the asserted bits are exactly some mode: every bit that mode requires, and no
@@ -912,7 +959,7 @@ function _csAiaLocations(ctx) {
912
959
  var ad = d.value[i];
913
960
  if (CS_AIA_METHODS.indexOf(ad.accessMethod) === -1) continue;
914
961
  var loc = ad.accessLocation;
915
- out.push(loc && loc.tag === 6 && typeof loc.value === "string" ? loc.value : null);
962
+ _push(out, loc && loc.tag === 6 && typeof loc.value === "string" ? loc.value : null);
916
963
  }
917
964
  return out;
918
965
  }
@@ -1046,7 +1093,7 @@ function _smimeAiaLocationsByMethod(ctx) {
1046
1093
  /** @internal A location that is not a uniformResourceIdentifier carries no scheme, so it is
1047
1094
  * kept as null rather than dropped: the method is still provided and still has no HTTP URI. */
1048
1095
  var loc = ad.accessLocation;
1049
- out[ad.accessMethod].push(loc && loc.tag === 6 && typeof loc.value === "string" ? loc.value : null);
1096
+ _push(out[ad.accessMethod], loc && loc.tag === 6 && typeof loc.value === "string" ? loc.value : null);
1050
1097
  }
1051
1098
  return out;
1052
1099
  }
@@ -1059,7 +1106,7 @@ function _crldpUris(ctx) {
1059
1106
  if (!point || point.kind !== "fullName" || !Array.isArray(point.names)) return;
1060
1107
  point.names.forEach(function (raw) {
1061
1108
  var u = _generalNameUri(raw);
1062
- if (u !== null) out.push(u);
1109
+ if (u !== null) _push(out, u);
1063
1110
  });
1064
1111
  });
1065
1112
  return out;
@@ -1209,11 +1256,11 @@ var CABF_SMIME_RULES = [
1209
1256
  var out = [];
1210
1257
  KU_BIT_NAMES.forEach(function (bit) {
1211
1258
  if (d.value[bit] === true && named.indexOf(bit) === -1) {
1212
- out.push({ context: { keyUsage: bit, keyAlgorithm: kind } });
1259
+ _push(out, { context: { keyUsage: bit, keyAlgorithm: kind } });
1213
1260
  }
1214
1261
  });
1215
1262
  if (d.value.reservedBitsSet === true) {
1216
- out.push({ context: { reservedBitSet: true, keyAlgorithm: kind } });
1263
+ _push(out, { context: { reservedBitSet: true, keyAlgorithm: kind } });
1217
1264
  }
1218
1265
  return out.length ? out : null;
1219
1266
  },
@@ -1263,7 +1310,7 @@ var CABF_SMIME_RULES = [
1263
1310
  if (!d || !Array.isArray(d.value)) return null;
1264
1311
  var out = [];
1265
1312
  SMIME_FORBIDDEN_EKU.forEach(function (e) {
1266
- if (d.value.indexOf(e.oid) !== -1) out.push({ context: { keyPurpose: e.name, oid: e.oid } });
1313
+ if (d.value.indexOf(e.oid) !== -1) _push(out, { context: { keyPurpose: e.name, oid: e.oid } });
1267
1314
  });
1268
1315
  return out.length ? out : null;
1269
1316
  },
@@ -1375,7 +1422,7 @@ var CABF_SMIME_RULES = [
1375
1422
  void 0;
1376
1423
  }
1377
1424
  if (!_isHttpOrHttpsUrl(uri)) {
1378
- out.push({ context: { policyIdentifier: pi.policyIdentifier, cps: uri } });
1425
+ _push(out, { context: { policyIdentifier: pi.policyIdentifier, cps: uri } });
1379
1426
  }
1380
1427
  });
1381
1428
  return out.length ? out : null;
@@ -1392,7 +1439,7 @@ var CABF_SMIME_RULES = [
1392
1439
  _eachPolicyQualifier(ctx, function (qid, value, pi) {
1393
1440
  if (qid !== OID_UNOTICE) return;
1394
1441
  var carries = pkix.userNoticeTexts(value).some(function (t) { return t.field === "explicitText"; });
1395
- if (!carries) out.push({ context: { policyIdentifier: pi.policyIdentifier } });
1442
+ if (!carries) _push(out, { context: { policyIdentifier: pi.policyIdentifier } });
1396
1443
  });
1397
1444
  return out.length ? out : null;
1398
1445
  },
@@ -1409,7 +1456,7 @@ var CABF_SMIME_RULES = [
1409
1456
  /** @internal NoticeReference requires its organization DisplayText, which userNoticeTexts
1410
1457
  * surfaces under that field name, so the field's presence is the noticeRef's presence. */
1411
1458
  var carries = pkix.userNoticeTexts(value).some(function (t) { return t.field === "organization"; });
1412
- if (carries) out.push({ context: { policyIdentifier: pi.policyIdentifier } });
1459
+ if (carries) _push(out, { context: { policyIdentifier: pi.policyIdentifier } });
1413
1460
  });
1414
1461
  return out.length ? out : null;
1415
1462
  },
@@ -1459,7 +1506,7 @@ var CABF_SMIME_RULES = [
1459
1506
  var gen = _smimeGeneration(ctx);
1460
1507
  var out = [];
1461
1508
  function report(method, offending) {
1462
- out.push({ context: { generation: gen || "strict", accessMethod: oid.name(method) || method,
1509
+ _push(out, { context: { generation: gen || "strict", accessMethod: oid.name(method) || method,
1463
1510
  uris: offending.filter(function (u) { return u !== null; }),
1464
1511
  nonUriLocations: offending.filter(function (u) { return u === null; }).length } });
1465
1512
  }
@@ -1511,7 +1558,7 @@ var CABF_SMIME_RULES = [
1511
1558
  var out = [];
1512
1559
  ["authorityCertIssuer", "authorityCertSerialNumber"].forEach(function (f) {
1513
1560
  var v = d.value[f];
1514
- if (v !== null && v !== undefined) out.push({ context: { field: f } });
1561
+ if (v !== null && v !== undefined) _push(out, { context: { field: f } });
1515
1562
  });
1516
1563
  return out.length ? out : null;
1517
1564
  },
@@ -1559,7 +1606,7 @@ var CABF_SMIME_RULES = [
1559
1606
  var out = [];
1560
1607
  ["identifier", "role"].forEach(function (which) {
1561
1608
  if (_smimeLeiAdmits(type, which)) return;
1562
- if (ctx.raw(SMIME_LEI_EXTS[which])) out.push({ context: { certificateType: type, extension: which } });
1609
+ if (ctx.raw(SMIME_LEI_EXTS[which])) _push(out, { context: { certificateType: type, extension: which } });
1563
1610
  });
1564
1611
  return out.length ? out : null;
1565
1612
  },
@@ -1577,7 +1624,7 @@ var CABF_SMIME_RULES = [
1577
1624
  ["identifier", "role"].forEach(function (which) {
1578
1625
  if (!_smimeLeiAdmits(type, which)) return;
1579
1626
  var e = ctx.raw(SMIME_LEI_EXTS[which]);
1580
- if (e && e.critical === true) out.push({ context: { certificateType: type, extension: which } });
1627
+ if (e && e.critical === true) _push(out, { context: { certificateType: type, extension: which } });
1581
1628
  });
1582
1629
  return out.length ? out : null;
1583
1630
  },
@@ -1592,7 +1639,7 @@ var CABF_SMIME_RULES = [
1592
1639
  check: function (cert, ctx) {
1593
1640
  var out = [];
1594
1641
  SMIME_ADOBE_EXTS.forEach(function (name) {
1595
- if (ctx.raw(name)) out.push({ context: { extension: name } });
1642
+ if (ctx.raw(name)) _push(out, { context: { extension: name } });
1596
1643
  });
1597
1644
  return out.length ? out : null;
1598
1645
  },
@@ -1609,7 +1656,7 @@ var CABF_SMIME_RULES = [
1609
1656
  var out = [];
1610
1657
  SMIME_ADOBE_EXTS.forEach(function (name) {
1611
1658
  var e = ctx.raw(name);
1612
- if (e && e.critical === true) out.push({ context: { extension: name } });
1659
+ if (e && e.critical === true) _push(out, { context: { extension: name } });
1613
1660
  });
1614
1661
  return out.length ? out : null;
1615
1662
  },
@@ -1862,7 +1909,7 @@ var MOZILLA_RULES = [
1862
1909
  if (!d || !Array.isArray(d.value)) return { context: { reason: "no extKeyUsage extension" } };
1863
1910
  var out = [];
1864
1911
  ["serverAuth", "anyExtendedKeyUsage"].forEach(function (name) {
1865
- if (d.value.indexOf(oid.byName(name)) !== -1) out.push({ context: { purpose: name } });
1912
+ if (d.value.indexOf(oid.byName(name)) !== -1) _push(out, { context: { purpose: name } });
1866
1913
  });
1867
1914
  return out.length ? out : null;
1868
1915
  },
@@ -2062,7 +2109,7 @@ var CHROME_RULES = [
2062
2109
  var out = [];
2063
2110
  purposes.forEach(function (dotted) {
2064
2111
  if (CHROME_TLS_PURPOSES.indexOf(dotted) === -1) {
2065
- out.push({ context: { purpose: _chromePurposeLabel(dotted) } });
2112
+ _push(out, { context: { purpose: _chromePurposeLabel(dotted) } });
2066
2113
  }
2067
2114
  });
2068
2115
  return out.length ? out : null;
@@ -2114,7 +2161,7 @@ var CHROME_RULES = [
2114
2161
  var out = [];
2115
2162
  purposes.forEach(function (dotted) {
2116
2163
  if (dotted !== oid.byName("serverAuth")) {
2117
- out.push({ context: { purpose: _chromePurposeLabel(dotted) } });
2164
+ _push(out, { context: { purpose: _chromePurposeLabel(dotted) } });
2118
2165
  }
2119
2166
  });
2120
2167
  return out.length ? out : null;
@@ -2304,7 +2351,7 @@ var MICROSOFT_RULES = [
2304
2351
  if (!ku || !ku.value) return null;
2305
2352
  var out = [];
2306
2353
  ["keyCertSign", "cRLSign"].forEach(function (bit) {
2307
- if (ku.value[bit] !== true) out.push({ context: { bit: bit } });
2354
+ if (ku.value[bit] !== true) _push(out, { context: { bit: bit } });
2308
2355
  });
2309
2356
  return out.length ? out : null;
2310
2357
  },
@@ -2347,7 +2394,7 @@ var MICROSOFT_RULES = [
2347
2394
  var out = [];
2348
2395
  purposes.forEach(function (dotted) {
2349
2396
  if (MS_ENABLED_EKUS.indexOf(dotted) === -1) {
2350
- out.push({ context: { purpose: oid.name(dotted) || dotted } });
2397
+ _push(out, { context: { purpose: oid.name(dotted) || dotted } });
2351
2398
  }
2352
2399
  });
2353
2400
  return out.length ? out : null;
@@ -2406,7 +2453,7 @@ var MICROSOFT_RULES = [
2406
2453
  if (!_msNamesPurpose(ctx, "serverAuth")) return null;
2407
2454
  var out = [];
2408
2455
  ["emailProtection", "codeSigning", "timeStamping"].forEach(function (name) {
2409
- if (_msNamesPurpose(ctx, name)) out.push({ context: { purpose: name } });
2456
+ if (_msNamesPurpose(ctx, name)) _push(out, { context: { purpose: name } });
2410
2457
  });
2411
2458
  return out.length ? out : null;
2412
2459
  },
@@ -2457,7 +2504,7 @@ var MICROSOFT_RULES = [
2457
2504
  var signing = oid.byName("ocspSigning");
2458
2505
  var out = [];
2459
2506
  purposes.forEach(function (dotted) {
2460
- if (dotted !== signing) out.push({ context: { purpose: oid.name(dotted) || dotted } });
2507
+ if (dotted !== signing) _push(out, { context: { purpose: oid.name(dotted) || dotted } });
2461
2508
  });
2462
2509
  return out.length ? out : null;
2463
2510
  },
@@ -2559,7 +2606,7 @@ var APPLE_TRUST_PURPOSES = [
2559
2606
  var APPLE_PURPOSE_EKUS = [];
2560
2607
  APPLE_TRUST_PURPOSES.forEach(function (p) {
2561
2608
  p.ekus.forEach(function (d) {
2562
- if (APPLE_PURPOSE_EKUS.indexOf(d) === -1) APPLE_PURPOSE_EKUS.push(d);
2609
+ if (APPLE_PURPOSE_EKUS.indexOf(d) === -1) _push(APPLE_PURPOSE_EKUS, d);
2563
2610
  });
2564
2611
  });
2565
2612
  /** @internal Sec. 1.7 and the change log: an extended key usage extension and the prohibition on
@@ -2806,7 +2853,7 @@ function _qcSemanticsAll(ctx) {
2806
2853
  for (var i = 0; i < d.value.length; i++) {
2807
2854
  var st = d.value[i];
2808
2855
  if (st.statementId !== v1 && st.statementId !== v2) continue;
2809
- if (st.info && st.info.semanticsIdentifier) out.push(st.info);
2856
+ if (st.info && st.info.semanticsIdentifier) _push(out, st.info);
2810
2857
  }
2811
2858
  return out;
2812
2859
  }
@@ -2817,7 +2864,7 @@ function _qcStatementInfos(ctx, name) {
2817
2864
  if (!d || !Array.isArray(d.value)) return out;
2818
2865
  var dotted = oid.byName(name);
2819
2866
  for (var i = 0; i < d.value.length; i++) {
2820
- if (d.value[i].statementId === dotted) out.push(d.value[i].info === null ? {} : d.value[i].info);
2867
+ if (d.value[i].statementId === dotted) _push(out, d.value[i].info === null ? {} : d.value[i].info);
2821
2868
  }
2822
2869
  return out;
2823
2870
  }
@@ -2905,7 +2952,7 @@ var ETSI_QC_RULES = [
2905
2952
  _qcStatementInfos(ctx, "qcType").forEach(function (info) {
2906
2953
  if (!Array.isArray(info.types)) return;
2907
2954
  info.types.forEach(function (d) {
2908
- if (QC_TYPE_PURPOSES.indexOf(d) !== -1 && named.indexOf(d) === -1) named.push(d);
2955
+ if (QC_TYPE_PURPOSES.indexOf(d) !== -1 && named.indexOf(d) === -1) _push(named, d);
2909
2956
  });
2910
2957
  });
2911
2958
  return named.length > 1 ? { context: { purposes: named } } : null;
@@ -2925,7 +2972,7 @@ var ETSI_QC_RULES = [
2925
2972
  var https = info.locations.filter(function (l) {
2926
2973
  return pkiBuild.httpUrlScheme(l && l.url) === "https";
2927
2974
  });
2928
- if (!https.length) out.push({ context: { locations: info.locations.length } });
2975
+ if (!https.length) _push(out, { context: { locations: info.locations.length } });
2929
2976
  });
2930
2977
  return out.length ? out : null;
2931
2978
  },
@@ -2945,7 +2992,7 @@ var ETSI_QC_RULES = [
2945
2992
  return typeof l.language === "string" && l.language.toLowerCase() === "en";
2946
2993
  });
2947
2994
  if (!english.length) {
2948
- out.push({ context: { languages: info.locations.map(function (l) { return l.language; }) } });
2995
+ _push(out, { context: { languages: info.locations.map(function (l) { return l.language; }) } });
2949
2996
  }
2950
2997
  });
2951
2998
  return out.length ? out : null;
@@ -2965,7 +3012,7 @@ var ETSI_QC_RULES = [
2965
3012
  info.locations.forEach(function (l) {
2966
3013
  if (typeof l.language !== "string") return;
2967
3014
  var key = l.language.toLowerCase();
2968
- if (seen[key]) { out.push({ context: { language: l.language } }); return; }
3015
+ if (seen[key]) { _push(out, { context: { language: l.language } }); return; }
2969
3016
  seen[key] = true;
2970
3017
  });
2971
3018
  });
@@ -2988,7 +3035,7 @@ var ETSI_QC_RULES = [
2988
3035
  var out = [];
2989
3036
  _subjectValuesOf(cert, "serialNumber").forEach(function (v) {
2990
3037
  var parts = _qcIdentityParts(v);
2991
- if (!_qcKnownReference(parts, QC_NATURAL_TYPES)) out.push({ context: { serialNumber: v } });
3038
+ if (!_qcKnownReference(parts, QC_NATURAL_TYPES)) _push(out, { context: { serialNumber: v } });
2992
3039
  });
2993
3040
  return out.length ? out : null;
2994
3041
  },
@@ -3004,7 +3051,7 @@ var ETSI_QC_RULES = [
3004
3051
  _subjectValuesOf(cert, "serialNumber").forEach(function (v) {
3005
3052
  var parts = _qcIdentityParts(v);
3006
3053
  if (parts && !parts.local && parts.reference === QC_DEPRECATED_NATURAL_TYPE) {
3007
- out.push({ context: { serialNumber: v } });
3054
+ _push(out, { context: { serialNumber: v } });
3008
3055
  }
3009
3056
  });
3010
3057
  return out.length ? out : null;
@@ -3021,7 +3068,7 @@ var ETSI_QC_RULES = [
3021
3068
  var out = [];
3022
3069
  _subjectValuesOf(cert, "organizationIdentifier").forEach(function (v) {
3023
3070
  var parts = _qcIdentityParts(v);
3024
- if (!_qcKnownReference(parts, QC_LEGAL_TYPES)) out.push({ context: { organizationIdentifier: v } });
3071
+ if (!_qcKnownReference(parts, QC_LEGAL_TYPES)) _push(out, { context: { organizationIdentifier: v } });
3025
3072
  });
3026
3073
  return out.length ? out : null;
3027
3074
  },
@@ -3040,7 +3087,7 @@ var ETSI_QC_RULES = [
3040
3087
  _subjectValuesOf(cert, "organizationIdentifier").forEach(function (v) {
3041
3088
  var parts = _qcIdentityParts(v);
3042
3089
  if (!parts || parts.local || parts.reference !== "LEI") return;
3043
- if (parts.country !== QC_LEI_COUNTRY) out.push({ context: { country: parts.country } });
3090
+ if (parts.country !== QC_LEI_COUNTRY) _push(out, { context: { country: parts.country } });
3044
3091
  });
3045
3092
  return out.length ? out : null;
3046
3093
  },
@@ -3060,7 +3107,7 @@ var ETSI_QC_RULES = [
3060
3107
  ? "organizationIdentifier" : "serialNumber";
3061
3108
  if (!_qcHasLocalReference(cert, attr)) return;
3062
3109
  var list = info.nameRegistrationAuthorities;
3063
- if (!Array.isArray(list) || !list.length) out.push({ context: { attribute: attr } });
3110
+ if (!Array.isArray(list) || !list.length) _push(out, { context: { attribute: attr } });
3064
3111
  });
3065
3112
  return out.length ? out : null;
3066
3113
  },
@@ -3083,7 +3130,7 @@ var ETSI_QC_RULES = [
3083
3130
  var natural = info.semanticsIdentifier === oid.byName("semanticsId-Natural");
3084
3131
  if (!natural && !_qcHasLocalReference(cert, "organizationIdentifier")) return;
3085
3132
  if (!_qcHasUriAuthority(info)) {
3086
- out.push({ context: { semanticsIdentifier: oid.name(info.semanticsIdentifier) } });
3133
+ _push(out, { context: { semanticsIdentifier: oid.name(info.semanticsIdentifier) } });
3087
3134
  }
3088
3135
  });
3089
3136
  return out.length ? out : null;
@@ -3144,7 +3191,7 @@ var CABF_CS_RULES = [
3144
3191
  void 0;
3145
3192
  }
3146
3193
  if (pkiBuild.httpUrlScheme(uri) !== "http") {
3147
- out.push({ context: { policyIdentifier: pi.policyIdentifier, cps: uri } });
3194
+ _push(out, { context: { policyIdentifier: pi.policyIdentifier, cps: uri } });
3148
3195
  }
3149
3196
  });
3150
3197
  return out.length ? out : null;
@@ -3270,7 +3317,7 @@ var CABF_CS_RULES = [
3270
3317
  if (!d || !d.value) return null;
3271
3318
  var out = [];
3272
3319
  CS_FORBIDDEN_KU.forEach(function (bit) {
3273
- if (d.value[bit] === true) out.push({ context: { keyUsage: bit } });
3320
+ if (d.value[bit] === true) _push(out, { context: { keyUsage: bit } });
3274
3321
  });
3275
3322
  return out.length ? out : null;
3276
3323
  },
@@ -3288,9 +3335,9 @@ var CABF_CS_RULES = [
3288
3335
  var out = [];
3289
3336
  KU_BIT_NAMES.forEach(function (bit) {
3290
3337
  if (bit === "digitalSignature" || CS_FORBIDDEN_KU.indexOf(bit) !== -1) return;
3291
- if (d.value[bit] === true) out.push({ context: { keyUsage: bit } });
3338
+ if (d.value[bit] === true) _push(out, { context: { keyUsage: bit } });
3292
3339
  });
3293
- if (d.value.reservedBitsSet === true) out.push({ context: { reservedBitSet: true } });
3340
+ if (d.value.reservedBitsSet === true) _push(out, { context: { reservedBitSet: true } });
3294
3341
  return out.length ? out : null;
3295
3342
  },
3296
3343
  },
@@ -3335,7 +3382,7 @@ var CABF_CS_RULES = [
3335
3382
  var out = [];
3336
3383
  CS_FORBIDDEN_EKU.forEach(function (dotted) {
3337
3384
  if (d.value.indexOf(dotted) !== -1) {
3338
- out.push({ context: { purpose: dotted, name: oid.name(dotted) || null } });
3385
+ _push(out, { context: { purpose: dotted, name: oid.name(dotted) || null } });
3339
3386
  }
3340
3387
  });
3341
3388
  return out.length ? out : null;
@@ -3354,14 +3401,14 @@ var CABF_CS_RULES = [
3354
3401
  var d = ctx.decode("extKeyUsage");
3355
3402
  if (!d || !Array.isArray(d.value)) return null;
3356
3403
  var required = [];
3357
- if (_isCsTimestamp(cert, ctx)) required.push(oid.byName("timeStamping"));
3358
- if (_isCsCodeSigning(cert, ctx)) required.push(oid.byName("codeSigning"));
3404
+ if (_isCsTimestamp(cert, ctx)) _push(required, oid.byName("timeStamping"));
3405
+ if (_isCsCodeSigning(cert, ctx)) _push(required, oid.byName("codeSigning"));
3359
3406
  var out = [];
3360
3407
  d.value.forEach(function (dotted) {
3361
3408
  if (required.indexOf(dotted) !== -1) return;
3362
3409
  if (CS_PERMITTED_EXTRA_EKU.indexOf(dotted) !== -1) return;
3363
3410
  if (CS_FORBIDDEN_EKU.indexOf(dotted) !== -1) return;
3364
- out.push({ context: { purpose: dotted, name: oid.name(dotted) || null } });
3411
+ _push(out, { context: { purpose: dotted, name: oid.name(dotted) || null } });
3365
3412
  });
3366
3413
  return out.length ? out : null;
3367
3414
  },
@@ -3461,7 +3508,7 @@ var CABF_CS_RULES = [
3461
3508
  var out = [];
3462
3509
  _subjectAttributes(cert).forEach(function (a) {
3463
3510
  if (typeof a.value !== "string" || !_isMetadataOnlyValue(a.value)) return;
3464
- out.push({ context: { attribute: oid.name(a.type) || a.type, value: a.value } });
3511
+ _push(out, { context: { attribute: oid.name(a.type) || a.type, value: a.value } });
3465
3512
  });
3466
3513
  return out.length ? out : null;
3467
3514
  },
@@ -3501,7 +3548,7 @@ var CABF_CS_RULES = [
3501
3548
  check: function (cert) {
3502
3549
  var out = [];
3503
3550
  _subjectValuesOf(cert, "countryName").forEach(function (v) {
3504
- if (!_isTwoLetterCountry(v)) out.push({ context: { countryName: v } });
3551
+ if (!_isTwoLetterCountry(v)) _push(out, { context: { countryName: v } });
3505
3552
  });
3506
3553
  return out.length ? out : null;
3507
3554
  },
@@ -3519,7 +3566,7 @@ var CABF_CS_RULES = [
3519
3566
  check: function (cert) {
3520
3567
  var out = [];
3521
3568
  _subjectValuesOf(cert, "businessCategory").forEach(function (v) {
3522
- if (CS_BUSINESS_CATEGORIES.indexOf(v) === -1) out.push({ context: { businessCategory: v } });
3569
+ if (CS_BUSINESS_CATEGORIES.indexOf(v) === -1) _push(out, { context: { businessCategory: v } });
3523
3570
  });
3524
3571
  return out.length ? out : null;
3525
3572
  },
@@ -3568,7 +3615,7 @@ var CABF_TLS_RULES = [
3568
3615
  var out = [];
3569
3616
  d.value.forEach(function (ad) {
3570
3617
  if (CABF_AIA_METHODS.indexOf(ad.accessMethod) === -1) {
3571
- out.push({ context: { accessMethod: ad.accessMethod, name: oid.name(ad.accessMethod) || null } });
3618
+ _push(out, { context: { accessMethod: ad.accessMethod, name: oid.name(ad.accessMethod) || null } });
3572
3619
  }
3573
3620
  });
3574
3621
  return out.length ? out : null;
@@ -3588,7 +3635,7 @@ var CABF_TLS_RULES = [
3588
3635
  if (CABF_AIA_METHODS.indexOf(ad.accessMethod) === -1) return;
3589
3636
  var loc = ad.accessLocation;
3590
3637
  if (!loc || loc.tag !== 6) {
3591
- out.push({ context: { accessMethod: oid.name(ad.accessMethod) || ad.accessMethod,
3638
+ _push(out, { context: { accessMethod: oid.name(ad.accessMethod) || ad.accessMethod,
3592
3639
  generalNameTag: loc ? loc.tag : null } });
3593
3640
  }
3594
3641
  });
@@ -3638,7 +3685,7 @@ var CABF_TLS_RULES = [
3638
3685
  check: function (cert, ctx) {
3639
3686
  var out = [];
3640
3687
  _policyQualifierIds(ctx).forEach(function (qid) {
3641
- if (qid !== OID_CPS) out.push({ context: { qualifier: qid, name: oid.name(qid) || null } });
3688
+ if (qid !== OID_CPS) _push(out, { context: { qualifier: qid, name: oid.name(qid) || null } });
3642
3689
  });
3643
3690
  return out.length ? out : null;
3644
3691
  },
@@ -3652,7 +3699,7 @@ var CABF_TLS_RULES = [
3652
3699
  if (!d || !Array.isArray(d.value)) return null;
3653
3700
  var out = [];
3654
3701
  CABF_FORBIDDEN_EKU.forEach(function (e) {
3655
- if (d.value.indexOf(e.oid) !== -1) out.push({ context: { keyPurpose: e.name, oid: e.oid } });
3702
+ if (d.value.indexOf(e.oid) !== -1) _push(out, { context: { keyPurpose: e.name, oid: e.oid } });
3656
3703
  });
3657
3704
  return out.length ? out : null;
3658
3705
  },
@@ -3696,7 +3743,7 @@ var CABF_TLS_RULES = [
3696
3743
  var forbidden = table === "ecc" ? CABF_KU_FORBIDDEN_ECC : CABF_KU_FORBIDDEN_RSA;
3697
3744
  var out = [];
3698
3745
  forbidden.forEach(function (bit) {
3699
- if (d.value[bit] === true) out.push({ context: { keyUsage: bit, keyType: table } });
3746
+ if (d.value[bit] === true) _push(out, { context: { keyUsage: bit, keyType: table } });
3700
3747
  });
3701
3748
  return out.length ? out : null;
3702
3749
  },
@@ -3738,7 +3785,7 @@ var CABF_TLS_RULES = [
3738
3785
  var out = [];
3739
3786
  d.value.names.forEach(function (gn) {
3740
3787
  if (CABF_SAN_PERMITTED_TAGS.indexOf(gn.tagNumber) === -1) {
3741
- out.push({ context: { generalName: CABF_SAN_TAG_NAMES[gn.tagNumber] || null, tag: gn.tagNumber } });
3788
+ _push(out, { context: { generalName: CABF_SAN_TAG_NAMES[gn.tagNumber] || null, tag: gn.tagNumber } });
3742
3789
  }
3743
3790
  });
3744
3791
  return out.length ? out : null;
@@ -3771,7 +3818,7 @@ var CABF_TLS_RULES = [
3771
3818
  var out = [];
3772
3819
  _sanDnsNames(ctx).forEach(function (name) {
3773
3820
  if (typeof name === "string" && name.length > 0 && name.charAt(name.length - 1) === ".") {
3774
- out.push({ context: { dnsName: name } });
3821
+ _push(out, { context: { dnsName: name } });
3775
3822
  }
3776
3823
  });
3777
3824
  return out.length ? out : null;
@@ -3801,7 +3848,7 @@ var CABF_TLS_RULES = [
3801
3848
  var sans = _sanDnsNames(ctx).map(function (s) { return typeof s === "string" ? s.toLowerCase() : s; }), out = [];
3802
3849
  _subjectCNs(cert).forEach(function (cn) {
3803
3850
  if (_looksLikeIp(cn)) return;
3804
- if (sans.indexOf(cn.toLowerCase()) === -1) out.push({ context: { cn: cn } });
3851
+ if (sans.indexOf(cn.toLowerCase()) === -1) _push(out, { context: { cn: cn } });
3805
3852
  });
3806
3853
  return out.length ? out : null;
3807
3854
  },
@@ -3812,7 +3859,7 @@ var CABF_TLS_RULES = [
3812
3859
  appliesTo: _isTls,
3813
3860
  check: function (cert, ctx) {
3814
3861
  var out = [];
3815
- _sanDnsNames(ctx).forEach(function (name) { var p = _dnsNameProblem(name); if (p) out.push({ context: { dnsName: name, problem: p } }); });
3862
+ _sanDnsNames(ctx).forEach(function (name) { var p = _dnsNameProblem(name); if (p) _push(out, { context: { dnsName: name, problem: p } }); });
3816
3863
  return out.length ? out : null;
3817
3864
  },
3818
3865
  },
@@ -4035,7 +4082,7 @@ var X509_ALTSIG_RULES = [
4035
4082
  (cert.extensions || []).forEach(function (e) {
4036
4083
  if (e.critical !== true) return;
4037
4084
  if (e.oid !== OID_SAPKI && e.oid !== OID_ALT_ALG && e.oid !== OID_ALT_VAL) return;
4038
- rows.push({ context: { extension: e.name || e.oid, recommended: "non-critical", was: "critical" } });
4085
+ _push(rows, { context: { extension: e.name || e.oid, recommended: "non-critical", was: "critical" } });
4039
4086
  });
4040
4087
  return rows.length ? rows : null;
4041
4088
  },
@@ -4100,7 +4147,7 @@ var RFC7633_RULES = [
4100
4147
  var rows = [];
4101
4148
  for (var i = 0; i < features.length; i++) {
4102
4149
  var f = features[i];
4103
- if (f < 0n || f > 65535n) rows.push({ context: { feature: String(f), width: "0..65535" } });
4150
+ if (f < 0n || f > 65535n) _push(rows, { context: { feature: String(f), width: "0..65535" } });
4104
4151
  }
4105
4152
  return rows.length ? rows : null;
4106
4153
  },
@@ -4119,7 +4166,7 @@ var RFC7633_RULES = [
4119
4166
  var seen = new Set();
4120
4167
  var rows = [];
4121
4168
  for (var i = 0; i < features.length; i++) {
4122
- if (seen.has(features[i])) rows.push({ context: { feature: String(features[i]) } });
4169
+ if (seen.has(features[i])) _push(rows, { context: { feature: String(features[i]) } });
4123
4170
  else seen.add(features[i]);
4124
4171
  }
4125
4172
  return rows.length ? rows : null;
@@ -4385,7 +4432,7 @@ function _criticalityRows(list, table, what) {
4385
4432
  var want = table[e.oid];
4386
4433
  if (want === undefined) return;
4387
4434
  if ((e.critical === true) !== want) {
4388
- out.push({ context: { extension: e.name || e.oid, required: want ? "critical" : "non-critical", was: e.critical === true ? "critical" : "non-critical", scope: what } });
4435
+ _push(out, { context: { extension: e.name || e.oid, required: want ? "critical" : "non-critical", was: e.critical === true ? "critical" : "non-critical", scope: what } });
4389
4436
  }
4390
4437
  });
4391
4438
  return out;
@@ -4434,7 +4481,7 @@ var RFC5280_CRL_RULES = [
4434
4481
  var e = _crlExtByName(crl, carrier.name);
4435
4482
  if (!e) return;
4436
4483
  var octets = _integerOctets(carrier.read(e));
4437
- if (octets !== null && octets > 20) out.push({ context: { extension: carrier.name, octets: octets } });
4484
+ if (octets !== null && octets > 20) _push(out, { context: { extension: carrier.name, octets: octets } });
4438
4485
  });
4439
4486
  return out.length ? out : null;
4440
4487
  },
@@ -4483,7 +4530,7 @@ var RFC5280_CRL_RULES = [
4483
4530
  var rows = [];
4484
4531
  (crl.revokedCertificates || []).forEach(function (r, i) {
4485
4532
  _criticalityRows(r.crlEntryExtensions, CRL_ENTRY_CRITICALITY, "crlEntryExtensions")
4486
- .forEach(function (row) { row.context.entry = i; rows.push(row); });
4533
+ .forEach(function (row) { row.context.entry = i; _push(rows, row); });
4487
4534
  });
4488
4535
  return rows.length ? rows : null;
4489
4536
  },
@@ -4510,7 +4557,7 @@ var RFC5280_CRL_RULES = [
4510
4557
  (crl.revokedCertificates || []).forEach(function (row, i) {
4511
4558
  if (typeof row.serialNumber !== "bigint") return;
4512
4559
  var key = row.serialNumber.toString(16);
4513
- if (seen[key] !== undefined) out.push({ context: { entry: i, firstSeenAt: seen[key], serialNumber: String(row.serialNumber) } });
4560
+ if (seen[key] !== undefined) _push(out, { context: { entry: i, firstSeenAt: seen[key], serialNumber: String(row.serialNumber) } });
4514
4561
  else seen[key] = i;
4515
4562
  });
4516
4563
  return out.length ? out : null;
@@ -4528,7 +4575,7 @@ var RFC5280_CRL_RULES = [
4528
4575
  var out = [];
4529
4576
  (crl.revokedCertificates || []).forEach(function (row, i) {
4530
4577
  (row.crlEntryExtensions || []).forEach(function (e) {
4531
- if (e.oid === oid.byName("certificateIssuer")) out.push({ context: { entry: i } });
4578
+ if (e.oid === oid.byName("certificateIssuer")) _push(out, { context: { entry: i } });
4532
4579
  });
4533
4580
  });
4534
4581
  return out.length ? out : null;
@@ -4556,7 +4603,7 @@ var RFC5280_CRL_RULES = [
4556
4603
  names.forEach(function (n) {
4557
4604
  if (n.tagNumber === 4 && n.value && (n.value.rdns || []).length > 0) hasDn = true;
4558
4605
  });
4559
- if (!hasDn) out.push({ context: { entry: i } });
4606
+ if (!hasDn) _push(out, { context: { entry: i } });
4560
4607
  });
4561
4608
  });
4562
4609
  return out.length ? out : null;
@@ -4576,7 +4623,7 @@ var RFC5280_CRL_RULES = [
4576
4623
  var out = [];
4577
4624
  (crl.revokedCertificates || []).forEach(function (row, i) {
4578
4625
  (row.crlEntryExtensions || []).forEach(function (e) {
4579
- if (e.oid === oid.byName("reasonCode") && Number(e.value) === 0) out.push({ context: { entry: i } });
4626
+ if (e.oid === oid.byName("reasonCode") && Number(e.value) === 0) _push(out, { context: { entry: i } });
4580
4627
  });
4581
4628
  });
4582
4629
  return out.length ? out : null;
@@ -4597,7 +4644,7 @@ var RFC5280_CRL_RULES = [
4597
4644
  if (e.oid !== oid.byName("reasonCode")) return;
4598
4645
  var bit = REASON_TO_FLAG_BIT[Number(e.value)];
4599
4646
  if (bit === undefined) return;
4600
- if (!_reasonBitSet(scope, bit)) out.push({ context: { entry: i, reasonCode: Number(e.value) } });
4647
+ if (!_reasonBitSet(scope, bit)) _push(out, { context: { entry: i, reasonCode: Number(e.value) } });
4601
4648
  });
4602
4649
  });
4603
4650
  return out.length ? out : null;
@@ -4615,7 +4662,7 @@ var RFC5280_CRL_RULES = [
4615
4662
  var out = [];
4616
4663
  (crl.revokedCertificates || []).forEach(function (row, i) {
4617
4664
  (row.crlEntryExtensions || []).forEach(function (e) {
4618
- if (e.oid === oid.byName("reasonCode") && Number(e.value) === 0) out.push({ context: { entry: i } });
4665
+ if (e.oid === oid.byName("reasonCode") && Number(e.value) === 0) _push(out, { context: { entry: i } });
4619
4666
  });
4620
4667
  });
4621
4668
  return out.length ? out : null;
@@ -4630,7 +4677,7 @@ var RFC5280_CRL_RULES = [
4630
4677
  var out = [];
4631
4678
  (crl.revokedCertificates || []).forEach(function (row, i) {
4632
4679
  if (typeof row.serialNumber === "bigint" && row.serialNumber <= 0n) {
4633
- out.push({ context: { entry: i, serialNumber: String(row.serialNumber) } });
4680
+ _push(out, { context: { entry: i, serialNumber: String(row.serialNumber) } });
4634
4681
  }
4635
4682
  });
4636
4683
  return out.length ? out : null;
@@ -4643,7 +4690,7 @@ var RFC5280_CRL_RULES = [
4643
4690
  var out = [];
4644
4691
  (crl.revokedCertificates || []).forEach(function (row, i) {
4645
4692
  var octets = _integerOctets(row.serialNumber);
4646
- if (octets !== null && octets > 20) out.push({ context: { entry: i, octets: octets } });
4693
+ if (octets !== null && octets > 20) _push(out, { context: { entry: i, octets: octets } });
4647
4694
  });
4648
4695
  return out.length ? out : null;
4649
4696
  },
@@ -4660,12 +4707,12 @@ var RFC5280_CRL_RULES = [
4660
4707
  if (idp.malformed) return null;
4661
4708
  var out = [];
4662
4709
  if (!idp.hasDistributionPoint && !idp.onlyUser && !idp.onlyCa && !idp.onlySomeReasonsPresent && !idp.indirect && !idp.onlyAttr) {
4663
- out.push({ context: { reason: "states no scope at all" } });
4710
+ _push(out, { context: { reason: "states no scope at all" } });
4664
4711
  }
4665
- if (idp.onlyUser && idp.onlyCa) out.push({ context: { reason: "sets both onlyContainsUserCerts and onlyContainsCACerts" } });
4666
- if (idp.onlyAttr) out.push({ context: { reason: "sets onlyContainsAttributeCerts" } });
4712
+ if (idp.onlyUser && idp.onlyCa) _push(out, { context: { reason: "sets both onlyContainsUserCerts and onlyContainsCACerts" } });
4713
+ if (idp.onlyAttr) _push(out, { context: { reason: "sets onlyContainsAttributeCerts" } });
4667
4714
  if (idp.onlySomeReasonsPresent && !_scopeNamesAnyReason(idp.onlySomeReasonsValue)) {
4668
- out.push({ context: { reason: "sets onlySomeReasons to a mask naming no reason code" } });
4715
+ _push(out, { context: { reason: "sets onlySomeReasons to a mask naming no reason code" } });
4669
4716
  }
4670
4717
  return out.length ? out : null;
4671
4718
  },
@@ -4683,8 +4730,8 @@ var RFC5280_CRL_RULES = [
4683
4730
  if (dps === null) return null;
4684
4731
  var out = [];
4685
4732
  dps.forEach(function (dp, i) {
4686
- if (dp.reasons) out.push({ context: { index: i, field: "reasons" } });
4687
- if (dp.cRLIssuer) out.push({ context: { index: i, field: "cRLIssuer" } });
4733
+ if (dp.reasons) _push(out, { context: { index: i, field: "reasons" } });
4734
+ if (dp.cRLIssuer) _push(out, { context: { index: i, field: "cRLIssuer" } });
4688
4735
  });
4689
4736
  return out.length ? out : null;
4690
4737
  },
@@ -4714,7 +4761,7 @@ var RFC5280_CRL_RULES = [
4714
4761
  var out = [];
4715
4762
  descs.forEach(function (d, i) {
4716
4763
  if (d.accessMethod === CA_ISSUERS_OID) return;
4717
- out.push({ context: { index: i, method: oid.name(d.accessMethod) || d.accessMethod } });
4764
+ _push(out, { context: { index: i, method: oid.name(d.accessMethod) || d.accessMethod } });
4718
4765
  });
4719
4766
  return out.length ? out : null;
4720
4767
  },
@@ -4755,14 +4802,14 @@ var RFC5280_CRL_RULES = [
4755
4802
  if (e && Buffer.isBuffer(e.value)) {
4756
4803
  var idp = pkix.decodeIssuingDistributionPointValue(NS, e.value, _LINT_VALUE_CODE);
4757
4804
  if (!idp.malformed && idp.distributionPoint && idp.distributionPoint.kind === "rdn") {
4758
- out.push({ context: { extension: "issuingDistributionPoint", form: "nameRelativeToCRLIssuer" } });
4805
+ _push(out, { context: { extension: "issuingDistributionPoint", form: "nameRelativeToCRLIssuer" } });
4759
4806
  }
4760
4807
  }
4761
4808
  var dps = _crlDecodedExtension(crl, "freshestCRL");
4762
4809
  if (dps) {
4763
4810
  dps.forEach(function (dp, i) {
4764
4811
  if (!dp.distributionPoint || dp.distributionPoint.kind !== "rdn") return;
4765
- out.push({ context: { extension: "freshestCRL", index: i, form: "nameRelativeToCRLIssuer" } });
4812
+ _push(out, { context: { extension: "freshestCRL", index: i, form: "nameRelativeToCRLIssuer" } });
4766
4813
  });
4767
4814
  }
4768
4815
  return out.length ? out : null;
@@ -4787,7 +4834,7 @@ var RFC5280_CRL_RULES = [
4787
4834
  var out = [];
4788
4835
  (crl.revokedCertificates || []).forEach(function (row, i) {
4789
4836
  (row.crlEntryExtensions || []).forEach(function (e) {
4790
- if (e.oid === oid.byName("reasonCode") && Number(e.value) === 8) out.push({ context: { entry: i } });
4837
+ if (e.oid === oid.byName("reasonCode") && Number(e.value) === 8) _push(out, { context: { entry: i } });
4791
4838
  });
4792
4839
  });
4793
4840
  return out.length ? out : null;
@@ -4810,12 +4857,12 @@ var RFC5280_CRL_RULES = [
4810
4857
  var out = [];
4811
4858
  _crlExtList(crl).forEach(function (e) {
4812
4859
  var why = _valueSyntaxFault(e, CRL_KNOWN_EXTENSIONS, CRL_VALUE_READER);
4813
- if (why) out.push({ context: { extension: e.name || e.oid, scope: "crlExtensions", reason: why } });
4860
+ if (why) _push(out, { context: { extension: e.name || e.oid, scope: "crlExtensions", reason: why } });
4814
4861
  });
4815
4862
  (crl.revokedCertificates || []).forEach(function (row, i) {
4816
4863
  (row.crlEntryExtensions || []).forEach(function (e) {
4817
4864
  var why = _valueSyntaxFault(e, CRL_ENTRY_CRITICALITY, CRL_ENTRY_VALUE_READER);
4818
- if (why) out.push({ context: { extension: e.name || e.oid, scope: "crlEntryExtensions", entry: i, reason: why } });
4865
+ if (why) _push(out, { context: { extension: e.name || e.oid, scope: "crlEntryExtensions", entry: i, reason: why } });
4819
4866
  });
4820
4867
  });
4821
4868
  return out.length ? out : null;
@@ -4834,13 +4881,13 @@ var RFC5280_CRL_RULES = [
4834
4881
  var out = [];
4835
4882
  _crlExtList(crl).forEach(function (e) {
4836
4883
  if (e.critical === true && CRL_KNOWN_EXTENSIONS[e.oid] === undefined) {
4837
- out.push({ context: { oid: e.oid, name: e.name || null, scope: "crlExtensions" } });
4884
+ _push(out, { context: { oid: e.oid, name: e.name || null, scope: "crlExtensions" } });
4838
4885
  }
4839
4886
  });
4840
4887
  (crl.revokedCertificates || []).forEach(function (row, i) {
4841
4888
  (row.crlEntryExtensions || []).forEach(function (e) {
4842
4889
  if (e.critical === true && CRL_ENTRY_CRITICALITY[e.oid] === undefined) {
4843
- out.push({ context: { oid: e.oid, name: e.name || null, scope: "crlEntryExtensions", entry: i } });
4890
+ _push(out, { context: { oid: e.oid, name: e.name || null, scope: "crlEntryExtensions", entry: i } });
4844
4891
  }
4845
4892
  });
4846
4893
  });
@@ -4961,7 +5008,7 @@ function _cmsAllSignerInfos(cms) {
4961
5008
  if (!Array.isArray(signerInfos) || depth > C.LIMITS.CMS_MAX_COUNTERSIGNATURE_DEPTH) return;
4962
5009
  signerInfos.forEach(function (si, i) {
4963
5010
  var index = isCounter ? signerIndex : i;
4964
- out.push({ signerInfo: si, signerIndex: index, countersignature: isCounter });
5011
+ _push(out, { signerInfo: si, signerIndex: index, countersignature: isCounter });
4965
5012
  (Array.isArray(si.unsignedAttrs) ? si.unsignedAttrs : []).forEach(function (attr) {
4966
5013
  if (attr.type !== OID_COUNTERSIGNATURE) return;
4967
5014
  if (!Array.isArray(attr.values)) return;
@@ -5017,7 +5064,7 @@ var RFC5652_CMS_RULES = [
5017
5064
  try { when = asn1.read.time(asn1.decode(value)); } catch (_e) { return; }
5018
5065
  var year = when.getUTCFullYear();
5019
5066
  if (year >= 1950 && year <= 2049) {
5020
- out.push({ context: { signerIndex: entry.signerIndex,
5067
+ _push(out, { context: { signerIndex: entry.signerIndex,
5021
5068
  countersignature: entry.countersignature, year: year } });
5022
5069
  }
5023
5070
  });
@@ -5043,7 +5090,7 @@ var RFC5652_CMS_RULES = [
5043
5090
  if (!mine) return;
5044
5091
  var found = listed.some(function (alg) { return _cmsSameAlgorithm(alg, mine); });
5045
5092
  if (!found) {
5046
- out.push({ context: { signerIndex: entry.signerIndex, countersignature: entry.countersignature,
5093
+ _push(out, { context: { signerIndex: entry.signerIndex, countersignature: entry.countersignature,
5047
5094
  digestAlgorithm: mine.name || mine.oid } });
5048
5095
  }
5049
5096
  });
@@ -5122,7 +5169,7 @@ var RFC5652_CMS_RULES = [
5122
5169
  var resp = entry.ocspResponse;
5123
5170
  if (resp && resp.basicResponse) return;
5124
5171
  var rb = resp && resp.responseBytes;
5125
- out.push({ context: { placement: bucket.where, index: index,
5172
+ _push(out, { context: { placement: bucket.where, index: index,
5126
5173
  otherRevInfoFormat: entry.otherRevInfoFormat,
5127
5174
  otherRevInfoFormatName: entry.otherRevInfoFormatName,
5128
5175
  responseType: (rb && rb.responseType) || null,
@@ -5166,7 +5213,7 @@ var RFC8933_CMS_RULES = [
5166
5213
  if (!Array.isArray(entry.signerInfo.signedAttrs) || !entry.signerInfo.signedAttrs.length) return;
5167
5214
  if (_cmsSignedAttr(entry.signerInfo, OID_ALG_PROTECTION) ||
5168
5215
  _cmsSignedAttr(entry.signerInfo, OID_ALG_PROTECTION_AA)) return;
5169
- out.push({ context: { signerIndex: entry.signerIndex, countersignature: entry.countersignature } });
5216
+ _push(out, { context: { signerIndex: entry.signerIndex, countersignature: entry.countersignature } });
5170
5217
  });
5171
5218
  return out.length ? out : null;
5172
5219
  },
@@ -5345,7 +5392,7 @@ var RFC5755_AC_RULES = [
5345
5392
  var row = AC_FIXED_CRITICALITY[x.oid];
5346
5393
  if (!row) return;
5347
5394
  if (x.critical !== row.critical) {
5348
- out.push({ context: { extension: row.name, clause: row.clause, critical: x.critical === true } });
5395
+ _push(out, { context: { extension: row.name, clause: row.clause, critical: x.critical === true } });
5349
5396
  }
5350
5397
  });
5351
5398
  return out.length ? out : null;
@@ -5366,7 +5413,7 @@ var RFC5755_AC_RULES = [
5366
5413
  (ac.extensions || []).forEach(function (x) {
5367
5414
  if (x.critical !== true) return;
5368
5415
  if (AC_FIXED_CRITICALITY[x.oid]) return;
5369
- out.push({ context: { oid: x.oid, name: x.name || null } });
5416
+ _push(out, { context: { oid: x.oid, name: x.name || null } });
5370
5417
  });
5371
5418
  return out.length ? out : null;
5372
5419
  },
@@ -5382,7 +5429,7 @@ var RFC5755_AC_RULES = [
5382
5429
  if (!holder) return null;
5383
5430
  var named = [];
5384
5431
  ["baseCertificateID", "entityName", "objectDigestInfo"].forEach(function (k) {
5385
- if (holder[k] !== null && holder[k] !== undefined) named.push(k);
5432
+ if (holder[k] !== null && holder[k] !== undefined) _push(named, k);
5386
5433
  });
5387
5434
  return named.length > 1 ? { context: { options: named } } : null;
5388
5435
  },
@@ -5508,7 +5555,7 @@ function _perResponse(resp, fn) {
5508
5555
  _ocspResponses(resp).forEach(function (sr, i) {
5509
5556
  var out = fn(sr, i);
5510
5557
  if (out == null) return;
5511
- (Array.isArray(out) ? out : [out]).forEach(function (row) { row.context.response = i; rows.push(row); });
5558
+ (Array.isArray(out) ? out : [out]).forEach(function (row) { row.context.response = i; _push(rows, row); });
5512
5559
  });
5513
5560
  return rows.length ? rows : null;
5514
5561
  }
@@ -5626,7 +5673,7 @@ var RFC6960_OCSP_RULES = [
5626
5673
  if (!_isNonIssuedShape(sr)) return null;
5627
5674
  var rows = [];
5628
5675
  _ocspSingleExts(sr).forEach(function (e) {
5629
- if (e.oid === OID_OCSP_CRL || CRL_ENTRY_CRITICALITY[e.oid] !== undefined) rows.push({ context: { extension: e.name } });
5676
+ if (e.oid === OID_OCSP_CRL || CRL_ENTRY_CRITICALITY[e.oid] !== undefined) _push(rows, { context: { extension: e.name } });
5630
5677
  });
5631
5678
  return rows.length ? rows : null;
5632
5679
  });
@@ -5661,16 +5708,16 @@ var RFC6960_OCSP_RULES = [
5661
5708
  check: function (resp) {
5662
5709
  var rows = [];
5663
5710
  _ocspResponseExts(resp).forEach(function (e) {
5664
- if (OCSP_REQUEST_ONLY[e.oid] !== undefined) rows.push({ context: { extension: e.name, defined: OCSP_REQUEST_ONLY[e.oid], was: "responseExtensions" } });
5711
+ if (OCSP_REQUEST_ONLY[e.oid] !== undefined) _push(rows, { context: { extension: e.name, defined: OCSP_REQUEST_ONLY[e.oid], was: "responseExtensions" } });
5665
5712
  });
5666
5713
  var per = _perResponse(resp, function (sr) {
5667
5714
  var out = [];
5668
5715
  _ocspSingleExts(sr).forEach(function (e) {
5669
- if (OCSP_REQUEST_ONLY[e.oid] !== undefined) out.push({ context: { extension: e.name, defined: OCSP_REQUEST_ONLY[e.oid], was: "singleExtensions" } });
5716
+ if (OCSP_REQUEST_ONLY[e.oid] !== undefined) _push(out, { context: { extension: e.name, defined: OCSP_REQUEST_ONLY[e.oid], was: "singleExtensions" } });
5670
5717
  });
5671
5718
  return out.length ? out : null;
5672
5719
  });
5673
- if (per) per.forEach(function (row) { rows.push(row); });
5720
+ if (per) per.forEach(function (row) { _push(rows, row); });
5674
5721
  return rows.length ? rows : null;
5675
5722
  },
5676
5723
  },
@@ -5697,17 +5744,17 @@ var RFC6960_OCSP_RULES = [
5697
5744
  var rows = [];
5698
5745
  _ocspResponseExts(resp).forEach(function (e) {
5699
5746
  var why = _valueSyntaxFault(e, OCSP_RESPONSE_KNOWN, OCSP_RESPONSE_VALUE_READER);
5700
- if (why !== null) rows.push({ context: { extension: e.name, scope: "responseExtensions", problem: why } });
5747
+ if (why !== null) _push(rows, { context: { extension: e.name, scope: "responseExtensions", problem: why } });
5701
5748
  });
5702
5749
  var per = _perResponse(resp, function (sr) {
5703
5750
  var out = [];
5704
5751
  _ocspSingleExts(sr).forEach(function (e) {
5705
5752
  var why = _valueSyntaxFault(e, OCSP_SINGLE_KNOWN, OCSP_SINGLE_VALUE_READER);
5706
- if (why !== null) out.push({ context: { extension: e.name, scope: "singleExtensions", problem: why } });
5753
+ if (why !== null) _push(out, { context: { extension: e.name, scope: "singleExtensions", problem: why } });
5707
5754
  });
5708
5755
  return out.length ? out : null;
5709
5756
  });
5710
- if (per) per.forEach(function (row) { rows.push(row); });
5757
+ if (per) per.forEach(function (row) { _push(rows, row); });
5711
5758
  return rows.length ? rows : null;
5712
5759
  },
5713
5760
  },
@@ -5721,16 +5768,16 @@ var RFC6960_OCSP_RULES = [
5721
5768
  check: function (resp) {
5722
5769
  var rows = [];
5723
5770
  _ocspResponseExts(resp).forEach(function (e) {
5724
- if (e.critical === true && OCSP_RESPONSE_KNOWN[e.oid] === undefined) rows.push({ context: { extension: e.name || e.oid, scope: "responseExtensions" } });
5771
+ if (e.critical === true && OCSP_RESPONSE_KNOWN[e.oid] === undefined) _push(rows, { context: { extension: e.name || e.oid, scope: "responseExtensions" } });
5725
5772
  });
5726
5773
  var per = _perResponse(resp, function (sr) {
5727
5774
  var out = [];
5728
5775
  _ocspSingleExts(sr).forEach(function (e) {
5729
- if (e.critical === true && OCSP_SINGLE_KNOWN[e.oid] === undefined) out.push({ context: { extension: e.name || e.oid, scope: "singleExtensions" } });
5776
+ if (e.critical === true && OCSP_SINGLE_KNOWN[e.oid] === undefined) _push(out, { context: { extension: e.name || e.oid, scope: "singleExtensions" } });
5730
5777
  });
5731
5778
  return out.length ? out : null;
5732
5779
  });
5733
- if (per) per.forEach(function (row) { rows.push(row); });
5780
+ if (per) per.forEach(function (row) { _push(rows, row); });
5734
5781
  return rows.length ? rows : null;
5735
5782
  },
5736
5783
  },
@@ -5777,7 +5824,7 @@ var RFC6960_OCSP_RULES = [
5777
5824
  _ocspResponses(resp).forEach(function (sr, i) {
5778
5825
  var key = _certIdKey(sr.certID), seen = first[key];
5779
5826
  if (seen === undefined) { first[key] = { index: i, status: _statusKey(sr.certStatus) }; return; }
5780
- rows.push({ context: { response: i, first: seen.index, conflicting: seen.status !== _statusKey(sr.certStatus) } });
5827
+ _push(rows, { context: { response: i, first: seen.index, conflicting: seen.status !== _statusKey(sr.certStatus) } });
5781
5828
  });
5782
5829
  return rows.length ? rows : null;
5783
5830
  },
@@ -5927,7 +5974,7 @@ var RFC2986_CSR_RULES = [
5927
5974
  check: function (csr, ctx) {
5928
5975
  var out = [];
5929
5976
  CA_DETERMINED_EXTENSIONS.forEach(function (name) {
5930
- if (ctx.raw(name)) out.push({ context: { extension: name } });
5977
+ if (ctx.raw(name)) _push(out, { context: { extension: name } });
5931
5978
  });
5932
5979
  return out.length ? out : null;
5933
5980
  },
@@ -6080,12 +6127,12 @@ function _nistClassicalDeclarations(cert) {
6080
6127
  var keyAlg = (cert.subjectPublicKeyInfo && cert.subjectPublicKeyInfo.algorithm) || null;
6081
6128
  var keyKind = _nistKindOf(keyAlg);
6082
6129
  if (_nistIsClassical(keyKind)) {
6083
- out.push({ field: "subjectPublicKey", kind: keyKind, name: _spkiAlgName(cert) || (keyAlg && keyAlg.oid) });
6130
+ _push(out, { field: "subjectPublicKey", kind: keyKind, name: _spkiAlgName(cert) || (keyAlg && keyAlg.oid) });
6084
6131
  }
6085
6132
  var sigAlg = cert.signatureAlgorithm || null;
6086
6133
  var sigKind = _nistKindOf(sigAlg);
6087
6134
  if (_nistIsClassical(sigKind)) {
6088
- out.push({ field: "signature", kind: sigKind, name: (sigAlg && (sigAlg.name || sigAlg.oid)) });
6135
+ _push(out, { field: "signature", kind: sigKind, name: (sigAlg && (sigAlg.name || sigAlg.oid)) });
6089
6136
  }
6090
6137
  return out;
6091
6138
  }
@@ -6233,7 +6280,7 @@ var NIST_TRANSITION_RULES = [
6233
6280
  _nistClassicalDeclarations(cert).forEach(function (d) {
6234
6281
  if (d.field !== "subjectPublicKey") return;
6235
6282
  var at = _nistAt112OrBelow(cert, d);
6236
- if (at) out.push({ context: Object.assign({ family: d.kind, algorithm: d.name }, at) });
6283
+ if (at) _push(out, { context: Object.assign({ family: d.kind, algorithm: d.name }, at) });
6237
6284
  });
6238
6285
  return out.length ? out : null;
6239
6286
  },
@@ -6341,19 +6388,19 @@ function _cnsaKeyUsageFindings(ctx, setName) {
6341
6388
  if (!set || !ku || !ku.value) return null;
6342
6389
  var v = ku.value, out = [];
6343
6390
  set.required.forEach(function (bit) {
6344
- if (v[bit] !== true) out.push({ context: { bit: bit, fault: "required bit not set", set: setName } });
6391
+ if (v[bit] !== true) _push(out, { context: { bit: bit, fault: "required bit not set", set: setName } });
6345
6392
  });
6346
6393
  CNSA_KEY_USAGE_BITS.forEach(function (bit) {
6347
6394
  if (v[bit] !== true) return;
6348
6395
  if (set.required.indexOf(bit) !== -1 || set.optional.indexOf(bit) !== -1) return;
6349
- out.push({ context: { bit: bit, fault: "bit outside the set this profile fixes", set: setName } });
6396
+ _push(out, { context: { bit: bit, fault: "bit outside the set this profile fixes", set: setName } });
6350
6397
  });
6351
6398
  /** @internal "All other bits MUST NOT be set" reaches past the nine RFC 5280 sec. 4.2.1.3 names: a
6352
6399
  * bit beyond them is one of the others. The decoder reports those as one flag rather than by
6353
6400
  * position, so they are one finding. Reading only the nine left a certificate asserting them
6354
6401
  * conforming under a clause that closes the set. */
6355
6402
  if (v.reservedBitsSet === true) {
6356
- out.push({ context: { bit: "beyond the nine named positions", fault: "bit outside the set this profile fixes", set: setName } });
6403
+ _push(out, { context: { bit: "beyond the nine named positions", fault: "bit outside the set this profile fixes", set: setName } });
6357
6404
  }
6358
6405
  return out.length ? out : null;
6359
6406
  }
@@ -6364,7 +6411,7 @@ function _cnsaKeyUsageFindings(ctx, setName) {
6364
6411
  function _cnsaMissingExtensions(ctx, names) {
6365
6412
  var out = [];
6366
6413
  names.forEach(function (name) {
6367
- if (!ctx.raw(name)) out.push({ context: { extension: name } });
6414
+ if (!ctx.raw(name)) _push(out, { context: { extension: name } });
6368
6415
  });
6369
6416
  return out.length ? out : null;
6370
6417
  }
@@ -6699,7 +6746,7 @@ var RFC9883_CSR_RULES = [
6699
6746
  (csr.attributes || []).forEach(function (a) {
6700
6747
  if (a.type !== OID_SOP_ATTR) return;
6701
6748
  if (a.privateKeyPossessionStatement === undefined) {
6702
- rows.push({ context: { attribute: a.name || a.type } });
6749
+ _push(rows, { context: { attribute: a.name || a.type } });
6703
6750
  }
6704
6751
  });
6705
6752
  return rows.length ? rows : null;
@@ -6738,7 +6785,7 @@ function _csrAttributesOf(csr, name) {
6738
6785
  var dotted = oid.byName(name);
6739
6786
  var list = csr.attributes || [];
6740
6787
  var out = [];
6741
- for (var i = 0; i < list.length; i++) { if (list[i].type === dotted) out.push(list[i]); }
6788
+ for (var i = 0; i < list.length; i++) { if (list[i].type === dotted) _push(out, list[i]); }
6742
6789
  return out;
6743
6790
  }
6744
6791
  function _csrHasAttribute(csr, name) { return _csrAttributesOf(csr, name).length > 0; }
@@ -6777,12 +6824,16 @@ function _mergeCsrReports(reports) {
6777
6824
  var findings = [], ran = [], seen = Object.create(null), ranSeen = Object.create(null);
6778
6825
  reports.forEach(function (r) {
6779
6826
  r.findings.forEach(function (f) {
6780
- var key = f.id + "\u0000" + JSON.stringify(f.context === undefined ? null : f.context);
6827
+ /** @internal ONE own read. A finding carries `context` only when its rule supplied one, so the
6828
+ * read answered from `Object.prototype` otherwise, and a getter there runs with the finding as
6829
+ * its receiver while the severity the gate reads is still on it. */
6830
+ var context = _own(f, "context");
6831
+ var key = f.id + "\u0000" + JSON.stringify(context === undefined ? null : context);
6781
6832
  if (seen[key]) return;
6782
6833
  seen[key] = true;
6783
- findings.push(f);
6834
+ _push(findings, f);
6784
6835
  });
6785
- r.ran.forEach(function (id) { if (!ranSeen[id]) { ranSeen[id] = true; ran.push(id); } });
6836
+ r.ran.forEach(function (id) { if (!ranSeen[id]) { ranSeen[id] = true; _push(ran, id); } });
6786
6837
  });
6787
6838
  var counts = Object.assign(Object.create(null), { fatal: 0, error: 0, warn: 0, notice: 0, pass: 0, na: 0, ne: 0 });
6788
6839
  var failed = Object.create(null), failedCount = 0;
@@ -6947,7 +6998,7 @@ function certificate(input, opts) {
6947
6998
  throw _cfg("lint/bad-severity", "unknown severity threshold \"" + opts.severity + "\" (known: " + VALID_SEVERITY.join(", ") + ")");
6948
6999
  }
6949
7000
  var rules = _selectRules(opts.profile);
6950
- var ingested = _ingest(input);
7001
+ var ingested = _rebase(_ingest(input));
6951
7002
  var report;
6952
7003
  if (ingested.fatal) {
6953
7004
  report = { findings: [ingested.fatal], ran: [],
@@ -6956,7 +7007,7 @@ function certificate(input, opts) {
6956
7007
  var ctx = _makeCtx(ingested.cert, opts.profile);
6957
7008
  report = _runLints(rules, ingested.cert, ctx);
6958
7009
  }
6959
- report.worst = _worst(report.findings);
7010
+ _define(report, "worst", _worst(report.findings));
6960
7011
  report.findings = _applyThreshold(report, opts.severity);
6961
7012
  return report;
6962
7013
  }
@@ -7103,7 +7154,7 @@ function csr(input, opts) {
7103
7154
  else if (CSR_PROFILES[profile]) rules_ = CSR_PROFILES[profile];
7104
7155
  else throw _profileRefusal(profile, "csr");
7105
7156
 
7106
- var ingested = _ingestCsr(input);
7157
+ var ingested = _rebase(_ingestCsr(input));
7107
7158
  var report;
7108
7159
  if (ingested.fatal) {
7109
7160
  report = { findings: [ingested.fatal], ran: [],
@@ -7113,7 +7164,7 @@ function csr(input, opts) {
7113
7164
  return _runLints(rules_, view, _makeCsrCtx(view, profile));
7114
7165
  }));
7115
7166
  }
7116
- report.worst = _worst(report.findings);
7167
+ _define(report, "worst", _worst(report.findings));
7117
7168
  report.findings = _applyThreshold(report, opts.severity);
7118
7169
  return report;
7119
7170
  }
@@ -7131,7 +7182,7 @@ function crl(input, opts) {
7131
7182
  else if (CRL_PROFILES[profile]) rules_ = CRL_PROFILES[profile];
7132
7183
  else throw _profileRefusal(profile, "crl");
7133
7184
 
7134
- var ingested = _ingestCrl(input);
7185
+ var ingested = _rebase(_ingestCrl(input));
7135
7186
  var report;
7136
7187
  if (ingested.fatal) {
7137
7188
  report = { findings: [ingested.fatal], ran: [],
@@ -7139,7 +7190,7 @@ function crl(input, opts) {
7139
7190
  } else {
7140
7191
  report = _runLints(rules_, ingested.crl, { profile: profile, decode: function () { return null; }, raw: function () { return null; } });
7141
7192
  }
7142
- report.worst = _worst(report.findings);
7193
+ _define(report, "worst", _worst(report.findings));
7143
7194
  report.findings = _applyThreshold(report, opts.severity);
7144
7195
  return report;
7145
7196
  }
@@ -7244,7 +7295,7 @@ function ocsp(input, opts) {
7244
7295
  else if (OCSP_PROFILES[profile]) rules_ = OCSP_PROFILES[profile];
7245
7296
  else throw _profileRefusal(profile, "ocsp");
7246
7297
 
7247
- var ingested = _ingestOcsp(input);
7298
+ var ingested = _rebase(_ingestOcsp(input));
7248
7299
  var report;
7249
7300
  if (ingested.fatal) {
7250
7301
  report = { findings: [ingested.fatal], ran: [],
@@ -7258,7 +7309,7 @@ function ocsp(input, opts) {
7258
7309
  } else {
7259
7310
  report = _runLints(rules_, ingested.response, { profile: profile, decode: function () { return null; }, raw: function () { return null; } });
7260
7311
  }
7261
- report.worst = _worst(report.findings);
7312
+ _define(report, "worst", _worst(report.findings));
7262
7313
  report.findings = _applyThreshold(report, opts.severity);
7263
7314
  return report;
7264
7315
  }
@@ -7348,7 +7399,7 @@ function cms(input, opts) {
7348
7399
  else if (CMS_PROFILES[profile]) rules_ = CMS_PROFILES[profile];
7349
7400
  else throw _profileRefusal(profile, "cms");
7350
7401
 
7351
- var ingested = _ingestCms(input);
7402
+ var ingested = _rebase(_ingestCms(input));
7352
7403
  var report;
7353
7404
  if (ingested.fatal) {
7354
7405
  report = { findings: [ingested.fatal], ran: [],
@@ -7356,7 +7407,7 @@ function cms(input, opts) {
7356
7407
  } else {
7357
7408
  report = _runLints(rules_, ingested.cms, { profile: profile, decode: function () { return null; }, raw: function () { return null; } });
7358
7409
  }
7359
- report.worst = _worst(report.findings);
7410
+ _define(report, "worst", _worst(report.findings));
7360
7411
  report.findings = _applyThreshold(report, opts.severity);
7361
7412
  return report;
7362
7413
  }
@@ -7435,7 +7486,7 @@ function tsp(input, opts) {
7435
7486
  else if (TSP_PROFILES[profile]) rules_ = TSP_PROFILES[profile];
7436
7487
  else throw _profileRefusal(profile, "tsp");
7437
7488
 
7438
- var ingested = _ingestTsp(input);
7489
+ var ingested = _rebase(_ingestTsp(input));
7439
7490
  var report;
7440
7491
  if (ingested.fatal) {
7441
7492
  report = { findings: [ingested.fatal], ran: [],
@@ -7443,7 +7494,7 @@ function tsp(input, opts) {
7443
7494
  } else {
7444
7495
  report = _runLints(rules_, ingested.token, { profile: profile, decode: function () { return null; }, raw: function () { return null; } });
7445
7496
  }
7446
- report.worst = _worst(report.findings);
7497
+ _define(report, "worst", _worst(report.findings));
7447
7498
  report.findings = _applyThreshold(report, opts.severity);
7448
7499
  return report;
7449
7500
  }
@@ -7524,7 +7575,7 @@ function attrcert(input, opts) {
7524
7575
  else if (AC_PROFILES[profile]) rules_ = AC_PROFILES[profile];
7525
7576
  else throw _profileRefusal(profile, "attrcert");
7526
7577
 
7527
- var ingested = _ingestAttrCert(input);
7578
+ var ingested = _rebase(_ingestAttrCert(input));
7528
7579
  var report;
7529
7580
  if (ingested.fatal) {
7530
7581
  report = { findings: [ingested.fatal], ran: [],
@@ -7532,7 +7583,7 @@ function attrcert(input, opts) {
7532
7583
  } else {
7533
7584
  report = _runLints(rules_, ingested.ac, { profile: profile, decode: function () { return null; }, raw: function () { return null; } });
7534
7585
  }
7535
- report.worst = _worst(report.findings);
7586
+ _define(report, "worst", _worst(report.findings));
7536
7587
  report.findings = _applyThreshold(report, opts.severity);
7537
7588
  return report;
7538
7589
  }
@@ -7565,6 +7616,36 @@ var BY_ARTIFACT = Object.assign(Object.create(null), {
7565
7616
  cms: CMS_PROFILES, tsp: TSP_PROFILES, attrcert: AC_PROFILES,
7566
7617
  });
7567
7618
 
7619
+ /** @internal Every rule row re-based on NO prototype, once, when the module loads.
7620
+ *
7621
+ * A row carries an optional field only when its rule needs one, so `rule.appliesTo`,
7622
+ * `rule.effectiveDate` and `rule.readsSignatureValue` were read off `Object.prototype` for every row
7623
+ * that omits it. An inherited `appliesTo` returning a function that answers false SKIPS the rule, so
7624
+ * the rule that would have refused the artifact never runs and the signers' producer check has
7625
+ * nothing to refuse on. Naming the optional fields here instead would be a list to keep in step with
7626
+ * every rule added afterwards, and the field the next rule makes optional is the one the list would
7627
+ * be missing. No prototype needs no list.
7628
+ *
7629
+ * Done in place, so a row keeps its identity, and `rules()` hands operators fresh projections rather
7630
+ * than these rows. Walked with plain loops, which dispatch through no prototype of their own, and
7631
+ * idempotent, so a row reached twice through two profiles is re-based once in effect. */
7632
+ (function () {
7633
+ var tables = [PROFILES, CSR_PROFILES, CRL_PROFILES, OCSP_PROFILES, CMS_PROFILES, TSP_PROFILES, AC_PROFILES];
7634
+ var bare = function (rows) {
7635
+ if (!intrinsic.isArray(rows)) return;
7636
+ for (var r = 0; r < rows.length; r++) {
7637
+ if (rows[r] !== null && typeof rows[r] === "object") intrinsic.setPrototypeOf(rows[r], null);
7638
+ }
7639
+ };
7640
+ for (var t = 0; t < tables.length; t++) {
7641
+ var names = intrinsic.keys(tables[t]);
7642
+ for (var n = 0; n < names.length; n++) bare(tables[t][names[n]]);
7643
+ }
7644
+ var aggregates = [ALL_RULES, ALL_CRL_RULES, ALL_OCSP_RULES, ALL_CSR_RULES,
7645
+ ALL_CMS_RULES, ALL_TSP_RULES, ALL_AC_RULES];
7646
+ for (var g = 0; g < aggregates.length; g++) bare(aggregates[g]);
7647
+ })();
7648
+
7568
7649
  function rules(profile, artifact) {
7569
7650
  /** @internal Every lint verb reads "all" and "default" as naming no profile, so the enumerator
7570
7651
  * reads them the same way: a caller who linted under one of those names and then asked which
@@ -7581,7 +7662,7 @@ function rules(profile, artifact) {
7581
7662
  * rows and the CRL and OCSP sets, none of which a request or a response is ever held to. */
7582
7663
  set = [];
7583
7664
  Object.keys(BY_ARTIFACT[artifact]).forEach(function (name) {
7584
- BY_ARTIFACT[artifact][name].forEach(function (r) { set.push(r); });
7665
+ BY_ARTIFACT[artifact][name].forEach(function (r) { _push(set, r); });
7585
7666
  });
7586
7667
  } else if (profile == null) {
7587
7668
  set = ALL_RULES.concat(ALL_CRL_RULES).concat(ALL_OCSP_RULES).concat(ALL_CSR_RULES)
@@ -7604,7 +7685,7 @@ function rules(profile, artifact) {
7604
7685
  set.forEach(function (r) {
7605
7686
  if (seen[r.id]) return;
7606
7687
  seen[r.id] = true;
7607
- out.push({ id: r.id, severity: r.severity, source: r.source, citation: r.citation });
7688
+ _push(out, { id: r.id, severity: r.severity, source: r.source, citation: r.citation });
7608
7689
  });
7609
7690
  return out;
7610
7691
  }
@@ -7638,7 +7719,7 @@ function profiles() {
7638
7719
  var out = [];
7639
7720
  Object.keys(BY_ARTIFACT).forEach(function (artifact) {
7640
7721
  Object.keys(BY_ARTIFACT[artifact]).forEach(function (name) {
7641
- if (out.indexOf(name) === -1) out.push(name);
7722
+ if (out.indexOf(name) === -1) _push(out, name);
7642
7723
  });
7643
7724
  });
7644
7725
  return out;
@@ -7667,7 +7748,10 @@ var SIGNATURE_VALUE_RULES = (function () {
7667
7748
  Object.keys(BY_ARTIFACT).forEach(function (artifact) {
7668
7749
  Object.keys(BY_ARTIFACT[artifact]).forEach(function (name) {
7669
7750
  BY_ARTIFACT[artifact][name].forEach(function (r) {
7670
- if (r.readsSignatureValue === true) out[r.id] = true;
7751
+ /** @internal An own read: the flag is optional, so a rule row that does not carry it answered
7752
+ * from `Object.prototype`, and a getter there returning true at load exempted every such rule
7753
+ * from the gate permanently. */
7754
+ if (_own(r, "readsSignatureValue") === true) out[r.id] = true;
7671
7755
  });
7672
7756
  });
7673
7757
  });
@@ -7749,7 +7833,7 @@ function assertBuildClean(artifact, der, profile, E, code) {
7749
7833
  var verb = BUILD_GATE_VERB[artifact];
7750
7834
  var reports = [verb(der, { profile: BUILD_GATE_ALWAYS[artifact] })];
7751
7835
  if (profile != null && profile !== BUILD_GATE_ALWAYS[artifact]) {
7752
- reports.push(verb(der, { profile: profile }));
7836
+ _push(reports, verb(der, { profile: profile }));
7753
7837
  }
7754
7838
  for (var r = 0; r < reports.length; r++) {
7755
7839
  var found = reports[r].findings;