Skip to content

feat(image): version the trust bundle (NeoDOS D8) - #50

Merged
alexis900 merged 1 commit into
mainfrom
feat/trust-bundle-version
Nov 17, 2026
Merged

alexis900 merged 1 commit into
mainfrom
feat/trust-bundle-version

Conversation

@alexis900

Copy link
Copy Markdown
Contributor

Una concatenación DER cruda no se puede validar: un fichero truncado parece un almacén más pequeño. Ahora se escribe una cabecera:

"NDTB" | version u16 | reserved u16 | built u32 | cert_count u32 | certificate…
  • cert_count permite al kernel rechazar un bundle cuyo contenido no cuadra, así que un fichero parcial nunca confía en un subconjunto en silencio.
  • built sale de SOURCE_DATE_EPOCH si está definido (imágenes reproducibles); si no, es la hora de build, que el cliente compara con su reloj fiable para avisar de raíces viejas.
  • count_certificates recorre las longitudes DER (con test).

Corresponde a NeoDOS D8 (docs/design/libtls-https-design.md §3.6).

A raw DER concatenation cannot be validated: a truncated file looks like a
smaller trust store. Write a header instead:

```
"NDTB" | version u16 | reserved u16 | built u32 | cert_count u32 | certificate…
```

- `cert_count` lets the kernel reject a bundle whose payload does not match, so
  a partial file never silently trusts a subset.
- `built` comes from `SOURCE_DATE_EPOCH` when set, keeping images reproducible;
  otherwise it is the build time, which the client compares with its trusted
  clock to warn about stale roots.
- `count_certificates` walks the DER lengths (unit-tested).

Matches NeoDOS D8 (`docs/design/libtls-https-design.md` §3.6).
@alexis900
alexis900 merged commit 41b9c9d into main Nov 17, 2026
3 checks passed
@alexis900
alexis900 deleted the feat/trust-bundle-version branch November 17, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant