@ai-ecoverse/slicc-kernel 1.125.7 → 1.125.9

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.
package/README.md CHANGED
@@ -426,7 +426,7 @@ The module's default export (or its `main` export) is called with a context and
426
426
  - With `rejectUnauthorized: false`, `chainError` says what is wrong with the chain apart from the name, with Node's names, and is absent when the chain is fine:
427
427
  - a self-signed leaf alone is `DEPTH_ZERO_SELF_SIGNED_CERT`;
428
428
  - an untrusted chain ending in a self-signed root is `SELF_SIGNED_CERT_IN_CHAIN`;
429
- - self-signed means the certificate's own key verifies its signature (RSA PKCS#1 v1.5, ECDSA P-256/384/521 or Ed25519), not just that its issuer and subject names match, so a self-issued certificate signed by another key, such as a CA rollover certificate, is not self-signed, as in Node ([#1059](https://github.com/ai-ecoverse/slicc-kernel/issues/1059));
429
+ - self-signed means the certificate's own key verifies its signature (RSA PKCS#1 v1.5, RSA-PSS, ECDSA P-256/384/521 or Ed25519; a signature the kernel can't verify is not self-signed), not just that its issuer and subject names match, so a self-issued certificate signed by another key, such as a CA rollover certificate, is not self-signed, as in Node ([#1059](https://github.com/ai-ecoverse/slicc-kernel/issues/1059));
430
430
  - a lone leaf whose issuer is unknown is `UNABLE_TO_VERIFY_LEAF_SIGNATURE`;
431
431
  - an untrusted longer chain is `UNABLE_TO_GET_ISSUER_CERT_LOCALLY`;
432
432
  - otherwise it's the reason's code, such as `CERT_HAS_EXPIRED`.
@@ -1094,7 +1094,7 @@ Releases are cut by semantic-release on every push to `main`, in two jobs, and o
1094
1094
 
1095
1095
  Every change is certified in its pull request, before it merges (`cert-review-pr.yml`, next section), and `cert-review` is a required check of the merge queue, so every commit on `main`, and every release built from it, was certified first. A release is then **verified on npm** (`release / verify on npm` in `release.yml`, `tools/cert-review/verify.mjs`), in code, for every tag the run made:
1096
1096
 
1097
- - It waits up to an hour for npm to serve the version (an accepted publish can take a while to appear; 1.125.4 took 55 min). `release-recover` waits 25 min for a version it just published and then hands it to this job instead of failing, and a version npm still doesn't serve after the hour is a "not served yet, re-run" failure, never a supply-chain alert. It then downloads the tarball and checks `dist.integrity` (sha512), the SLSA v1 provenance (the tarball's sha512 is its subject; `release.yml` on `refs/heads/main`, a GitHub-hosted builder; `gitCommit` = `gitHead` = the tag, on `main`), and `npm audit signatures`. npm serves a version's attestations a little after the version itself, so a 404 from the attestations, or `npm audit signatures`' E404 on them, is retried within the same hour: it's a supply-chain alert only once the version has been served for 30 min, its packument has stopped changing for 10, and the attestations still answer 404, or the hour has run out. Any other status, or attestations that don't match, fail at once. A version that `release-recover.mjs` skipped because npm's `latest` is newer (#837) has nothing to verify.
1097
+ - It waits up to an hour for npm to serve the version (an accepted publish can take a while to appear; 1.125.4 took 55 min). `release-recover` waits 25 min for a version it just published and then hands it to this job instead of failing, and a version npm still doesn't serve after the hour is a "not served yet, re-run" failure, never a supply-chain alert. It then downloads the tarball and checks `dist.integrity` (sha512), the SLSA v1 provenance (the tarball's sha512 is its subject; `release.yml` on `refs/heads/main`, a GitHub-hosted builder; `gitCommit` = `gitHead` = the tag, on `main`), and `npm audit signatures`. npm serves a version's attestations a little after the version itself, so a 404 from the attestations, a missing `dist.attestations`, an `npm view` or network error while looking for them, or `npm audit signatures`' E404 on them, is retried within the same hour: it's a supply-chain alert only once the version has been served for 30 min, its packument has stopped changing for 10, and the attestations still answer 404, or the hour has run out. Any other status, or attestations that don't match, fail at once. A version that `release-recover.mjs` skipped because npm's `latest` is newer (#837) has nothing to verify.
1098
1098
  - It then writes `certified @ai-ecoverse/slicc-kernel@<v> sha256=<64 hex> (covers <first>–<v>; ci: <run>; pr-certified: <each merged pull request's cert-review at its merge>; known: <open known-issue issues>)` into the GitHub release's notes, between `<!-- cert-verify -->` markers. homescoop's ci reads exactly that prefix and re-hashes the npm tarball against it. `covers` starts after the last version npm serves, so a skipped version is covered by the next. Notes that already carry the identical line stay unchanged. A pull request's `cert-review` is the newest finished one (success, failure or error) on its head at or before its merge, or the newest pending one if none had finished. A re-review that a later `merge-ok` re-label starts on the same head, still pending at the merge or ending after it, doesn't change what the merge queue saw, and a status posted after the merge can't change a release's line.
