Skip to content

feat(tls): load the system trust store (D8) - #775

Merged
alexis900 merged 2 commits into
developfrom
feat/system-trust-store
Nov 17, 2026
Merged

alexis900 merged 2 commits into
developfrom
feat/system-trust-store

Conversation

@alexis900

Copy link
Copy Markdown
Collaborator

HTTPS exigía --ca FICHERO: la imagen no llevaba raíces, así que toda conexión real era un ejercicio de fixture.

Trust store (D8)

  • libtls::der::split_certificates trocea un bundle DER concatenado usando las longitudes X.690 (sin parser PEM/base64 en el target), con tests.
  • libnet::http_transport::system_roots() lee \NeoDOS\System\config\roots.der vía ReadContent; si falta o no se puede leer devuelve vacío y TLS falla cerrado.
  • neocurl usa el almacén del sistema cuando no hay --ca (--ca sigue teniendo prioridad) y se niega a conectar si no hay anclas.
  • NeoDev (feat(image): pack the CA trust bundle (NeoDOS D8) NeoDev#47) empaqueta el bundle desde el store del host; NEODOS_TRUST_BUNDLE cambia el origen. En la imagen: roots.der 128 520 B.

Prerrequisito encontrado al verificar

MAX_BIN_SIZE era 192 KiB y el loader truncaba en silencio los binarios mayores: al crecer neocurl.nxe por encima, el shell decía «Comando o nombre de archivo incorrecto» y no arrancaba. Ahora el slot es de 512 KiB (576 KiB por proceso, 56 slots) y un binario que no cabe se rechaza con NoMemory y un log con el tamaño, en vez de cargar una imagen truncada.

Verificación en huésped (sin --ca)

neocurl --max-time 240000 https://data.iana.org/time-zones/releases/tzdb-2026f.tar.lz -o C:\TZDB.TAR.LZ
→ neocurl: 200 569858 bytes
neocurl https://valid-isrgrootx1.letsencrypt.org/   → 200 4067 bytes
neocurl https://data.iana.org/time-zones/           → 200 9095 bytes

Suite de kernel: 1000/1000 PASS.

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.
…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 b506a08 into develop Nov 17, 2026
4 checks passed
@alexis900
alexis900 deleted the feat/system-trust-store 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