Skip to content

feat(image): pack the CA trust bundle (NeoDOS D8) - #47

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

alexis900 merged 1 commit into
mainfrom
feat/trust-bundle

Conversation

@alexis900

Copy link
Copy Markdown
Contributor

El kernel pasa a llevar un almacén de confianza para que HTTPS funcione sin --ca. Se construye desde el bundle PEM del host: se decodifica cada bloque CERTIFICATE y se concatenan los DER en /NeoDOS/System/config/roots.der.

  • Origen: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem, sustituible con NEODOS_TRUST_BUNDLE (CI, tests, store fijado).
  • El decodificador base64 es local (sin dependencias nuevas) y tiene test con y sin padding.
  • Sin origen no se empaqueta nada y se avisa: el cliente falla cerrado en vez de confiar en cualquier cosa.

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

The kernel ships a system trust store so HTTPS works without an explicit
`--ca`. Build it from the host's PEM bundle: decode every `CERTIFICATE` block
and concatenate the DER at `/NeoDOS/System/config/roots.der`.

- Source: `/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem`, overridable with
  `NEODOS_TRUST_BUNDLE` (CI, tests, a pinned store).
- The base64 decoder is local (no new dependency); unit-tested with and without
  padding.
- With no source the bundle is omitted and the image warns: the client then
  fails closed instead of trusting anything.

Matches NeoDOS D8 (`docs/design/libtls-https-design.md` §3.6).
alexis900 added a commit to NeoDOS-Project/NeoDOS that referenced this pull request Nov 17, 2026
* feat(tls): load the system trust store (D8)

HTTPS needed an explicit `--ca FILE`: the image carried no roots, so every real
connection was a fixture exercise.

- `libtls::der::split_certificates` splits a concatenated DER bundle using the
  X.690 lengths (no PEM/base64 parser on the target), with tests.
- `libnet::http_transport::system_roots()` reads
  `\NeoDOS\System\config\roots.der` through `ReadContent` and returns the
  anchors; a missing or unreadable bundle yields an empty list so TLS fails
  closed.
- `neocurl` uses the system store when `--ca` is absent (`--ca` still
  overrides), and refuses to start when there are no anchors at all.
- NeoDev (external, NeoDOS-Project/NeoDev#47) packs the bundle from the host's
  CA store; `NEODOS_TRUST_BUNDLE` overrides the source.

Docs: D8 marked resolved in `libtls-https-design.md` (§3.6) and the userland
guide; `CHANGELOG.md` gains an Unreleased section with this and the filesystem
fixes from #750/#751/#754.

* fix(usermode): raise the binary slot to 512 KiB and refuse oversized images

`MAX_BIN_SIZE` capped a user binary at 192 KiB and the loader *silently
truncated* anything larger, so the ELF parser failed far from the cause. When
`neocurl.nxe` (crypto + TLS + trust store) crossed 192 KiB the shell reported
"Comando o nombre de archivo incorrecto" and the binary simply never ran.

- `MAX_BIN_SIZE` is now 512 KiB (slot 576 KiB → 56 slots in the 32 MB user
  window, still ample).
- `create_process_from_ob_path` refuses a binary bigger than the cap with
  `NoMemory` and logs the size, instead of loading a truncated image.
- The design note for large NXEs records the new limit.

Refs #755
@alexis900
alexis900 merged commit 3d5a2a8 into main Nov 17, 2026
2 of 3 checks passed
@alexis900
alexis900 deleted the feat/trust-bundle branch November 17, 2026 10:06
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