1099
1099
  - A mismatch writes no line. The job is red with a `supply-chain alert`, and so is a line already in the notes with another sha256.
1100
1100
 
@@ -6632,7 +6632,7 @@ function satisfies(version, range2) {
6632
6632
  }
6633
6633
 
6634
6634
  // src/version.ts
6635
- var KERNEL_VERSION = true ? "1.125.7" : "0.0.0-dev";
6635
+ var KERNEL_VERSION = true ? "1.125.9" : "0.0.0-dev";
6636
6636
  var OS_RELEASE = "6.0.0-slicc";
6637
6637
  function procVersion() {
6638
6638
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -17313,8 +17313,32 @@ var HASHES = {
17313
17313
  "2a8648ce3d040302": ["ECDSA", "SHA-256"],
17314
17314
  "2a8648ce3d040303": ["ECDSA", "SHA-384"],
17315
17315
  "2a8648ce3d040304": ["ECDSA", "SHA-512"],
17316
- "2b6570": ["Ed25519", ""]
17316
+ "2b6570": ["Ed25519", ""],
17317
+ "2a864886f70d01010a": ["RSA-PSS", "SHA-1"]
17317
17318
  };
17319
+ var PSS_HASHES = {
17320
+ "2b0e03021a": "SHA-1",
17321
+ "608648016503040201": "SHA-256",
17322
+ "608648016503040202": "SHA-384",
17323
+ "608648016503040203": "SHA-512"
17324
+ };
17325
+ function pssOf(der, algorithm) {
17326
+ const params = children2(der, algorithm, 2)?.[1];
17327
+ let hash = "SHA-1";
17328
+ let salt = 20;
17329
+ for (const field4 of params && der[params.start] === 48 ? children2(der, params, 3) ?? [] : []) {
17330
+ const inner = tlv2(der, field4.body);
17331
+ if (!inner) return void 0;
17332
+ if (der[field4.start] === 160) {
17333
+ const known = PSS_HASHES[oidOf(der, inner) ?? ""];
17334
+ if (!known) return void 0;
17335
+ hash = known;
17336
+ } else if (der[field4.start] === 162) {
17337
+ salt = der.subarray(inner.body, inner.end).reduce((n, b) => n * 256 + b, 0);
17338
+ }
17339
+ }
17340
+ return { hash, salt };
17341
+ }
17318
17342
  var CURVES = {
17319
17343
  "2a8648ce3d030107": ["P-256", 32],
17320
17344
  "2b81040022": ["P-384", 48],
@@ -17349,10 +17373,13 @@ function signedOf(der) {
17349
17373
  const spki = parts2?.tbs[5];
17350
17374
  if (!tbs || !algorithm || !value2 || !spki || der[value2.start] !== 3) return void 0;
17351
17375
  const known = HASHES[oidOf(der, algorithm) ?? ""];
17352
- if (!known) return "unknown";
17353
- const [scheme, hash] = known;
17376
+ if (!known) return void 0;
17377
+ const [scheme] = known;
17378
+ const pss = scheme === "RSA-PSS" ? pssOf(der, algorithm) : void 0;
17379
+ if (scheme === "RSA-PSS" && !pss) return void 0;
17380
+ const hash = pss?.hash ?? known[1];
17354
17381
  const curve = scheme === "ECDSA" ? curveOf(der, spki) : void 0;
17355
- if (scheme === "ECDSA" && !curve) return "unknown";
17382
+ if (scheme === "ECDSA" && !curve) return void 0;
17356
17383
  const signature = der.subarray(value2.body + 1, value2.end);
17357
17384
  return {
17358
17385
  tbs: raw(der, tbs),
@@ -17360,7 +17387,8 @@ function signedOf(der) {
17360
17387
  signature,
17361
17388
  scheme,
17362
17389
  hash,
17363
- ...curve ? { curve } : {}
17390
+ ...curve ? { curve } : {},
17391
+ ...pss ? { salt: pss.salt } : {}
17364
17392
  };
17365
17393
  }
17366
17394
  async function verifiesItself(s) {
@@ -17371,13 +17399,12 @@ async function verifiesItself(s) {
17371
17399
  ]);
17372
17400
  const signature = s.curve ? fixedEcdsa(s.signature, s.curve[1]) : s.signature;
17373
17401
  if (!signature) return false;
17374
- const params = s.scheme === "ECDSA" ? { name: "ECDSA", hash: s.hash } : { name: s.scheme };
17402
+ const params = s.scheme === "ECDSA" ? { name: "ECDSA", hash: s.hash } : s.salt === void 0 ? { name: s.scheme } : { name: s.scheme, saltLength: s.salt };
17375
17403
  return crypto.subtle.verify(params, key, new Uint8Array(signature), new Uint8Array(s.tbs));
17376
17404
  }
17377
17405
  async function selfSigned(der) {
17378
17406
  if (!selfIssued(der)) return false;
17379
17407
  const signed = signedOf(der);
17380
- if (signed === "unknown") return true;
17381
17408
  if (!signed) return false;
17382
17409
  return verifiesItself(signed).catch(() => false);
17383
17410
  }