LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.
C cdebiandesktop-environmentebpffirewalllandlocklinuxlinux-distributionopen-sourceprivacyquickjsraspberry-pi-5reactsecuritywaylandwayland-compositor
Checkpoint: English pass for shared docs, vault tests and links; CHANGELOG for 0.7.0 Beta
Federico Pereira7fcb7bde4a56
diff --git a/CHANGELOG.md b/CHANGELOG.mdnew file mode 100644index 0000000..6b54b03--- /dev/null+++ b/CHANGELOG.md@@ -0,0 +1,90 @@+# Changelog++## 0.7.0 Beta — first beta (2026-10-18)++The first public beta of LordOS: a desktop environment with its own display server written in C+and a React interface on its own engine. Milestone details are in `docs/ROADMAP.md`; the+architecture and dependency policy are in `docs/ARCHITECTURE.md`.++### M1 — Minimal display server++- Our own DRM/KMS modesetting (no libdrm) with double buffering and page flips.+- Our own evdev input (no libinput) and a 2D rasterizer with antialiased rounded rectangles and shadows.++### M2 — UI engine with React++- QuickJS embedded in `lord-server`, a native node tree (`View`, `Text`, `Image`), a CSS subset and+ our own flexbox layout.+- A React renderer (now React 19.3.1), damage tracking, cached shadows and blur.+- The "Lord Default" theme with menu bar, magnifying Dock and light/dark mode.++### M3 — SDK, apps as packages and swappable themes++- `@lordos/sdk`: window manager, settings, theme tokens, controls and system hooks.+- Apps as packages independent of the theme; a second "Classic" theme; live theme switching.+- `lord-server` drops root after opening the display and input.++### M4 — Native terminal++- Our own xterm-256color emulator with iTerm2 parity: tabs, split panes, profiles, inline images,+ Sixel, shell integration, triggers, Instant Replay, `tmux -CC`, ligatures and color emoji.+- Sessions survive a server restart.++### M5 and M5b — Language, region and complex scripts++- System-wide language and region, English, Spanish and Portuguese catalogs, language packs, every+ XKB layout.+- Full Unicode bidi, Arabic and Indic shaping, the Universal Shaping Engine (409/409 sentences+ identical to HarfBuzz), mirrored RTL interface, and Korean, Japanese and Chinese input methods.++### M6 — Linux apps (Wayland)++- Our own Wayland compositor on libwayland-server: GTK and Qt apps as theme windows, shared+ clipboard, `xdg-decoration`.++### M7 — Apps, packages and system services++- Our own Debian package engine (OpenPGP, xz, HTTP, resolver, then `dpkg`) and the Store.+- Installable native `.lpk` apps and our own WebAssembly interpreter.+- Network, Wi-Fi and VPN (WireGuard, OpenVPN), sound on PipeWire, clipboard history.+- Finder-style Files, Notes, the Launchpad with categories and Linux app launching.++### M8 — Session and system++- `lord-sessiond`: login screen, lock, fast user switching and remote desktop from the browser.+- Per-app sandbox (Landlock, seccomp, cgroup v2), TCC-style permissions, Ed25519 app signing, and each+ `.lpk` app as its own isolated process behind a permission broker.+- Per-app firewall with cgroup BPF (`lord-netperm`) and the Monitor app.+- Our own touchpad and touchscreen driver, fluid window moving and resizing in C, and the live ISO+ with installer.++### M9 — Apps and system++- Documents (`lord-doc`): PDF Viewer, archives, Quick Look, Fonts, Emoji & Symbols.+- Printing and scanning: our own IPP client for CUPS, mDNS and eSCL.+- Media (`lord-media`): Photos, Player, Screenshots, Camera and Recorder, with protected windows.+- Passwords and the system keyring (`lord-vault`): own `.lvault` format, FIDO2 unlock, KDBX import,+ Secret Service on D-Bus.+- Mail, Calendar, Contacts and Reminders (`lord-maild`) with IMAP, SMTP, CalDAV and CardDAV.+- System apps: Disks, Backups, Logs, Clock and Help; the network belongs to the system (`lord-netd`).+- Settings hardware pages: displays, Bluetooth, energy, notifications, date and time, default apps.+- Several displays (extend and mirror) and sharp HiDPI at 100–200 % per display.++### Tonight's work (2026-10-18)++- UI engine: text ellipsis, per-side borders and logical edges, scale and rotate transforms, and+ faster painting (full-screen paint 12.5 → 4.8 ms, two-display drag 11.3 → 2.5 ms per frame).+- QA fixes: Dock hit box, audio for new users, upgrade-safe helpers, login screen preselects the last+ user, and `make test` runs every self-contained suite.+- Translatable error codes and English as the default language.+- Polish passes for Settings, Files, Terminal, Store, mail and system apps.+- The version and release channel (`package.json`: `0.7.0`, `beta`) are built into the system and+ shown in About.+- English only: code, comments and documentation are now in English (UI text stays translated in+ `assets/locales/`).++### Known gaps++- Not yet tested on the Raspberry Pi 5 or with real FIDO2 keys, printers and mail providers.+- Chromium and Firefox are not preinstalled; per-app firewall "ask" mode and accessibility are still+ to come. See the pending items in `docs/ROADMAP.md`.diff --git a/apps/passwords/api.js b/apps/passwords/api.jsindex c4ebd36..32144cd 100644--- a/apps/passwords/api.js+++ b/apps/passwords/api.js@@ -1,7 +1,7 @@// api.js — estado de la app Contraseñas y los pedidos a lord-vault (por @lordos/sdk vaultRequest).// Lo descifrado vive en lord-vault; acá llega solo lo que se muestra: la lista liviana (sin// secretos), la entrada abierta (los ocultos sin valor) y un valor cuando el usuario lo pide-// (mostrar, copiar, editar). Ver docs/CONTRASENAS.md.+// (mostrar, copiar, editar). Ver docs/PASSWORDS.md.import { createStore, vaultRequest, onVaultEvent, clipboard, t } from '@lordos/sdk';export const APP_ID = 'passwords';diff --git a/apps/passwords/index.jsx b/apps/passwords/index.jsxindex a4a5104..5e0e26e 100644--- a/apps/passwords/index.jsx+++ b/apps/passwords/index.jsx@@ -2,7 +2,7 @@// de campos) y etiquetas, favoritas, archivadas, papelera, historial, códigos 2FA, Wi-Fi con QR,// notas seguras, tarjetas, informe de seguridad, generador, importar/exportar y el llavero de la// sesión. Todo lo descifrado lo maneja lord-vault, encerrado y sin red; esta ventana está-// protegida (negra en capturas, grabaciones y escritorio remoto). Ver docs/CONTRASENAS.md.+// protegida (negra en capturas, grabaciones y escritorio remoto). Ver docs/PASSWORDS.md.import {View, Text, useTheme, useStore, useAppWindow, useKeyboard, Button, TextInput, ScrollView, wm, t, vaultAvailable,} from '@lordos/sdk';diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex 5aa02a0..4c37b87 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -1,56 +1,56 @@-# Arquitectura LordOS+# LordOS architecture-LordOS es un **entorno de escritorio propio** (al nivel de KDE o GNOME) con un **servidor-gráfico real escrito desde cero en C**. No es un simulador ni una página web: toma la placa-de video y el input directamente del kernel Linux. La interfaz (escritorio, barra, dock,-apps nativas) se escribe en **JavaScript con React**, que dibuja un motor propio, igual-que React Native pero sobre nuestro servidor gráfico.+LordOS is a **desktop environment of its own** (on the level of KDE or GNOME) with a **real+display server written from scratch in C**. It is not a simulator or a web page: it takes the+graphics card and input directly from the Linux kernel. The interface (desktop, bar, dock,+native apps) is written in **JavaScript with React**, which draws on an engine of our own, just+like React Native but on top of our display server.-## Capas+## Layers```- Temas y apps LordOS ── React + JSX + estilos tipo CSS+ LordOS themes and apps ── React + JSX + CSS-like styles│ <View style={{flexDirection:'row', borderRadius:12}}>▼- lord-ui (C, propio) ─── QuickJS (motor JS, vendorizado)- │ + reconciler React propio + layout flexbox propio- │ + rasterizador 2D propio + texto (stb_truetype)+ lord-ui (C, ours) ───── QuickJS (JS engine, vendored)+ │ + our own React reconciler + our own flexbox layout+ │ + our own 2D rasterizer + text (stb_truetype)▼- lord-server (C, propio) servidor gráfico: DRM/KMS + evdev, ventanas, foco,- │ composición, decoraciones del tema- │ + protocolo Wayland → apps GTK (GNOME), Qt (KDE),- │ Firefox, Electron; Xwayland opcional para X11+ lord-server (C, ours) display server: DRM/KMS + evdev, windows, focus,+ │ composition, theme decorations+ │ + Wayland protocol → GTK (GNOME), Qt (KDE) apps,+ │ Firefox, Electron; optional Xwayland for X11▼- Kernel Linux (Debian 13 mínimo, kernel genérico con DRM)+ Linux kernel (minimal Debian 13, generic kernel with DRM)```-| Componente | Estado | Descripción |+| Component | Status | Description ||---------------|-------------|---------------------------------------------------------------|-| `server/src/` (kms, input, canvas) | **M1 hecho** | Pantalla (KMS), input (evdev), rasterizador 2D |-| `server/src/ui/` | **M2 hecho** | Nodos, estilos, flexbox, texto, imágenes, pintado, damage, QuickJS |-| `runtime/` | **M2 hecho** | Renderer React (`@lordos/runtime`): reconciler, CSS → nativo, eventos |-| `themes/default/` | **M2 hecho** | Tema estilo Mac-OS-Desktop con assets propios |-| `server/src/ui/js_sys.c` | **M3 hecho** | APIs de sistema: fs (en `$HOME`), /proc, ajustes, temas, sesión |-| `sdk/` | **M3 hecho** | `@lordos/sdk`: ventanas, ajustes, tokens, controles, hooks de sistema |-| `apps/` | **M3 hecho** | Apps como paquetes (`manifest.json` + `index.jsx`), independientes del tema |-| `themes/classic/` | **M3 hecho** | Segundo tema y plantilla para crear temas |-| `server/src/term/` | **M4 hecho** | Terminal propia: emulador xterm, PTY, dibujo, guardianes de sesión (ver `TERMINAL.md`) |-| `server/src/ui/otf.c`, `fonts.c` | **M4 hecho** | OpenType propio (sustituciones GSUB, emoji CBDT) y catálogo de fuentes instaladas: sin HarfBuzz ni fontconfig |-| `apps/terminal/` | **M4 hecho** | App Terminal estilo iTerm2 (pestañas, paneles, perfiles…) |-| `sdk/i18n.js`, `assets/locales/` | **M5 hecho** | Textos, plurales y formatos por idioma y región (ver `LANGUAGES.md`) |-| `server/src/keyboard.c` | **M5 hecho** | Teclado con libxkbcommon: todas las distribuciones de XKB, compose |-| `server/src/admin.c` | **M5 hecho** | Ayudante privilegiado con acciones cerradas (región, zona horaria, paquetes de idioma) |-| `server/src/ui/bidi.c`, `unicode.c`, `shape.c`, `textlayout.c` | **M5b hecho** | Bidi de Unicode completo, formas del árabe y marcas (GSUB/GPOS), respaldo de fuentes por escritura, corte CJK, interfaz espejada (`direction`) |-| `server/src/ime.c`, `sdk/ime.js` | **M5b hecho** | Métodos de entrada: coreano, japonés (SKK), chino (pinyin) |-| `server/src/app/`, `ui/js_broker.c`, `runtime/app-host.js` | **M8 hecho** | Modo app: cada `.lpk` como proceso aislado (`lord-server --app <id>`), cliente Wayland del compositor, con broker de permisos (ver `PRIVACY.md`) |-| `server/src/sec/`, `ui/js_sec.c` | **M8 hecho** | Aislamiento de apps .lpk (Landlock+seccomp+cgroup), permisos TCC y firma Ed25519 (ver `PRIVACY.md`, `SIGNING.md`) |-| `server/src/wl/`, `sdk/wayland.js` | **M6 hecho** | Compositor Wayland propio sobre libwayland-server: apps GTK y Qt como ventanas del tema (ver `WAYLAND.md`) |-| `server/src/tp/`, `wl/wl_input.c`, `js_input.c`, `sdk/trackpad.js` | **hecho (VM, uinput)** | Driver propio de touchpads y pantallas táctiles sobre evdev (sin libinput): puntero con aceleración, tocar, clic con dedos, palmas, scroll con inercia, pellizco, deslizar; gestos y toques para las apps Wayland (ver `TRACKPAD.md`) |-| `server/src/doc/`, `js_doc.c`, `apps/pdf`, `apps/fonts`, `apps/characters` | **M9** | Documentos: el ayudante encerrado `lord-doc` (Poppler, libarchive, FreeType) y sus apps: Visor de PDF, comprimidos y Vista rápida en Archivos, Tipografías, Emojis y símbolos (ver `DOCUMENTS.md`) |-| `server/src/print/`, `js_print.c`, `sdk/printdialog.jsx`, `apps/scanner` | **M9** | Impresión: cliente IPP propio contra CUPS, mDNS propio, escáneres eSCL, diálogo de impresión del sistema (ver `PRINTING.md`) |-| `server/src/media/`, `js_media.c`, `sdk/media.js`, `apps/{photos,player,screenshots,camera,recorder}` | **M9** | Medios: el ayudante encerrado `lord-media` (FFmpeg, libva) y las apps Fotos, Reproductor, Capturas, Cámara y Grabadora; nodo `media`, audio por memoria compartida con el stream de PipeWire en lord-server, ventanas protegidas en capturas, grabación y escritorio remoto (ver `MEDIA.md`) |-| `server/src/netperm/`, `server/src/fw/`, `js_fw.c` | **M8** | Firewall por app: el servicio root `lord-netperm` aplica las reglas con BPF de cgroup en las sesiones; columna Regla del Monitor y Apps confiables / restringidas en Ajustes (ver `FIREWALL.md`) |-| `server/src/monitor/`, `js_monitor.c`, `apps/monitor/` | **M8** | Monitor: CPU, memoria, red, discos, procesos y conexiones por app con mapa; hilo propio solo con la app abierta, sock_diag y país por IP con una base local (ver `MONITOR.md`) |+| `server/src/` (kms, input, canvas) | **M1 done** | Display (KMS), input (evdev), 2D rasterizer |+| `server/src/ui/` | **M2 done** | Nodes, styles, flexbox, text, images, painting, damage, QuickJS |+| `runtime/` | **M2 done** | React renderer (`@lordos/runtime`): reconciler, CSS → native, events |+| `themes/default/` | **M2 done** | Mac-OS-Desktop style theme with our own assets |+| `server/src/ui/js_sys.c` | **M3 done** | System APIs: fs (in `$HOME`), /proc, settings, themes, session |+| `sdk/` | **M3 done** | `@lordos/sdk`: windows, settings, tokens, controls, system hooks |+| `apps/` | **M3 done** | Apps as packages (`manifest.json` + `index.jsx`), independent of the theme |+| `themes/classic/` | **M3 done** | Second theme and template for creating themes |+| `server/src/term/` | **M4 done** | Our own terminal: xterm emulator, PTY, drawing, session holders (see `TERMINAL.md`) |+| `server/src/ui/otf.c`, `fonts.c` | **M4 done** | Our own OpenType (GSUB substitutions, CBDT emoji) and catalog of installed fonts: no HarfBuzz or fontconfig |+| `apps/terminal/` | **M4 done** | iTerm2-style Terminal app (tabs, panes, profiles…) |+| `sdk/i18n.js`, `assets/locales/` | **M5 done** | Text, plurals and formats per language and region (see `LANGUAGES.md`) |+| `server/src/keyboard.c` | **M5 done** | Keyboard with libxkbcommon: every XKB layout, compose |+| `server/src/admin.c` | **M5 done** | Privileged helper with closed actions (region, time zone, language packs) |+| `server/src/ui/bidi.c`, `unicode.c`, `shape.c`, `textlayout.c` | **M5b done** | Full Unicode bidi, Arabic shaping and marks (GSUB/GPOS), per-script font fallback, CJK line breaking, mirrored interface (`direction`) |+| `server/src/ime.c`, `sdk/ime.js` | **M5b done** | Input methods: Korean, Japanese (SKK), Chinese (pinyin) |+| `server/src/app/`, `ui/js_broker.c`, `runtime/app-host.js` | **M8 done** | App mode: each `.lpk` as an isolated process (`lord-server --app <id>`), a Wayland client of the compositor, with a permission broker (see `PRIVACY.md`) |+| `server/src/sec/`, `ui/js_sec.c` | **M8 done** | Isolation of .lpk apps (Landlock+seccomp+cgroup), TCC permissions and Ed25519 signing (see `PRIVACY.md`, `SIGNING.md`) |+| `server/src/wl/`, `sdk/wayland.js` | **M6 done** | Our own Wayland compositor on libwayland-server: GTK and Qt apps as theme windows (see `WAYLAND.md`) |+| `server/src/tp/`, `wl/wl_input.c`, `js_input.c`, `sdk/trackpad.js` | **done (VM, uinput)** | Our own touchpad and touchscreen driver on evdev (no libinput): pointer acceleration, tap, finger clicks, palm rejection, kinetic scrolling, pinch, swipe; gestures and touches for Wayland apps (see `TRACKPAD.md`) |+| `server/src/doc/`, `js_doc.c`, `apps/pdf`, `apps/fonts`, `apps/characters` | **M9** | Documents: the sandboxed helper `lord-doc` (Poppler, libarchive, FreeType) and its apps: PDF Viewer, archives and Quick Look in Files, Fonts, Emoji & Symbols (see `DOCUMENTS.md`) |+| `server/src/print/`, `js_print.c`, `sdk/printdialog.jsx`, `apps/scanner` | **M9** | Printing: our own IPP client against CUPS, our own mDNS, eSCL scanners, the system print dialog (see `PRINTING.md`) |+| `server/src/media/`, `js_media.c`, `sdk/media.js`, `apps/{photos,player,screenshots,camera,recorder}` | **M9** | Media: the sandboxed helper `lord-media` (FFmpeg, libva) and the Photos, Player, Screenshots, Camera and Recorder apps; `media` node, audio over shared memory with the PipeWire stream in lord-server, protected windows in screenshots, recording and remote desktop (see `MEDIA.md`) |+| `server/src/netperm/`, `server/src/fw/`, `js_fw.c` | **M8** | Per-app firewall: the root service `lord-netperm` enforces the rules with cgroup BPF in the sessions; Rule column in the Monitor and Trusted / Restricted apps in Settings (see `FIREWALL.md`) |+| `server/src/monitor/`, `js_monitor.c`, `apps/monitor/` | **M8** | Monitor: CPU, memory, network, disks, processes and per-app connections with a map; its own thread only while the app is open, sock_diag and country by IP from a local database (see `MONITOR.md`) || `server/src/vault/`, `js_vault.c`, `sdk/vault.js`, `apps/passwords` | **M9** | Passwords and the system keyring: the sandboxed helper `lord-vault` (Monocypher: XChaCha20-Poly1305, Argon2id), own `.lvault` format, FIDO2/CTAP2 client, session keyring opened at login, Secret Service on D-Bus with own code (see `PASSWORDS.md`) || `server/src/net/netd.c`, `remote/netsup.c` | **M9** | `lord-netd`: the network belongs to the system. A root service started and supervised by `lord-sessiond` at boot, serving the `net-*` actions for every session (see `NETWORK.md`) || `server/src/disk/`, `js_disk.c`, `sdk/disks.js`, `apps/disks` | **M9** | Disks: listing without root (sysfs, udev database, mountinfo), our own SMART reader (ATA PASS-THROUGH over SG_IO, NVMe health log), closed `disk-*` actions, bootable USB verified with SHA-256 (see `SYSTEM.md`) |@@ -58,67 +58,67 @@ que React Native pero sobre nuestro servidor gráfico.| `server/src/backup/`, `js_backup.c`, `sdk/backup.js`, `apps/backup` | **M9** | Backups: hard-link snapshots in a lord-server thread (nice 19, idle I/O), hourly/daily/weekly retention, optional encryption with the vendored Monocypher; no root and no `admin.c` actions (see `SYSTEM.md`) || `server/src/logs/`, `js_logs.c`, `sdk/logs.js`, `apps/logs` | **M9** | Logs: our own systemd journal reader (no libsystemd), LordOS logs, system logs for admins through a closed action, live follow with inotify (see `SYSTEM.md`) || `server/src/ui/tzif.c`, `js_help.c`, `sdk/{notify,alarms,statusitems,help}.js`, `apps/{clock,help}` | **M9** | Clock (our own TZif reader, session alarms with the app closed), session notifications, menu-bar status items, Help (markdown articles in es/en/pt, welcome tour, Spotlight source) (see `SYSTEM.md`) |-| `server/src/ui/grab.c`, `cursor.c`, `sdk/windowshell.jsx` | **M8** | Ventanas: mover y agrandar en C (un evento por cuadro, sin JS), capa de la ventana que se mueve, bordes en los 4 lados y esquinas, cursores propios y `cursor-shape-v1` (ver `WINDOWS.md`) |+| `server/src/ui/grab.c`, `cursor.c`, `sdk/windowshell.jsx` | **M8** | Windows: moving and resizing in C (one event per frame, no JS), a layer for the window being moved, edges on all 4 sides and corners, our own cursors and `cursor-shape-v1` (see `WINDOWS.md`) || `server/src/outputs.c`, `kms.c`, `hw/display.c`, `ui/paint.c` (`paint_view`) | **M9** | Several displays (extend and mirror, arrangement by EDID identity, hotplug) and sharp HiDPI at 100–200 % per display: one logical space, each display painted at its own resolution; one `wl_output` per display, xdg-output, fractional-scale-v1 (see `DISPLAYS.md`) || `server/src/hw/`, `ui/js_hw.c`, `sdk/hardware.jsx`, `sdk/defaults.js` | **M9** | Settings' hardware pages: displays (EDID, live modes with a 15 s revert, per-display persistence, software rotation and 200 % scale, Night Shift on the gamma LUT or by software), Bluetooth (BlueZ over our own D-Bus client, pairing agent), battery and power profiles, idle (DPMS, lock, sleep), date and time, notifications from Linux apps (`org.freedesktop.Notifications`) and default apps (`mimeapps.list`); kernel uevents and D-Bus signals, no polling (see `SETTINGS.md`) |-### Flujo de un frame+### Flow of a frame-1. Llega un evento (evdev) → `hit_test` busca el nodo bajo el cursor → `__lordEvent` en JS.-2. React actualiza estado → el reconciler llama `lord.setStyle/appendChild/...` → nodos marcados.-3. `lord-server` recalcula el layout, calcula la región dañada y repinta solo esa región.-4. Copia la escena al back buffer, dibuja el cursor, page flip en el próximo vblank.+1. An event arrives (evdev) → `hit_test` finds the node under the cursor → `__lordEvent` in JS.+2. React updates state → the reconciler calls `lord.setStyle/appendChild/...` → nodes are marked.+3. `lord-server` recomputes the layout, computes the damaged region and repaints only that region.+4. It copies the scene to the back buffer, draws the cursor, and page-flips on the next vblank.-## Política de dependencias+## Dependency policy-Solo se permite, además del kernel y la libc:+Besides the kernel and libc, only these are allowed:-| Dependencia | Por qué | Cómo |+| Dependency | Why | How ||----------------------|---------------------------------------------------------------|------------|-| headers del kernel | ioctls DRM / evdev | sistema |-| `libwayland-server` | serializa el protocolo Wayland que GTK/Qt hablan (M6, en uso) | sistema |-| `libwayland-client` | el «modo app» (`lord-server --app <id>`): cada app `.lpk` aislada es un cliente Wayland del compositor (M8); misma familia y paquete fuente que `libwayland-server` | sistema |-| `libxkbcommon` | distribuciones de teclado de XKB (M5) y lo que las apps Wayland exigen (M6) | sistema |-| Mesa: `libgbm`, `libEGL`, `libGLESv2` | composición por GPU y búferes dmabuf de las apps (juegos); opcional: sin GPU con 3D o sin los `-dev` se compila y corre sin Mesa (aprobado por el usuario el 2026-10-16, ver `GPU.md`) | sistema |-| QuickJS | motor JavaScript ES2023, ~1 MB, escrito en C | vendorizado|-| `stb_truetype`, `stb_image` | fuentes e imágenes; dominio público, un solo header | vendorizado|-| `stb_image_write` | PNG y JPEG del escritorio remoto (solo `lord-sessiond`); dominio público | vendorizado|-| OpenSSL (`libssl`, `libcrypto`) | TLS. **Only two binaries link it**: `lord-sessiond` (remote desktop on the LAN, `REMOTE.md`) and `lord-maild` (IMAP/SMTP/CalDAV/CardDAV, certificates checked against the system CA store, `MAIL.md`). Never `lord-server` | sistema |-| `libcrypt` | verificar contraseñas contra `/etc/shadow` (`lord-sessiond`, `admin.c`) | sistema |-| FFmpeg (`libavcodec`, `libavformat`, `libavutil`, `libswscale`, `libswresample`) y `libva` (+ `libva-drm`) | Decodificar y codificar video, audio e imágenes; VA-API para decodificar por hardware (M9, aprobados por el usuario). **Solo los enlaza `lord-media`**, el ayudante encerrado; el reproductor, la sincronización y la interfaz son propios. Nunca `lord-server` (`MEDIA.md`) | sistema |-| Poppler (`libpoppler-glib`) y libarchive | PDF y comprimidos (M9, aprobados por el usuario). **Solo los enlaza `lord-doc`**, el ayudante encerrado; con Poppler vienen cairo, FreeType y fontconfig, que `lord-doc` también usa para las muestras de fuentes y para armar PDF. Nunca `lord-server` (`DOCUMENTS.md`) | sistema |-| `clang` (solo al compilar) | los programas BPF de `lord-netperm` (`np.bpf.c`, `clang -target bpf`); van adentro del binario. Sin clang (`BPF=0`) el servicio corre sin BPF. No se usa libbpf ni bcc | máquina que compila |-| Monocypher 4.0.2 | XChaCha20-Poly1305, Argon2id/Argon2d, BLAKE2b, ChaCha20 for the Passwords vault and the KeePass importer (approved by the user; CC0/BSD-2, one C file). **Only `lord-vault` links it**; its official test vectors run in `make test` (`PASSWORDS.md`) | vendorizado |+| kernel headers | DRM / evdev ioctls | system |+| `libwayland-server` | serializes the Wayland protocol that GTK/Qt speak (M6, in use) | system |+| `libwayland-client` | "app mode" (`lord-server --app <id>`): each isolated `.lpk` app is a Wayland client of the compositor (M8); same family and source package as `libwayland-server` | system |+| `libxkbcommon` | XKB keyboard layouts (M5) and what Wayland apps require (M6) | system |+| Mesa: `libgbm`, `libEGL`, `libGLESv2` | GPU composition and dmabuf buffers from apps (games); optional: without a 3D GPU or without the `-dev` packages it builds and runs without Mesa (approved by the user on 2026-10-16, see `GPU.md`) | system |+| QuickJS | ES2023 JavaScript engine, ~1 MB, written in C | vendored|+| `stb_truetype`, `stb_image` | fonts and images; public domain, a single header | vendored|+| `stb_image_write` | PNG and JPEG for the remote desktop (`lord-sessiond` only); public domain | vendored|+| OpenSSL (`libssl`, `libcrypto`) | TLS. **Only two binaries link it**: `lord-sessiond` (remote desktop on the LAN, `REMOTE.md`) and `lord-maild` (IMAP/SMTP/CalDAV/CardDAV, certificates checked against the system CA store, `MAIL.md`). Never `lord-server` | system |+| `libcrypt` | verifying passwords against `/etc/shadow` (`lord-sessiond`, `admin.c`) | system |+| FFmpeg (`libavcodec`, `libavformat`, `libavutil`, `libswscale`, `libswresample`) and `libva` (+ `libva-drm`) | Decoding and encoding video, audio and images; VA-API for hardware decoding (M9, approved by the user). **Only `lord-media` links them**, the sandboxed helper; the player, synchronization and interface are our own. Never `lord-server` (`MEDIA.md`) | system |+| Poppler (`libpoppler-glib`) and libarchive | PDF and archives (M9, approved by the user). **Only `lord-doc` links them**, the sandboxed helper; Poppler brings cairo, FreeType and fontconfig, which `lord-doc` also uses for font samples and for building PDFs. Never `lord-server` (`DOCUMENTS.md`) | system |+| `clang` (build time only) | the BPF programs of `lord-netperm` (`np.bpf.c`, `clang -target bpf`); they are embedded in the binary. Without clang (`BPF=0`) the service runs without BPF. Neither libbpf nor bcc is used | build machine |+| Monocypher 4.0.2 | XChaCha20-Poly1305, Argon2id/Argon2d, BLAKE2b, ChaCha20 for the Passwords vault and the KeePass importer (approved by the user; CC0/BSD-2, one C file). **Only `lord-vault` links it**; its official test vectors run in `make test` (`PASSWORDS.md`) | vendored || EFF word list, 10k common passwords | passphrase generator and the offline "breached" check (CC BY 3.0 US / MIT), embedded in `lord-vault` | `third_party/wordlists` |-| Inter, JetBrains Mono | fuentes de la interfaz y de la terminal (OFL) | `assets/fonts` |+| Inter, JetBrains Mono | interface and terminal fonts (OFL) | `assets/fonts` |-React (`react`, `react-reconciler`) es dependencia **del tema**, no del sistema: se empaqueta-con esbuild dentro del `.js` del tema. Desde 0.7.0 es React 19.3.1 con `react-reconciler` 0.34-(el tema por defecto pesa 367 KB con todas las apps; React 18 eran ~40 KB menos). Node.js solo se-usa en la máquina de desarrollo.+React (`react`, `react-reconciler`) is a dependency **of the theme**, not of the system: it is bundled+with esbuild inside the theme's `.js`. Since 0.7.0 it is React 19.3.1 with `react-reconciler` 0.34+(the default theme weighs 367 KB with all the apps; React 18 was ~40 KB less). Node.js is only+used on the development machine.-Desde M8 hay dos programas, y desde M9 dos ayudantes:+Since M8 there are two programs, and since M9 two helpers:- **`lord-netd`** (M9, root): the system network, started and supervised by `lord-sessiond` at boot;only the `net-*` actions of `admin.c`. libc only. See `NETWORK.md`.-- **`lord-sessiond`** (root, `lordos.service`): la pantalla de ingreso, la lista de sesiones, el- monitor y el escritorio remoto. Ver `SESSIONS.md` y `REMOTE.md`.-- **`lord-server`**: una sesión por usuario, siempre sin monitor propio (`--headless`); el- monitor y los navegadores la miran por su socket.-- **`lord-netperm`** (root, `lord-netperm.service`): los permisos de red por app. Engancha sus- programas BPF de cgroup en `lordos.service` y lee las reglas de cada usuario. Sin red propia ni- ejecución. Ver `FIREWALL.md`.--- **`lord-doc`** (M9): el ayudante de documentos. Lo lanza `lord-server` cuando hace falta, con- ruta fija (al lado de su binario) y sin argumentos. Corre como el usuario, sin red y encerrado- (Landlock + seccomp), y trabaja solo con los fds que le pasa `lord-server`. Abre PDF,- comprimidos, fuentes e imágenes que llegan de afuera. Ver `DOCUMENTS.md`.-- **`lord-media`** (M9): el ayudante de medios, igual que `lord-doc`: ruta fija, sin argumentos,- como el usuario, sin red ni archivos (solo los fds que le pasa `lord-server`, incluidos la- cámara y el render node), en `sandbox_apply_helper`. Decodifica y codifica con FFmpeg; los- cuadros vuelven por memoria compartida sellada y el audio va a un anillo cuyo stream de- PipeWire es de `lord-server`. Ver `MEDIA.md`.+- **`lord-sessiond`** (root, `lordos.service`): the login screen, the session list, the+ monitor and the remote desktop. See `SESSIONS.md` and `REMOTE.md`.+- **`lord-server`**: one session per user, always without a monitor of its own (`--headless`); the+ monitor and the browsers look at it through its socket.+- **`lord-netperm`** (root, `lord-netperm.service`): per-app network permissions. It attaches its+ cgroup BPF programs to `lordos.service` and reads each user's rules. No network of its own and no+ execution. See `FIREWALL.md`.++- **`lord-doc`** (M9): the documents helper. `lord-server` launches it when needed, with a+ fixed path (next to its binary) and no arguments. It runs as the user, without network and sandboxed+ (Landlock + seccomp), and works only with the fds `lord-server` passes it. It opens PDFs,+ archives, fonts and images that come from outside. See `DOCUMENTS.md`.+- **`lord-media`** (M9): the media helper, just like `lord-doc`: fixed path, no arguments,+ as the user, no network or files (only the fds `lord-server` passes it, including the+ camera and the render node), in `sandbox_apply_helper`. It decodes and encodes with FFmpeg; the+ frames come back through sealed shared memory and the audio goes to a ring whose PipeWire+ stream belongs to `lord-server`. See `MEDIA.md`.- **`lord-vault`** (M9): the Passwords and keyring helper. Same rules as `lord-doc`/`lord-media`(fixed path, no arguments, minimal environment, `sandbox_apply_helper`: no network, no new@@ -135,128 +135,128 @@ Desde M8 hay dos programas, y desde M9 dos ayudantes:of the accounts file (or, after *Load Images*, to public addresses for remote images) and passesthe connected fd. Its only writable folder is its cache. See `MAIL.md`.-`lord-server` sigue pudiendo correr solo, con DRM y evdev propios, para el desarrollo.+`lord-server` can still run on its own, with its own DRM and evdev, for development.-Datos que vienen con LordOS para el Monitor (`MONITOR.md`): `assets/monitor/geoip-country.mmdb.xz`-(DB-IP Lite Country, CC BY 4.0, leída por un lector propio de MaxMind DB) y el mapa de Natural-Earth (dominio público). No se usa libmaxminddb.+Data shipped with LordOS for the Monitor (`MONITOR.md`): `assets/monitor/geoip-country.mmdb.xz`+(DB-IP Lite Country, CC BY 4.0, read by our own MaxMind DB reader) and the Natural+Earth map (public domain). libmaxminddb is not used.-Datos del sistema que se leen (no se enlazan): `xkb-data` (distribuciones), `libx11-data`-(solo las tablas de compose de `/usr/share/X11/locale`), `locales` y `tzdata`.+System data that is read (not linked): `xkb-data` (layouts), `libx11-data`+(only the compose tables in `/usr/share/X11/locale`), `locales` and `tzdata`.-Las fuentes del sistema (por ejemplo `fonts-noto-color-emoji` para emoji o Fira Code) son-opcionales: si están, la Terminal las ofrece; no se enlaza HarfBuzz, FreeType ni fontconfig.+System fonts (for example `fonts-noto-color-emoji` for emoji, or Fira Code) are+optional: if present, the Terminal offers them; HarfBuzz, FreeType and fontconfig are not linked.-Desde M7, lo que LordOS hace con código propio y lo que delega en un programa de Debian:+Since M7, what LordOS does with its own code and what it delegates to a Debian program:-- **Código propio, sin librerías:**- - OpenPGP (RSA, Ed25519), SHA-256/512, xz, HTTP y el resolvedor de dependencias (`server/src/pkg`);- - la caja de arena, los permisos y la firma de las apps `.lpk` (`server/src/sec`): Landlock,- seccomp, cgroup v2, Ed25519 (firmar y verificar) y un lector de JSON, sin librerías externas;- - el intérprete WebAssembly (`server/src/wasm`);- - el cliente del protocolo de PulseAudio (`server/src/sound`);- - netlink, DHCP y WireGuard (`server/src/net`);- - el cliente IPP de CUPS, mDNS/DNS-SD y eSCL (`server/src/print`, M9): sin libcups, avahi-client- ni SANE.-- **Servicios de Debian a los que se les habla por su protocolo:** CUPS (IPP por- `/run/cups/cups.sock`; administra la cola y los controladores, ver `PRINTING.md`).+- **Our own code, no libraries:**+ - OpenPGP (RSA, Ed25519), SHA-256/512, xz, HTTP and the dependency resolver (`server/src/pkg`);+ - the sandbox, permissions and signing of `.lpk` apps (`server/src/sec`): Landlock,+ seccomp, cgroup v2, Ed25519 (signing and verifying) and a JSON reader, with no external libraries;+ - the WebAssembly interpreter (`server/src/wasm`);+ - the PulseAudio protocol client (`server/src/sound`);+ - netlink, DHCP and WireGuard (`server/src/net`);+ - the CUPS IPP client, mDNS/DNS-SD and eSCL (`server/src/print`, M9): no libcups, avahi-client+ or SANE.+- **Debian services spoken to over their protocol:** CUPS (IPP over+ `/run/cups/cups.sock`; it manages the queue and the drivers, see `PRINTING.md`).- **D-Bus services (Settings, `SETTINGS.md`):** BlueZ (`bluetoothd`), power-profiles-daemon andsystemd-timedated on the system bus, with our own D-Bus client (`vault/dbus.c`); lord-server alsoserves `org.freedesktop.Notifications` on the session bus. No libdbus, sd-bus or libbluetooth.-- **Programas de Debian** (con ruta fija, nunca enlazados, lanzados por el ayudante `admin.c`):- - `dpkg`: desempaquetar y configurar;+- **Debian programs** (with a fixed path, never linked, launched by the `admin.c` helper):+ - `dpkg`: unpacking and configuring;- `mkfs.vfat`, `mkfs.exfat`, `mkfs.ext4`, `mkfs.ntfs` (optional) and their label tools: formattingand renaming in Disks (M9, `disk-*` actions);- `wpa_supplicant`: Wi-Fi;- `openvpn`;- - `resolvectl` y `networkctl`.+ - `resolvectl` and `networkctl`.- `powerprofilesctl`, `systemctl suspend`/`reload systemd-logind` and `timedatectl` (Settings'closed `power-*` and `time-*` actions, `SETTINGS.md`).-- **Servidor de sonido:** PipeWire, por el protocolo de PulseAudio.+- **Sound server:** PipeWire, over the PulseAudio protocol.-No se usan apt, libapt, gpgv, curl, zlib, liblzma, NetworkManager, wireguard-tools, libpulse,-libpipewire, libcups, avahi-client ni SANE.+apt, libapt, gpgv, curl, zlib, liblzma, NetworkManager, wireguard-tools, libpulse,+libpipewire, libcups, avahi-client and SANE are not used.-Prohibido: X11/Xorg, wlroots, libdrm, libinput, Mesa como requisito (solo como camino GPU opcional), WebKit/Chromium,-GTK/Qt dentro de LordOS; bubblewrap, flatpak, firejail ni libseccomp para el aislamiento (es-código propio con Landlock y seccomp-bpf directos). Vendorizado = copiado como código fuente en `third_party/`.+Forbidden: X11/Xorg, wlroots, libdrm, libinput, Mesa as a requirement (only as the optional GPU path), WebKit/Chromium,+GTK/Qt inside LordOS; bubblewrap, flatpak, firejail or libseccomp for isolation (it is+our own code using Landlock and seccomp-bpf directly). Vendored = copied as source code into `third_party/`.-## Plataformas+## Platforms-| Arquitectura | Equipos | Estado | Imagen |+| Architecture | Machines | Status | Image ||---|---|---|---|-| x86-64 (amd64) | PC con UEFI o BIOS; GPU AMD, Intel o Nvidia, o sin GPU 3D (CPU) | principal, probada en VM | ISO live con instalador (`ISO.md`) |-| ARM64 (aarch64) | **Raspberry Pi 5** (oficial), Pi 4 (mejor esfuerzo); otras placas ARM64 con KMS en Linux | preparada, sin probar en la placa | imagen para SD/NVMe, `tools/rpi/build-img.sh` (`RASPBERRY.md`) |+| x86-64 (amd64) | PC with UEFI or BIOS; AMD, Intel or Nvidia GPU, or no 3D GPU (CPU) | primary, tested on VM | live ISO with installer (`ISO.md`) |+| ARM64 (aarch64) | **Raspberry Pi 5** (official), Pi 4 (best effort); other ARM64 boards with KMS on Linux | ready, not tested on the board | SD/NVMe image, `tools/rpi/build-img.sh` (`RASPBERRY.md`) |-El código es el mismo. Las diferencias:+The code is the same. The differences:-- **Compilación:** el Makefile detecta `ARCH` con `$(CC) -dumpmachine` y nunca usa+- **Build:** the Makefile detects `ARCH` with `$(CC) -dumpmachine` and never uses`-march=native`.- - En aarch64 se activan los bucles NEON de `canvas.c` (`NEON=0` los apaga) y `STBI_NEON`.- - En x86-64 todo es C portable (stb usa SSE2 solo).-- **Pantalla y GPU:**- - La tarjeta se elige por tener conectores (`server/src/drmcard.h`), no por ser `card0`.- - En las placas ARM la pantalla (vc4) y la GPU (v3d) son dispositivos distintos. Mesa los une- (kmsro), lord-server anuncia a las apps el render node de la GPU y solo manda a la pantalla- los modificadores que acepta el plano (`IN_FORMATS`).-- **Páginas de memoria de 16K** (kernel de la Pi 5): nada en LordOS asume 4096.-- **Seccomp:** la lista blanca usa `#ifdef` para los syscalls que arm64 no tiene (`open`, `stat`,+ - On aarch64 the NEON loops in `canvas.c` (`NEON=0` turns them off) and `STBI_NEON` are enabled.+ - On x86-64 everything is portable C (stb uses SSE2 by itself).+- **Display and GPU:**+ - The card is chosen because it has connectors (`server/src/drmcard.h`), not because it is `card0`.+ - On ARM boards the display (vc4) and the GPU (v3d) are different devices. Mesa joins them+ (kmsro), lord-server advertises the GPU's render node to apps and only sends the display+ the modifiers the plane accepts (`IN_FORMATS`).+- **16K memory pages** (the Pi 5 kernel): nothing in LordOS assumes 4096.+- **Seccomp:** the allow list uses `#ifdef` for the syscalls arm64 doesn't have (`open`, `stat`,`epoll_wait`, `pipe`…).-- **Kernel:** en x86-64, el de Debian; en la Raspberry Pi, el del archivo de Raspberry Pi (el de- Debian 13 no maneja la Pi 5). Mesa es la de Debian en las dos.+- **Kernel:** on x86-64, Debian's; on the Raspberry Pi, the one from the Raspberry Pi archive (Debian+ 13's doesn't handle the Pi 5). Mesa is Debian's on both.-## Por qué no un navegador+## Why not a browser-WebKit o Chromium cuestan entre 100 y 300 MB de RAM por proceso y no son propios.-El objetivo de LordOS es correr en máquinas de muy poco rendimiento. Con React sobre un-motor propio, el tema escribe JSX y estilos, pero se renderiza con un subconjunto de CSS-(flexbox, colores, bordes redondeados, sombras, blur, transiciones) que sí controlamos.+WebKit or Chromium cost between 100 and 300 MB of RAM per process and are not our own.+LordOS's goal is to run on very low-end machines. With React on our own+engine, the theme writes JSX and styles, but it is rendered with a subset of CSS+(flexbox, colors, rounded borders, shadows, blur, transitions) that we do control.-## Modelo de temas+## Theme model-Un tema es un paquete JS que exporta componentes React con un contrato fijo:-`Desktop`, `MenuBar`, `Dock`, `Launcher`, `ControlCenter`, `WindowFrame` y sus tokens-(colores, radios, sombras, fuentes, fondo). El tema habla con el servidor solo a través-de `@lordos/sdk` (`useWindows()`, `launch()`, `focus()`, `close()`…), nunca directo.-El tema por defecto replica el estilo de https://github.com/mhmdmhd6/Mac-OS-Desktop con-íconos y fondos propios. Los assets de Apple no se pueden redistribuir.+A theme is a JS package that exports React components with a fixed contract:+`Desktop`, `MenuBar`, `Dock`, `Launcher`, `ControlCenter`, `WindowFrame` and its tokens+(colors, radii, shadows, fonts, wallpaper). The theme talks to the server only through+`@lordos/sdk` (`useWindows()`, `launch()`, `focus()`, `close()`…), never directly.+The default theme replicates the style of https://github.com/mhmdmhd6/Mac-OS-Desktop with+our own icons and wallpapers. Apple's assets cannot be redistributed.-## Capas de JavaScript+## JavaScript layers```-themes/<tema>/ escritorio completo (barras, dock, marcos de ventana) ─┐-apps/<id>/ contenido de cada ventana, independiente del tema ─┤ un solo bundle-sdk/ @lordos/sdk: ventanas, ajustes, tokens, controles ─┤ por tema-runtime/ @lordos/runtime: renderer React, CSS → nativo, eventos ─┘ (esbuild)+themes/<theme>/ full desktop (bars, dock, window frames) ─┐+apps/<id>/ content of each window, independent of the theme ─┤ a single bundle+sdk/ @lordos/sdk: windows, settings, tokens, controls ─┤ per theme+runtime/ @lordos/runtime: React renderer, CSS → native, events ─┘ (esbuild)```-El tema y las apps se comunican por el contrato de tokens (`useTheme`) y el gestor de-ventanas del SDK (`wm`). Cambiar de tema descarta el contexto QuickJS completo y carga el-otro bundle; los ajustes persisten en disco.--## Seguridad--- `lord-server` arranca con sudo solo para abrir DRM, evdev y la consola; enseguida pasa al- usuario de la sesión (`SUDO_USER` o `--user`) conservando únicamente `CAP_SYS_TTY_CONFIG`.-- `lord.fs` es de solo lectura y rechaza rutas que (tras `realpath`) salgan de `$HOME`.-- `lord.settings` solo escribe `~/.config/lordos/settings.json` (máx. 64 KB, escritura atómica).-- `lord.themes.use` solo acepta nombres simples de carpetas en `themes/`; un tema que falla- al cargar queda vetado para evitar bucles.-- No existe API para ejecutar comandos arbitrarios. La única forma de iniciar un proceso es- `lord.term.create()`, que lanza el shell de login del propio usuario (el de `/etc/passwd`)- sin capacidades ni variables `SUDO_*`, igual que cualquier emulador de terminal.-- El portapapeles es de la sesión (en memoria). Los programas de la terminal pueden escribirlo- (OSC 52) pero no leerlo.-- Los `permissions` de los manifests son declarativos hasta que haya aislamiento por app.-- Las apps Wayland externas (M5) solo verán sus propias superficies.-- Los documentos que llegan de afuera (PDF, comprimidos, fuentes, imágenes del escáner) se abren- solo en `lord-doc`, encerrado. Un archivo malicioso puede tirar abajo ese proceso, pero no- `lord-server`. Extraer nunca escribe fuera de la carpeta de destino (`DOCUMENTS.md`, «Extraer- sin salir de la carpeta»).-- Los medios (videos, música, fotos, la cámara) se decodifican solo en `lord-media`, encerrado y- sin el socket de PipeWire. Pantalla, micrófono y cámara piden permiso (`sec/perms.c`, verificado- en C), y las ventanas protegidas (`wm.setProtected`) salen negras en capturas, grabaciones y el- escritorio remoto (`MEDIA.md`).-- Impresoras: administrar las colas (agregar, quitar, predeterminada) lo autoriza CUPS. Solo- pueden los usuarios del grupo `lpadmin` (los administradores), identificados con PeerCred por- el socket unix. No hay ninguna acción de root nueva en `admin.c` (`PRINTING.md`).+The theme and the apps communicate through the token contract (`useTheme`) and the SDK's window+manager (`wm`). Switching themes discards the whole QuickJS context and loads the+other bundle; settings persist on disk.++## Security++- `lord-server` starts with sudo only to open DRM, evdev and the console; right away it switches to the+ session user (`SUDO_USER` or `--user`), keeping only `CAP_SYS_TTY_CONFIG`.+- `lord.fs` is read-only and rejects paths that (after `realpath`) leave `$HOME`.+- `lord.settings` only writes `~/.config/lordos/settings.json` (max. 64 KB, atomic write).+- `lord.themes.use` only accepts plain folder names in `themes/`; a theme that fails+ to load is banned to avoid loops.+- There is no API to run arbitrary commands. The only way to start a process is+ `lord.term.create()`, which launches the user's own login shell (the one in `/etc/passwd`)+ with no capabilities and no `SUDO_*` variables, just like any terminal emulator.+- The clipboard belongs to the session (in memory). Terminal programs can write it+ (OSC 52) but not read it.+- Manifest `permissions` are declarative until there is per-app isolation.+- External Wayland apps (M5) will only see their own surfaces.+- Documents that come from outside (PDFs, archives, fonts, scanner images) are opened+ only in `lord-doc`, sandboxed. A malicious file can bring that process down, but not+ `lord-server`. Extracting never writes outside the destination folder (`DOCUMENTS.md`, «Extracting+ without leaving the folder»).+- Media (videos, music, photos, the camera) are decoded only in `lord-media`, sandboxed and+ without the PipeWire socket. Screen, microphone and camera ask for permission (`sec/perms.c`, checked+ in C), and protected windows (`wm.setProtected`) come out black in screenshots, recordings and the+ remote desktop (`MEDIA.md`).+- Printers: managing queues (add, remove, default) is authorized by CUPS. Only+ users in the `lpadmin` group (the administrators) can do it, identified with PeerCred over+ the unix socket. There is no new root action in `admin.c` (`PRINTING.md`).diff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex 3182e10..da7ede9 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -1,355 +1,355 @@-# Roadmap LordOS+# LordOS roadmap-Cada hito se verifica en la VM `lordos-dev` (ver `VM-SETUP.md`) con capturas reales de-pantalla (`screendump` de QEMU) y se documenta.+Every milestone is verified on the `lordos-dev` VM (see `VM-SETUP.md`) with real+screenshots (QEMU `screendump`) and documented.-## M1 — Servidor gráfico mínimo ✅ (2026-10-15)+## M1 — Minimal display server ✅ (2026-10-15)-- [x] Modesetting propio con ioctls DRM (sin libdrm), doble buffer + page flip.-- [x] Input propio desde evdev (sin libinput): teclado, mouse relativo, tablet absoluto, `EVIOCGRAB`.-- [x] Rasterizador 2D propio: alpha, rectángulos redondeados con antialiasing, sombras.-- [x] Escena de prueba: fondo, barra de menú, dock con magnificación, ventana arrastrable, cursor.-- [x] Medido: 1280×800, render completo por CPU ≈ 13 ms/frame en la VM.+- [x] Our own modesetting with DRM ioctls (no libdrm), double buffering + page flip.+- [x] Our own input from evdev (no libinput): keyboard, relative mouse, absolute tablet, `EVIOCGRAB`.+- [x] Our own 2D rasterizer: alpha, antialiased rounded rectangles, shadows.+- [x] Test scene: wallpaper, menu bar, dock with magnification, draggable window, cursor.+- [x] Measured: 1280×800, full CPU render ≈ 13 ms/frame on the VM.-## M2 — Motor de UI con React ✅ (2026-10-15)+## M2 — UI engine with React ✅ (2026-10-15)-- [x] QuickJS 2025-04-26 vendorizado en `third_party/quickjs`, embebido en `lord-server`.-- [x] Árbol de nodos nativo (`View`, `Text`, `Image`) + estilos (subconjunto CSS, ver `themes/README.md`).-- [x] Layout flexbox propio (`server/src/ui/layout.c`).-- [x] Texto con `stb_truetype` y fuente Inter (OFL); imágenes PNG/JPEG con `stb_image`.-- [x] Renderer de React 18 (`runtime/`, `react-reconciler` 0.29) que crea y actualiza nodos nativos.-- [x] Eventos de mouse con burbujeo (enter/leave/click), teclado, timers, `requestAnimationFrame`.-- [x] Tema "Lord Default": barra de menú con blur, dock con magnificación y tooltip, ventanas- arrastrables con semáforo, apps Archivos/Ajustes/Acerca de, modo claro/oscuro y acentos en vivo.-- [x] Sombras cacheadas, blur a resolución reducida, damage tracking.+- [x] QuickJS 2025-04-26 vendored in `third_party/quickjs`, embedded in `lord-server`.+- [x] Native node tree (`View`, `Text`, `Image`) + styles (a CSS subset, see `themes/README.md`).+- [x] Our own flexbox layout (`server/src/ui/layout.c`).+- [x] Text with `stb_truetype` and the Inter font (OFL); PNG/JPEG images with `stb_image`.+- [x] React 18 renderer (`runtime/`, `react-reconciler` 0.29) that creates and updates native nodes.+- [x] Mouse events with bubbling (enter/leave/click), keyboard, timers, `requestAnimationFrame`.+- [x] "Lord Default" theme: menu bar with blur, dock with magnification and tooltip, draggable+ windows with traffic lights, Files/Settings/About apps, light/dark mode and live accents.+- [x] Cached shadows, reduced-resolution blur, damage tracking.-Medido en la VM (1280×800, CPU, sin GPU):+Measured on the VM (1280×800, CPU, no GPU):-| Situación | Render |+| Situation | Render ||---|---|-| Primer frame (pantalla completa) | ~65 ms |-| Hover en menú | 0,3–0,6 ms |-| Hover en dock con magnificación | 2–4 ms |-| Arrastrar ventana | ~5 ms |-| RAM total del servidor (con tema React) | ~24 MB |-| Carga del tema (126 KB, React incluido) | ~28 ms |+| First frame (full screen) | ~65 ms |+| Menu hover | 0.3–0.6 ms |+| Dock hover with magnification | 2–4 ms |+| Window drag | ~5 ms |+| Total server RAM (with React theme) | ~24 MB |+| Theme load (126 KB, React included) | ~28 ms |-Pendiente para más adelante: radios por esquina, `transform: scale`, entrada de-texto (teclado → caracteres según layout), copiar al back buffer solo la región dañada.+Left for later: per-corner radii, `transform: scale`, text+input (keyboard → characters per layout), copying only the damaged region to the back buffer.-## M3 — SDK, apps como paquetes y temas intercambiables ✅ (2026-10-15)+## M3 — SDK, apps as packages and swappable themes ✅ (2026-10-15)-- [x] Seguridad: `lord-server` suelta root tras abrir pantalla/input; corre como el usuario con- solo `CAP_SYS_TTY_CONFIG` (verificado en `/proc/<pid>/status`).-- [x] APIs nativas: `lord.fs` (solo lectura, encerrado en `$HOME`), `lord.system` (/proc),+- [x] Security: `lord-server` drops root after opening the display/input; it runs as the user with+ only `CAP_SYS_TTY_CONFIG` (verified in `/proc/<pid>/status`).+- [x] Native APIs: `lord.fs` (read-only, confined to `$HOME`), `lord.system` (/proc),`lord.settings` (`~/.config/lordos/settings.json`), `lord.themes`, `lord.quit`.-- [x] Input: clic derecho, rueda, doble clic; teclado con distribuciones `latam` y `us`,- tildes con tecla muerta, keypad.-- [x] `@lordos/sdk` (`sdk/`): gestor de ventanas, ajustes persistentes, contrato de tokens- (`ThemeProvider`/`useTheme`), `TextInput`, `ScrollView`, controles, hooks de sistema.-- [x] Apps como paquetes (`apps/<id>/manifest.json`): Archivos (FS real), Ajustes, Acerca de- (datos reales), Calculadora, Terminal (aviso M4).-- [x] Tema "Lord Default": Launchpad con búsqueda, Centro de control (CPU/RAM en vivo),- menús desplegables, menú contextual, 4 fondos propios.-- [x] Tema "Clásico" como plantilla (barra de tareas + menú de inicio, un solo archivo).-- [x] Cambio de tema en vivo desde Ajustes, persistente, con protección ante temas rotos.--Medido en la VM: RAM del servidor 24–26 MB con Lord Default, 11 MB con Clásico; cambio de-tema ~30 ms + primer frame ~60 ms.--Pendiente de M3 que pasa a más adelante: volumen y brillo (no hay audio ni backlight en la VM),-aislamiento real de apps por permisos, entorno de desarrollo en el navegador del Mac.--## M4 — Terminal nativa estilo iTerm2 ✅ (2026-10-15)--Se adelantó a Wayland por pedido del proyecto: la terminal de LordOS es propia, no una app-Linux. Detalle completo, atajos y tabla de paridad con iTerm2 en `TERMINAL.md`.--- [x] Motor en C (`server/src/term/`): emulador xterm-256color (parser VT500, color directo,- pantalla alternativa, mouse, pegado entre corchetes, salida sincronizada), historia con- reflujo, PTY sin privilegios, dibujo con daño por filas, cajas/bloques/powerline a mano.-- [x] Extensiones de iTerm2: imágenes en línea (`imgcat`), insignias, marcas, integración con- bash (OSC 133/7), Sixel, hipervínculos OSC 8, OSC 52, notificaciones OSC 9.-- [x] App React: pestañas, paneles divididos, perfiles con 16 esquemas, transparencia y- desenfoque, buscador con regex, toolbelt, barra de estado, ventana desplegable (F12),- modo copia, Instant Replay, disparadores, cambio automático de perfil, disposiciones- guardadas, deshacer cierre, compositor, autocompletar, historial de comandos y pegado.-- [x] Plataforma: varias ventanas por app, título dinámico, menús de la app en la barra del- tema, confirmación al cerrar, argumentos al abrir apps, redimensionar ventanas,- componente `<Terminal>`, portapapeles de la sesión, `Stepper` y `Slider`.--- [x] Completada la paridad con iTerm2: elección de fuente y fuente "no ASCII",- ligaduras (motor GSUB propio, `server/src/ui/otf.c`), emoji a color (CBDT), caracteres- combinantes y grafemas (modo 2027), integración con zsh y fish, atajos y teclas- configurables, cambio de perfil por usuario@host, disparadores de resaltar/marca/título,- sesiones que sobreviven a un reinicio del servidor (guardianes, `term/hold.c`),- `tmux -CC` con pestañas y paneles nativos, e **importación de perfiles de iTerm2**- (JSON, `.itermcolors`, plist XML y binario).--Medido en la VM: `seq 1 1000000` en 2,1 s con transparencia; RAM del servidor ~39 MB con-3 terminales, ~43 MB con 6 sesiones + 3 paneles de tmux + emoji; ~2,2 MB por guardián.-Lo que queda fuera (imagen de fondo, emoji COLR/SVG, GPOS) está en `TERMINAL.md`.--## M5 — Idioma y región (todo el sistema) ✅ (2026-10-15)--Detalle en `LANGUAGES.md`. Va antes de Wayland para que las apps GTK/Qt reciban el mismo idioma.--- [x] Región del sistema por usuario (`~/.config/locale.conf`) heredada por la sesión y los- shells; mensajes de Debian (gettext) en el idioma elegido (verificado con `ls`, `date`, `printf`).-- [x] Interfaz: catálogos por espacio (`assets/locales/<idioma>/*.json`), `t()`/`useLocale()`,- plurales (reglas CLDR propias), fechas y números por región; cambio en vivo sin perder- ventanas ni terminales; respaldo en inglés. 391 claves.-- [x] Español, inglés y portugués completos; `tools/i18n-check.mjs` y `tools/i18n-pack.mjs`;- paquete de prueba en francés instalado desde Ajustes.-- [x] Paquetes de idioma: catálogos de LordOS (usuario, sin root) + región de glibc + paquetes- de Debian del idioma (manpages, hunspell, aspell, hyphen, mythes, fuentes de la escritura).-- [x] Teclado con libxkbcommon + xkb-data: todas las distribuciones y variantes, hasta 4 a la- vez, teclas muertas y compose.-- [x] Zona horaria y región del sistema desde Ajustes.-- [x] Ayudante privilegiado mínimo (`server/src/admin.c`) con acciones cerradas, aprobado.--## M5b — Escrituras complejas ✅ (2026-10-15)--Detalle en `LANGUAGES.md` → "Escrituras complejas". Sin HarfBuzz, fribidi, ICU, ibus ni fcitx.--- [x] Bidi de Unicode completo (UAX #9): 91.707/91.707 casos de `BidiCharacterTest.txt`.-- [x] Formas contextuales del árabe, ligaduras, marcas, cursivo (nastaliq), shaper índico- (9 escrituras) y tailandés/laosiano: 217/217 frases idénticas a HarfBuzz.-- [x] Respaldo de fuentes por escritura en la interfaz y la terminal (Noto; CJK según el idioma).-- [x] Corte de línea para chino y japonés.-- [x] Interfaz espejada para idiomas RTL (`direction` como en CSS, `textAlign` start/end),- probada en árabe con los dos temas.-- [x] Métodos de entrada: coreano (hangul), japonés (romaji → kana + SKK, conversión por- frase con segmentos), chino (pinyin con abreviaturas); en la terminal y en campos de texto.-- [x] Terminal: árabe y hebreo en orden visual y escrituras complejas armadas (opción por perfil).-- [x] Shapers de jemer y birmano y el Universal Shaping Engine (tibetano, cingalés, balinés,- javanés, mongol y ~80 escrituras más): con lo anterior, 409/409 frases idénticas a HarfBuzz+- [x] Input: right click, wheel, double click; keyboard with `latam` and `us` layouts,+ accents with dead keys, keypad.+- [x] `@lordos/sdk` (`sdk/`): window manager, persistent settings, token contract+ (`ThemeProvider`/`useTheme`), `TextInput`, `ScrollView`, controls, system hooks.+- [x] Apps as packages (`apps/<id>/manifest.json`): Files (real FS), Settings, About+ (real data), Calculator, Terminal (M4 notice).+- [x] "Lord Default" theme: Launchpad with search, Control Center (live CPU/RAM),+ drop-down menus, context menu, 4 wallpapers of our own.+- [x] "Classic" theme as a template (taskbar + start menu, a single file).+- [x] Live theme switching from Settings, persistent, with protection against broken themes.++Measured on the VM: server RAM 24–26 MB with Lord Default, 11 MB with Classic; theme+switch ~30 ms + first frame ~60 ms.++Left over from M3 and moved to later: volume and brightness (no audio or backlight on the VM),+real per-app isolation by permissions, a development environment in the Mac's browser.++## M4 — Native iTerm2-style terminal ✅ (2026-10-15)++Moved ahead of Wayland at the project's request: the LordOS terminal is our own, not a Linux+app. Full details, shortcuts and the iTerm2 parity table in `TERMINAL.md`.++- [x] C engine (`server/src/term/`): xterm-256color emulator (VT500 parser, direct color,+ alternate screen, mouse, bracketed paste, synchronized output), scrollback with+ reflow, unprivileged PTY, drawing with per-row damage, hand-drawn boxes/blocks/powerline.+- [x] iTerm2 extensions: inline images (`imgcat`), badges, marks, bash+ integration (OSC 133/7), Sixel, OSC 8 hyperlinks, OSC 52, OSC 9 notifications.+- [x] React app: tabs, split panes, profiles with 16 color schemes, transparency and+ blur, regex search, toolbelt, status bar, hotkey window (F12),+ copy mode, Instant Replay, triggers, automatic profile switching, saved+ arrangements, undo close, composer, autocomplete, command and paste history.+- [x] Platform: several windows per app, dynamic title, app menus in the theme's+ bar, confirmation on close, arguments when opening apps, window resizing,+ `<Terminal>` component, session clipboard, `Stepper` and `Slider`.++- [x] iTerm2 parity completed: font choice and "non-ASCII" font,+ ligatures (our own GSUB engine, `server/src/ui/otf.c`), color emoji (CBDT), combining+ characters and graphemes (mode 2027), zsh and fish integration, configurable shortcuts and+ keys, profile switching by user@host, highlight/mark/title triggers,+ sessions that survive a server restart (holders, `term/hold.c`),+ `tmux -CC` with native tabs and panes, and **iTerm2 profile import**+ (JSON, `.itermcolors`, XML and binary plist).++Measured on the VM: `seq 1 1000000` in 2.1 s with transparency; server RAM ~39 MB with+3 terminals, ~43 MB with 6 sessions + 3 tmux panes + emoji; ~2.2 MB per holder.+What is left out (background image, COLR/SVG emoji, GPOS) is in `TERMINAL.md`.++## M5 — Language and region (system-wide) ✅ (2026-10-15)++Details in `LANGUAGES.md`. It comes before Wayland so GTK/Qt apps receive the same language.++- [x] Per-user system region (`~/.config/locale.conf`) inherited by the session and the+ shells; Debian messages (gettext) in the chosen language (verified with `ls`, `date`, `printf`).+- [x] Interface: catalogs per namespace (`assets/locales/<language>/*.json`), `t()`/`useLocale()`,+ plurals (our own CLDR rules), dates and numbers per region; live switching without losing+ windows or terminals; English fallback. 391 keys.+- [x] Spanish, English and Portuguese complete; `tools/i18n-check.mjs` and `tools/i18n-pack.mjs`;+ test French pack installed from Settings.+- [x] Language packs: LordOS catalogs (user, no root) + glibc region + the language's Debian+ packages (manpages, hunspell, aspell, hyphen, mythes, fonts for the script).+- [x] Keyboard with libxkbcommon + xkb-data: every layout and variant, up to 4 at+ once, dead keys and compose.+- [x] System time zone and region from Settings.+- [x] Minimal privileged helper (`server/src/admin.c`) with closed actions, approved.++## M5b — Complex scripts ✅ (2026-10-15)++Details in `LANGUAGES.md` → "Complex scripts". No HarfBuzz, fribidi, ICU, ibus or fcitx.++- [x] Full Unicode bidi (UAX #9): 91,707/91,707 cases of `BidiCharacterTest.txt`.+- [x] Arabic contextual forms, ligatures, marks, cursive (nastaliq), Indic shaper+ (9 scripts) and Thai/Lao: 217/217 sentences identical to HarfBuzz.+- [x] Per-script font fallback in the interface and the terminal (Noto; CJK by language).+- [x] Line breaking for Chinese and Japanese.+- [x] Mirrored interface for RTL languages (`direction` as in CSS, `textAlign` start/end),+ tested in Arabic with both themes.+- [x] Input methods: Korean (hangul), Japanese (romaji → kana + SKK, phrase+ conversion with segments), Chinese (pinyin with abbreviations); in the terminal and in text fields.+- [x] Terminal: Arabic and Hebrew in visual order and shaped complex scripts (per-profile option).+- [x] Khmer and Myanmar shapers and the Universal Shaping Engine (Tibetan, Sinhala, Balinese,+ Javanese, Mongolian and ~80 more scripts): with the above, 409/409 sentences identical to HarfBuzz(2026-10-16).-- [x] Corte de línea del tailandés por palabras con el diccionario de libthai-data y lector- propio (igual a libthai en 705/705 párrafos de prueba); jemer y birmano por sílaba (2026-10-16).-- [ ] Pendiente: laosiano por palabras, restricciones de vocales con ◌, japonés con frecuencias.+- [x] Thai word-based line breaking with the libthai-data dictionary and our own+ reader (identical to libthai on 705/705 test paragraphs); Khmer and Myanmar by syllable (2026-10-16).+- [ ] Pending: Lao by words, vowel constraints with ◌, Japanese with frequencies.-## M6 — Compatibilidad con apps Linux (Wayland) ✅ (2026-10-16)+## M6 — Linux app compatibility (Wayland) ✅ (2026-10-16)-Detalle en `WAYLAND.md`.+Details in `WAYLAND.md`.- [x] `libwayland-server` + `wl_compositor`, `wl_shm`, `wl_subcompositor`, `xdg_shell`- (ventanas y menús emergentes), `wl_seat` (puntero y teclado XKB), `wl_output`.-- [x] Ventanas de apps GTK4 (marco propio) y Qt6 (marco del tema) dentro de los dos temas:- título, foco, mover, cambiar tamaño, maximizar, minimizar, cerrar, Dock.-- [x] Portapapeles compartido con LordOS en los dos sentidos, `xdg-decoration`.-- [ ] Lanzar apps `.desktop` desde el Launchpad (necesita aprobar una excepción a "el servidor- no ejecuta comandos"), `linux-dmabuf`, cursores de las apps, arrastrar y soltar,+ (windows and popups), `wl_seat` (pointer and XKB keyboard), `wl_output`.+- [x] GTK4 (own frame) and Qt6 (theme frame) app windows inside both themes:+ title, focus, move, resize, maximize, minimize, close, Dock.+- [x] Clipboard shared with LordOS in both directions, `xdg-decoration`.+- [ ] Launching `.desktop` apps from the Launchpad (needs an approved exception to "the server+ doesn't execute commands"), `linux-dmabuf`, app cursors, drag and drop,`text-input`, Xwayland.-## M7 — Apps, paquetes y servicios del sistema ✅ (2026-10-16)--Definido con el usuario el 2026-10-16: tienda propia (apps de Debian y apps nativas LordOS),-instalador propio, y red, VPN, sonido y portapapeles con interfaz propia.--- [x] Lanzador de apps Linux instaladas (`.desktop`) en el Launchpad, el menú de inicio y el- Dock, con la excepción `lord.apps.launch(id)` aprobada (`WAYLAND.md`, "El lanzador").-- [x] Apps nativas instalables `.lpk` (sin root), con React y el SDK compartidos con el tema,- `<Image pixels>` y `loadWasm` (`NATIVE-APPS.md`); ejemplo `examples/apps/fractal`.-- [x] Intérprete WebAssembly propio y el global `WebAssembly` (`WASM.md`): 26.290/26.290- aserciones de la suite oficial wg-2.0; 3–5× más rápido que el mismo código en JS.-- [x] Motor de paquetes de Debian propio (`PACKAGES.md`): OpenPGP (RSA/Ed25519), xz, HTTP y- resolvedor propios, `dpkg` al final; planes idénticos a apt en 12 casos; huérfanos.-- [x] Tienda: apps de Debian por categoría (AppStream), búsqueda, plan antes de instalar o- quitar, actualizaciones, `.deb` y `.lpk` locales.-- [x] Launchpad y menú de inicio con categorías (freedesktop), íconos de AppStream para las apps- que solo traen SVG.-- [x] Ajustes agrupado como en macOS/TangoOS (buscador, usuario, General, Red, Sonido,- Actualizaciones…).-- [x] Portapapeles: imágenes entre apps Linux que sobreviven a la app de origen, historial (❖V).-- [x] Sonido sobre PipeWire con cliente propio (`SOUND.md`): Centro de control y Ajustes.-- [x] Red propia (netlink, DHCP, Wi-Fi con wpa_supplicant) y VPN (WireGuard por netlink propio,- OpenVPN) en Ajustes → Red (`NETWORK.md`).-- [x] React 19.3.1 (`react-reconciler` 0.34): renderer adaptado (`runtime/index.js`), probado con- los dos temas, cambio de tema en vivo, apps instaladas (.lpk) y apps Linux. lord-server: 34 MB de RSS.-- [x] Archivos al estilo Finder (`FILES.md`): pestañas, cuatro vistas, Papelera de- freedesktop, Vista rápida, Ver información, copiar/mover en segundo plano (`fsops.c`),- arrastrar y soltar, etiquetas, búsqueda, discos montados y «Abrir con» (`launchWith`).-- [ ] Pendiente de M7: OpenConnect e IPsec (strongSwan), WPA3/Enterprise, permisos reales por- app, repositorio de apps LordOS firmado.-- [x] `flexWrap` en el motor de layout propio (`layout.c`).-- [x] Notas: post-its en el escritorio (widgets), markdown con lectura e índice, imágenes,- adjuntos y emojis, guardadas solas en `~/Notas` (`NOTES.md`).--## M8 — Sesión y sistema--- [x] Sesión propia: `lord-sessiond` con pantalla de ingreso, bloqueo (❖L), cambio rápido de- usuario, sesiones en paralelo y Ajustes → Usuarios (`SESSIONS.md`).-- [x] Escritorio remoto en la LAN desde el navegador (puerto 5673, apagado por defecto;- `REMOTE.md`). Pendiente: audio (etapa 2, diseñada).-- [x] Privacidad y firma de apps `.lpk` (`PRIVACY.md`, `SIGNING.md`):- - [x] Caja de arena propia (`server/src/sec/sandbox.c`): Landlock (ABI≤6), seccomp-bpf (lista- blanca), sin red sin permiso, `no_new_privs`, capacidades soltadas y cgroup v2 por app;- probada en la VM (`build/sandbox-test`, 7/7). Sin bubblewrap/flatpak/firejail.- - [x] Permisos estilo TCC de macOS: avisos dibujados por el sistema, decisiones guardadas donde- la app no escribe (`permisos.json`), Ajustes → Privacidad y los puntos verde/naranja de- cámara/micrófono en los dos temas.- - [x] Firma Ed25519 propia (SHA-256/Ed25519, verificar y firmar), `contenido.json` con hashes,- niveles de confianza, catálogo firmado con revocación, y «Modificada por vos» / «Restaurar- original» / «Compartir mi versión». Pruebas `build/sign-test` (55/55, RFC 8032 + NIST) y+## M7 — Apps, packages and system services ✅ (2026-10-16)++Defined with the user on 2026-10-16: our own store (Debian apps and native LordOS apps),+our own installer, and network, VPN, sound and clipboard with our own interface.++- [x] Launcher for installed Linux apps (`.desktop`) in the Launchpad, the start menu and the+ Dock, with the approved `lord.apps.launch(id)` exception (`WAYLAND.md`, "The launcher").+- [x] Installable native `.lpk` apps (no root), with React and the SDK shared with the theme,+ `<Image pixels>` and `loadWasm` (`NATIVE-APPS.md`); example `examples/apps/fractal`.+- [x] Our own WebAssembly interpreter and the `WebAssembly` global (`WASM.md`): 26,290/26,290+ assertions of the official wg-2.0 suite; 3–5× faster than the same code in JS.+- [x] Our own Debian package engine (`PACKAGES.md`): our own OpenPGP (RSA/Ed25519), xz, HTTP and+ resolver, `dpkg` at the end; plans identical to apt in 12 cases; orphans.+- [x] Store: Debian apps by category (AppStream), search, plan before installing or+ removing, updates, local `.deb` and `.lpk`.+- [x] Launchpad and start menu with categories (freedesktop), AppStream icons for apps+ that only ship SVG.+- [x] Settings grouped as in macOS/TangoOS (search, user, General, Network, Sound,+ Updates…).+- [x] Clipboard: images between Linux apps that survive the source app, history (❖V).+- [x] Sound on PipeWire with our own client (`SOUND.md`): Control Center and Settings.+- [x] Our own networking (netlink, DHCP, Wi-Fi with wpa_supplicant) and VPN (WireGuard over our own netlink,+ OpenVPN) in Settings → Network (`NETWORK.md`).+- [x] React 19.3.1 (`react-reconciler` 0.34): adapted renderer (`runtime/index.js`), tested with+ both themes, live theme switching, installed apps (.lpk) and Linux apps. lord-server: 34 MB RSS.+- [x] Finder-style Files (`FILES.md`): tabs, four views, freedesktop+ Trash, Quick Look, Get Info, background copy/move (`fsops.c`),+ drag and drop, tags, search, mounted disks and «Open With» (`launchWith`).+- [ ] Left over from M7: OpenConnect and IPsec (strongSwan), WPA3/Enterprise, real per-app+ permissions, a signed LordOS app repository.+- [x] `flexWrap` in our own layout engine (`layout.c`).+- [x] Notes: sticky notes on the desktop (widgets), markdown with reading view and index, images,+ attachments and emoji, saved automatically in `~/Notas` (`NOTES.md`).++## M8 — Session and system++- [x] Our own session: `lord-sessiond` with a login screen, lock (❖L), fast user+ switching, parallel sessions and Settings → Users (`SESSIONS.md`).+- [x] Remote desktop on the LAN from the browser (port 5673, off by default;+ `REMOTE.md`). Pending: audio (stage 2, designed).+- [x] Privacy and signing of `.lpk` apps (`PRIVACY.md`, `SIGNING.md`):+ - [x] Our own sandbox (`server/src/sec/sandbox.c`): Landlock (ABI≤6), seccomp-bpf (allow+ list), no network without permission, `no_new_privs`, dropped capabilities and per-app cgroup v2;+ tested on the VM (`build/sandbox-test`, 7/7). No bubblewrap/flatpak/firejail.+ - [x] macOS TCC-style permissions: prompts drawn by the system, decisions stored where+ the app can't write (`permisos.json`), Settings → Privacy and the green/orange+ camera/microphone dots in both themes.+ - [x] Our own Ed25519 signing (SHA-256/Ed25519, verify and sign), `contenido.json` with hashes,+ trust levels, signed catalog with revocation, and «Modified by you» / «Restore+ original» / «Share my version». Tests `build/sign-test` (55/55, RFC 8032 + NIST) and`build/pkgstate-test` (11/11).- - [x] `tools/lpk.mjs`: `keygen`, firmar al empaquetar, `sign`, `verify` y `catalog`.- - [x] Cada `.lpk` como proceso aislado (`lord-server --app <id>`): cliente Wayland con el marco- del tema, en el Dock y el escritorio remoto; broker que verifica cada `lord.*`; avisos del- sistema pedidos por la app. La app maliciosa (`tests/lpk-evil`) falla en todo en tiempo de- ejecución; la legítima (`tests/lpk-legit`) funciona tras el consentimiento.- - [x] cgroup delegado por sesión (`Delegate=yes`, `lord-sessiond` en la hoja `supervisor`):- `app-lordos-lpk-<id>.scope` y `app-lordos-<id>.scope` (apps Linux) bajo- `lordos-session-<uid>`; probado con cambio rápido de usuario y escritorio remoto.- - [x] `sandbox_apply_helper` endurecido para lord-media y lord-doc (sin sockets ni exec, solo- hilos, TSYNC, carpetas por fd, ioctl por clase, kcmp propio): `sandbox-test helper` 17/17.- - [ ] Pendiente: powerbox gráfico (diálogo que entrega el fd), fd de la cámara y flujo de- PipeWire hacia la app, tokens/idioma/RTL en vivo y menús de la app aislada.-- [x] **Firewall por app**, pasos 1 a 4 (`FIREWALL.md`), probado en la VM 122:- - [x] tienda de reglas, precedencia, `dnsmap` y JSON (`server/src/fw`, paso 1);- - [x] `lord-netperm`, el servicio root que aplica las reglas con BPF de cgroup (connect, sendmsg,- bind, sock_create) en el subárbol de las sesiones, con cargador propio (sin libbpf), reglas- compiladas a mapas LPM/hash (`build/npcompile-test`: 480 000 conexiones contra `fw_decide`,- 0 diferencias) y nombres solo del resolvedor del sistema (monitor de systemd-resolved);- - [x] prueba con el kernel `tests/netperm_integration.sh` 18/18: denegar/permitir, "solo- example.com", solo LAN, sin entrantes, sin red, apagado;- - [x] Monitor: interruptor Regla por app y contadores de permitidas/denegadas; Ajustes →- Privacidad: modo, Apps confiables y Apps restringidas;+ - [x] `tools/lpk.mjs`: `keygen`, signing when packaging, `sign`, `verify` and `catalog`.+ - [x] Each `.lpk` as an isolated process (`lord-server --app <id>`): a Wayland client with the+ theme's frame, in the Dock and the remote desktop; a broker that checks every `lord.*`; system+ prompts requested by the app. The malicious app (`tests/lpk-evil`) fails at everything at+ run time; the legitimate one (`tests/lpk-legit`) works after consent.+ - [x] Per-session delegated cgroup (`Delegate=yes`, `lord-sessiond` in the `supervisor` leaf):+ `app-lordos-lpk-<id>.scope` and `app-lordos-<id>.scope` (Linux apps) under+ `lordos-session-<uid>`; tested with fast user switching and remote desktop.+ - [x] `sandbox_apply_helper` hardened for lord-media and lord-doc (no sockets or exec, threads+ only, TSYNC, folders by fd, ioctl by class, our own kcmp): `sandbox-test helper` 17/17.+ - [ ] Pending: graphical powerbox (a dialog that hands over the fd), the camera fd and PipeWire+ stream to the app, live tokens/language/RTL and menus for the isolated app.+- [x] **Per-app firewall**, steps 1 to 4 (`FIREWALL.md`), tested on VM 122:+ - [x] rule store, precedence, `dnsmap` and JSON (`server/src/fw`, step 1);+ - [x] `lord-netperm`, the root service that enforces the rules with cgroup BPF (connect, sendmsg,+ bind, sock_create) in the sessions' subtree, with our own loader (no libbpf), rules+ compiled to LPM/hash maps (`build/npcompile-test`: 480,000 connections against `fw_decide`,+ 0 differences) and names only from the system resolver (systemd-resolved monitor);+ - [x] kernel test `tests/netperm_integration.sh` 18/18: deny/allow, "only+ example.com", LAN only, no incoming, no network, off;+ - [x] Monitor: per-app Rule switch and allowed/denied counters; Settings →+ Privacy: mode, Trusted apps and Restricted apps;- [x] root-owned scopes: `lord-sessiond` places every app process and a Linux app can't moveitself to another cgroup (VM 122). Still open: `systemd-run --user --scope` (PID 1 moves itinto `user@<uid>.service`).- - [ ] modo "preguntar" (diseñado), interruptores por destino.-- [x] App **Monitor**, fase 1 (`MONITOR.md`), probada en la VM 123:- - [x] pestañas Resumen, CPU, Memoria, Red, Discos y Procesos con el aspecto del Monitor de- TangoOS;- - [x] métricas leídas por `lord-server` en un hilo propio, a 4 Hz y solo con la app abierta- (cerrada no cuesta nada);- - [x] conexiones por app con sock_diag, del proceso a la app por los `.desktop`;- - [x] mapa vectorial propio con zoom y arcos, al estilo de Little Snitch;- - [x] país por IP con un lector propio de MaxMind DB y DB-IP Lite (CC BY 4.0), sin red;- - [x] ítem en Ajustes → Privacidad.- - [x] Fase 2, firewall: ver "Firewall por app" arriba.- - [ ] Fase 2, resto: alertas de conexión ("preguntar"), cámara y micrófono en uso (`monitor.deviceUsers()`), nombres de host sin- DNS inverso, historial y alertas de uso.-- [ ] Sesiones con GPU (hoy se dibujan por CPU), cambio de VT y varios monitores.-- [ ] Más apps nativas LordOS en React (editor de texto, visor de imágenes, navegador).-- [ ] Imagen instalable basada en Debian 13 mínimo, con LordOS como paquetes `.deb`.-- [ ] **ARM64 / Raspberry Pi 5 como plataforma oficial** (`RASPBERRY.md`):- - [x] Auditoría de portabilidad de `server/` para aarch64: char sin signo, páginas de 16K,- seccomp de arm64, alineación y `ARCH` en el Makefile (sin `-march=native`).- - [x] NEON opcional por arquitectura en `canvas.c` (blit y máscaras), igual bit a bit a C+ - [ ] "ask" mode (designed), per-destination switches.+- [x] **Monitor** app, phase 1 (`MONITOR.md`), tested on VM 123:+ - [x] Overview, CPU, Memory, Network, Disks and Processes tabs with the look of TangoOS's+ Monitor;+ - [x] metrics read by `lord-server` in its own thread, at 4 Hz and only while the app is open+ (closed, it costs nothing);+ - [x] per-app connections with sock_diag, from process to app through the `.desktop` files;+ - [x] our own vector map with zoom and arcs, Little Snitch style;+ - [x] country by IP with our own MaxMind DB reader and DB-IP Lite (CC BY 4.0), no network;+ - [x] item in Settings → Privacy.+ - [x] Phase 2, firewall: see "Per-app firewall" above.+ - [ ] Phase 2, the rest: connection alerts ("ask"), camera and microphone in use (`monitor.deviceUsers()`), host names without+ reverse DNS, history and usage alerts.+- [ ] GPU sessions (today they are drawn on the CPU), VT switching and multiple monitors.+- [ ] More native LordOS apps in React (text editor, image viewer, browser).+- [ ] Installable image based on minimal Debian 13, with LordOS as `.deb` packages.+- [ ] **ARM64 / Raspberry Pi 5 as an official platform** (`RASPBERRY.md`):+ - [x] Portability audit of `server/` for aarch64: unsigned char, 16K pages,+ arm64 seccomp, alignment and `ARCH` in the Makefile (no `-march=native`).+ - [x] Optional per-architecture NEON in `canvas.c` (blit and masks), bit-identical to C(`build/canvas-test`); `STBI_NEON`.- - [x] Pantalla y GPU separadas (vc4 + v3d):- - la tarjeta con conectores (`drmcard.h`), en lord-server y lord-sessiond;- - `IN_FORMATS` del plano primario y scanout directo solo con modificadores aceptados;- - el render node de EGL en el feedback de dmabuf.- - [x] `tools/rpi/build-img.sh`: `lordos-<versión>-rpi5-arm64.img.xz` para Raspberry Pi Imager:- - Debian 13 arm64 con el kernel y el firmware de Raspberry Pi;- - el mismo `.deb` del ISO;- - la partición se agranda sola;- - primer arranque con `lordos-user.txt`/`userconf.txt` (pantalla de ingreso) o modo de- configuración.- - [ ] Correr `build-img.sh` y probar en la Pi 5 de 16 GB (lista de pruebas de `RASPBERRY.md`,- con capturas por el escritorio remoto).- - [ ] Video por hardware en la Pi 5 (HEVC por V4L2 stateless; H.264 por software) en+ - [x] Separate display and GPU (vc4 + v3d):+ - the card with connectors (`drmcard.h`), in lord-server and lord-sessiond;+ - `IN_FORMATS` of the primary plane and direct scanout only with accepted modifiers;+ - the EGL render node in the dmabuf feedback.+ - [x] `tools/rpi/build-img.sh`: `lordos-<version>-rpi5-arm64.img.xz` for Raspberry Pi Imager:+ - Debian 13 arm64 with the Raspberry Pi kernel and firmware;+ - the same `.deb` as the ISO;+ - the partition grows by itself;+ - first boot with `lordos-user.txt`/`userconf.txt` (login screen) or setup+ mode.+ - [ ] Run `build-img.sh` and test on the 16 GB Pi 5 (test list in `RASPBERRY.md`,+ with screenshots through the remote desktop).+ - [ ] Hardware video on the Pi 5 (HEVC via V4L2 stateless; H.264 in software) in`lord-media`.- - [ ] Paso de «crear usuario» en la pantalla de ingreso, en lugar del modo de configuración.- - [ ] Pi 4 (mejor esfuerzo).--## M9 — Documentos e impresión ✅ (2026-10-17)--Detalle en `DOCUMENTS.md` y `PRINTING.md`. Probado en la VM 116 con capturas (`m9-docs-*.png`).--- [x] **`lord-doc`, el ayudante encerrado:**- - es el único binario con Poppler (interfaz de glib) y libarchive;- - se lanza a pedido con ruta fija y sin argumentos, y trabaja solo con los fds que le pasa- lord-server;- - se encierra con `sandbox_apply_helper`: sin red ni sockets, Landlock con escritura solo- debajo del destino, seccomp, cgroup y tope de memoria;- - las páginas vuelven en memfd sellados;- - el compositor no espera nunca: hay plazos, y si el ayudante se cae no pasa nada más.-- [x] **Visor de PDF:**- - desplazamiento continuo y de a una página, miniaturas, índice;- - búsqueda con resaltado, zoom y ajuste, rotar, seleccionar y copiar, ir a página, enlaces;- - anotaciones (resaltar, nota, a mano alzada) guardadas como copia, formularios;- - página oscura invertida;- - imprimir.-- [x] **Archivos:**- - mirar adentro de los comprimidos como una carpeta;- - Extraer aquí (zip, tar.gz/xz/zst/bz2, 7z, gz sueltos) sin salir de la carpeta, con- `arcpath-test` y comprimidos maliciosos: 31/31;- - Comprimir a `.zip`;- - Vista rápida de PDF, fuentes, comprimidos y lo de adentro de un comprimido;- - Vista rápida de audio y video con `media.poster` si está.-- [x] **Tipografías:** muestras, tabla de caracteres por bloque, información, instalar y quitar- fuentes del usuario.-- [x] **Emojis y símbolos:**- - selector global (❖.) con búsqueda en es/en/pt (CLDR), categorías, recientes y tono de piel;- - escribe por el camino del método de entrada;- - app con símbolos de Unicode por bloque.-- [x] **Impresión:**- - cliente IPP propio para CUPS (sin libcups), mDNS propio;- - Ajustes → Impresoras y escáneres: agregar IPP Everywhere/AirPrint, URI manual,- predeterminada, cola y cancelar, administración por `lpadmin` + PeerCred;- - diálogo de impresión del sistema con vista previa, usado por el Visor de PDF, el Editor y- Notas (Fotos tiene la API lista).-- [x] **Escáner:** cliente eSCL propio, sin SANE: vista previa, área, resolución, color, y- guardar como PDF/PNG/JPEG. Probado con un escáner de prueba (`tests/escl_server.py`).-- [ ] **Pendiente:**- - miniaturas de PDF en la vista de íconos;- - comprimidos cifrados;- - firmas en PDF;- - escáneres y `ipps` por TLS desde lord-server;- - armado de escrituras complejas en el texto impreso;- - emojis con ZWJ en el motor de texto;- - probar con impresoras y escáneres reales.--## M9 — Apps nativas de medios ✅ (2026-10-17)--Detalle en `MEDIA.md`. Probado en la VM 119 con capturas (`m9-media-*.png`).--- [x] **`lord-media`, el ayudante encerrado:**- - es el único binario con FFmpeg (libavcodec, libavformat, libswscale, libswresample) y libva;- - se lanza a pedido con ruta fija y sin argumentos, y trabaja solo con los fds que le pasa- lord-server (archivos, cámara, render node);- - `sandbox_apply_helper`: sin sockets, exec ni red, ioctl por clase (DRM, V4L2) solo si hace- falta, TSYNC; `media-test sandbox` lo verifica;- - los cuadros vuelven por tres ranuras de memoria compartida sellada; si se cae, solo la- ventana se entera (probado con un segfault real).-- [x] **Audio por memoria compartida:** el stream de PipeWire es de lord-server; el PCM va por un- anillo y el reloj del video por un seqlock en la misma página (sin idas y vueltas). Desfase A/V- medio 0,5–1,9 ms. El micrófono, al revés.-- [x] **Reproductor:**- - video con audio sincronizado, barra de tiempo, volumen, subtítulos `.srt` y de la pista;- - pantalla completa e imagen en imagen (`wm.setFullscreen`/`wm.setPip` en el SDK);- - biblioteca de música por artista y álbum con carátulas, cola, aleatorio y repetir;- - teclas multimedia y el tile del Centro de control.-- [x] **Fotos:** fototeca de `~/Imágenes` con miniaturas en `~/.cache/lordos/thumbs`, visor con zoom,- desplazamiento, giro, pantalla completa, presentación, GIF animado, HEIC/AVIF/WebP/BMP, edición- básica guardada como copia e imprimir.-- [x] **Capturas:**- - pantalla, ventana o área y temporizador;- - al portapapeles o a `~/Imágenes/Capturas`;- - miniatura flotante y editor de anotaciones;- - grabación de pantalla a MP4 (H.264 + AAC del micrófono);- - atajos ❖⇧3/❖⇧4/❖⇧5 e Impr Pant.-- [x] **Ventanas protegidas** (`wm.setProtected`): negras en capturas, grabaciones, el escritorio- remoto y las miniaturas; también las apps Wayland y sus menús.-- [x] **Cámara:** V4L2 propio, foto JPEG, video H.264 + AAC, espejo, elegir cámara (probado con+ - [ ] A «create user» step on the login screen, instead of setup mode.+ - [ ] Pi 4 (best effort).++## M9 — Documents and printing ✅ (2026-10-17)++Details in `DOCUMENTS.md` and `PRINTING.md`. Tested on VM 116 with screenshots (`m9-docs-*.png`).++- [x] **`lord-doc`, the sandboxed helper:**+ - it is the only binary with Poppler (glib interface) and libarchive;+ - it is launched on demand with a fixed path and no arguments, and works only with the fds+ lord-server passes it;+ - it locks itself in with `sandbox_apply_helper`: no network or sockets, Landlock with writes only+ under the destination, seccomp, cgroup and a memory cap;+ - pages come back in sealed memfds;+ - the compositor never waits: there are deadlines, and if the helper crashes nothing else happens.+- [x] **PDF Viewer:**+ - continuous and single-page scrolling, thumbnails, outline;+ - search with highlighting, zoom and fit, rotate, select and copy, go to page, links;+ - annotations (highlight, note, freehand) saved as a copy, forms;+ - inverted dark page;+ - print.+- [x] **Files:**+ - looking inside archives as if they were a folder;+ - Extract Here (zip, tar.gz/xz/zst/bz2, 7z, bare gz) without leaving the folder, with+ `arcpath-test` and malicious archives: 31/31;+ - Compress to `.zip`;+ - Quick Look for PDFs, fonts, archives and what is inside an archive;+ - Quick Look for audio and video with `media.poster` when available.+- [x] **Fonts:** samples, character table by block, information, installing and removing+ user fonts.+- [x] **Emoji & Symbols:**+ - global picker (❖.) with search in es/en/pt (CLDR), categories, recents and skin tone;+ - it types through the input method path;+ - an app with Unicode symbols by block.+- [x] **Printing:**+ - our own IPP client for CUPS (no libcups), our own mDNS;+ - Settings → Printers & Scanners: add IPP Everywhere/AirPrint, manual URI,+ default, queue and cancel, administration through `lpadmin` + PeerCred;+ - the system print dialog with preview, used by the PDF Viewer, the Editor and+ Notes (Photos has the API ready).+- [x] **Scanner:** our own eSCL client, no SANE: preview, area, resolution, color, and+ saving as PDF/PNG/JPEG. Tested with a test scanner (`tests/escl_server.py`).+- [ ] **Pending:**+ - PDF thumbnails in icon view;+ - encrypted archives;+ - PDF signatures;+ - scanners and `ipps` over TLS from lord-server;+ - complex-script shaping in printed text;+ - ZWJ emoji in the text engine;+ - testing with real printers and scanners.++## M9 — Native media apps ✅ (2026-10-17)++Details in `MEDIA.md`. Tested on VM 119 with screenshots (`m9-media-*.png`).++- [x] **`lord-media`, the sandboxed helper:**+ - it is the only binary with FFmpeg (libavcodec, libavformat, libswscale, libswresample) and libva;+ - it is launched on demand with a fixed path and no arguments, and works only with the fds+ lord-server passes it (files, camera, render node);+ - `sandbox_apply_helper`: no sockets, exec or network, ioctl by class (DRM, V4L2) only when+ needed, TSYNC; `media-test sandbox` verifies it;+ - frames come back through three sealed shared-memory slots; if it crashes, only the+ window finds out (tested with a real segfault).+- [x] **Audio over shared memory:** the PipeWire stream belongs to lord-server; the PCM goes through a+ ring and the video clock through a seqlock on the same page (no round trips). Mean A/V offset+ 0.5–1.9 ms. The microphone, the other way around.+- [x] **Player:**+ - video with synchronized audio, time bar, volume, `.srt` and in-track subtitles;+ - fullscreen and picture in picture (`wm.setFullscreen`/`wm.setPip` in the SDK);+ - music library by artist and album with cover art, queue, shuffle and repeat;+ - media keys and the Control Center tile.+- [x] **Photos:** photo library from `~/Imágenes` with thumbnails in `~/.cache/lordos/thumbs`, viewer with zoom,+ panning, rotation, fullscreen, slideshow, animated GIF, HEIC/AVIF/WebP/BMP, basic+ editing saved as a copy, and printing.+- [x] **Screenshots:**+ - screen, window or area, and a timer;+ - to the clipboard or to `~/Imágenes/Capturas`;+ - floating thumbnail and annotation editor;+ - screen recording to MP4 (H.264 + AAC from the microphone);+ - shortcuts ❖⇧3/❖⇧4/❖⇧5 and Print Screen.+- [x] **Protected windows** (`wm.setProtected`): black in screenshots, recordings, the remote+ desktop and thumbnails; also Wayland apps and their menus.+- [x] **Camera:** our own V4L2, JPEG photo, H.264 + AAC video, mirror, camera choice (tested withv4l2loopback).-- [x] **Grabadora:** micrófono por PipeWire, forma de onda, renombrar, recortar y exportar a Opus,- MP3 o WAV.-- [x] **Archivos:** «Abrir con» Fotos y Reproductor, miniaturas de video, carátulas y WebP/HEIC/AVIF;- `media.poster` para la Vista rápida.-- [x] **Rendimiento:** pintar desde el video cuando solo cambió un cuadro opaco: lord-server con- un 1080p pasó de 42 % a 13 % de un núcleo en ventana y de 92 % a 15 % en pantalla completa.-- [ ] **Pendiente:**- - medir VA-API en la PC con AMD (la VM no tiene driver);- - cero-copia dmabuf → EGL en el camino GPU;- - HEVC por `v4l2request` en la Raspberry Pi 5;- - subtítulos de imagen;- - grabar un área y el audio del sistema;- - guardar en WebP.+- [x] **Recorder:** microphone over PipeWire, waveform, rename, trim and export to Opus,+ MP3 or WAV.+- [x] **Files:** «Open With» Photos and Player, video thumbnails, cover art and WebP/HEIC/AVIF;+ `media.poster` for Quick Look.+- [x] **Performance:** painting straight from the video when only an opaque frame changed: lord-server with+ a 1080p video went from 42 % to 13 % of a core windowed and from 92 % to 15 % fullscreen.+- [ ] **Pending:**+ - measure VA-API on the AMD PC (the VM has no driver);+ - zero-copy dmabuf → EGL on the GPU path;+ - HEVC via `v4l2request` on the Raspberry Pi 5;+ - image-based subtitles;+ - recording an area and the system audio;+ - saving as WebP.## M9 — System apps and system network ✅ (2026-10-18)@@ -475,65 +475,65 @@ Details in `MAIL.md`. Tested on VM 123 against local Dovecot, Postfix and Radica- [ ] Edit a single occurrence of a repeating event; create calendars/address books on the server.- [ ] CJK multibyte charsets; S/MIME and OpenPGP; QRESYNC.-## Pendiente antes del ISO final+## Pending before the final ISO-- [x] **Mail, Calendario, Contactos y Recordatorios** (see "M9 — Mail, Calendar, Contacts and+- [x] **Mail, Calendar, Contacts and Reminders** (see "M9 — Mail, Calendar, Contacts andReminders" above and `MAIL.md`).-- [x] **Secciones de Ajustes que faltan:** Pantallas, Bluetooth, Energía, Notificaciones, Fecha y- hora, Apps por defecto (see "M9 — Settings: hardware pages" above and `SETTINGS.md`).-- [ ] **Chromium y Firefox** preinstalados (apps Linux, no nativas).-- [x] **Cámara en apps aisladas** (`.lpk`) y **varias ventanas por app aislada** (VM 122,+- [x] **Missing Settings sections:** Displays, Bluetooth, Energy, Notifications, Date &+ Time, Default Apps (see "M9 — Settings: hardware pages" above and `SETTINGS.md`).+- [ ] **Chromium and Firefox** preinstalled (Linux apps, not native).+- [x] **Camera in isolated apps** (`.lpk`) and **several windows per isolated app** (VM 122,`PRIVACY.md`): read-only frame ring from `lord-media` with validated ACKs, photo/video throughthe powerbox, instant revoke; one Wayland toplevel per window, grouped in the Dock, «Newwindow» from the app and the Dock.-- [ ] **Pulido visual estilo Apple, app por app** (antes del ISO): revisar todas las apps nativas- (Ajustes, Archivos, Terminal, Store, Editor, Notas, Calculadora, Monitor, PDF, Tipografías,- Emojis, Escáner, Fotos, Reproductor, Capturas, Cámara, Grabadora, Contraseñas, Discos, Copias,- Registros, Reloj, Ayuda, Mail…) siguiendo las guías de interfaz de macOS (HIG): grilla de 8 px,- márgenes y separaciones uniformes, alineación, jerarquía tipográfica, barras laterales, barras de- herramientas y hojas como en macOS, controles con el mismo tamaño y altura, nada encimado ni- cortado; en claro, oscuro, RTL y en ventanas chicas; con capturas antes y después.-- [ ] **ISO final** con todo (verificar que `lord-doc` y `lord-media` estén adentro) e **imagen- para Raspberry Pi 5** (`tools/rpi/build-img.sh`), probada en la Pi real.--## Después del ISO final--- [ ] **Máquinas virtuales**: un **clon libre de Parallels Desktop**, con su misma interfaz y- forma de trabajar (no la de Proxmox, que solo aporta las piezas de abajo: KVM, QEMU y drivers).- Nombre genérico y logo, ícono y colores propios:- - **Centro de control** con la lista de VMs y su miniatura en vivo, estado, iniciar, pausar,- suspender y apagar;- - **Asistente de instalación** como el de Parallels: tarjetas para «Descargar Windows 11»,- Ubuntu, Debian, Fedora, Android, «Instalar desde un archivo ISO», «Migrar desde otra PC»;- - **Ventana de la VM** con su barra (Acciones, Dispositivos: USB, CD, carpetas, red, sonido) y- los modos **Ventana, Pantalla completa, Coherence e Imagen en imagen**;- - **Configuración** en pestañas como Parallels: General, Opciones (inicio y apagado,- optimización, compartir, aplicaciones, Coherence), Hardware (CPU y memoria, gráficos,- mouse y teclado, red, sonido, USB, discos, impresoras, TPM, arranque), Seguridad, Copias;- - **perfiles** al crear la VM (Productividad, Desarrollo de software, Pruebas, Diseño, Juegos)- que ajustan CPU, memoria y opciones solos;- - las apps del invitado en el Launchpad y el Dock, abrir archivos de LordOS con una app del- invitado, portapapeles y arrastrar archivos entre los dos;- - hipervisor **KVM** (el del kernel); **QEMU** como motor de dispositivos, con **swtpm** (TPM)- y **OVMF** (UEFI y arranque seguro) para Windows 11;- - los mismos drivers que usa Proxmox: **virtio-win** (disco, red, memoria, pantalla 2D- `viogpudo`, virtiofs para Windows) firmados por Red Hat, el **agente invitado de QEMU**- (`qemu-ga`) y el **agente de SPICE** (portapapeles, resolución, arrastrar archivos); se- descargan de la fuente oficial de Fedora la primera vez y se verifica la firma; los invitados- Linux ya los traen en el kernel;- - asistente propio (descarga e instalación automática, monta virtio-win durante la instalación- de Windows e instala las herramientas al final), instantáneas, clonado, USB del equipo a la- VM, carpetas compartidas (virtiofs), resolución que se ajusta a la ventana;- - la pantalla de la VM dentro de nuestro compositor por dmabuf (sin ventanas de QEMU);- - modo **Coherence**: apps de un Linux invitado como ventanas sueltas de LordOS (reenviando- Wayland); Windows con agente propio, más adelante;- - 3D acelerado en invitados Linux (virgl/venus); en Windows solo 2D por ahora (no hay driver 3D- libre de calidad);- - otra arquitectura (arm64 en una PC, amd64 en la Pi) por emulación TCG: funciona, pero 5–20×- más lento;- - más adelante, un motor propio liviano solo para invitados Linux (como crosvm/Firecracker).-- [ ] **Android:** contenedor propio con LineageOS y apps desde nuestro Store.-- [ ] **Firewall, modo pregunta** (alerta al primer intento de conexión, estilo Little Snitch).-- [ ] **Accesibilidad:** lector de pantalla, lupa, alto contraste.-- [ ] **Video de demostración** completo (instalación + recorrido, voz en inglés con subtítulos- en español).+- [ ] **Apple-style visual polish, app by app** (before the ISO): review every native app+ (Settings, Files, Terminal, Store, Editor, Notes, Calculator, Monitor, PDF, Fonts,+ Emoji, Scanner, Photos, Player, Screenshots, Camera, Recorder, Passwords, Disks, Backups,+ Logs, Clock, Help, Mail…) following the macOS Human Interface Guidelines (HIG): 8 px grid,+ uniform margins and spacing, alignment, typographic hierarchy, sidebars,+ toolbars and sheets as in macOS, controls with the same size and height, nothing overlapping or+ clipped; in light, dark, RTL and in small windows; with before and after screenshots.+- [ ] **Final ISO** with everything (check that `lord-doc` and `lord-media` are inside) and a **Raspberry+ Pi 5 image** (`tools/rpi/build-img.sh`), tested on the real Pi.++## After the final ISO++- [ ] **Virtual machines**: a **free clone of Parallels Desktop**, with the same interface and+ way of working (not Proxmox's, which only contributes the pieces underneath: KVM, QEMU and drivers).+ A generic name and our own logo, icon and colors:+ - **Control Center** with the list of VMs and their live thumbnail, state, start, pause,+ suspend and shut down;+ - **Installation Assistant** like Parallels': cards for «Download Windows 11»,+ Ubuntu, Debian, Fedora, Android, «Install from an ISO file», «Migrate from another PC»;+ - **VM window** with its bar (Actions, Devices: USB, CD, folders, network, sound) and+ the **Window, Full Screen, Coherence and Picture in Picture** modes;+ - **Configuration** in tabs like Parallels: General, Options (startup and shutdown,+ optimization, sharing, applications, Coherence), Hardware (CPU and memory, graphics,+ mouse and keyboard, network, sound, USB, disks, printers, TPM, boot), Security, Backup;+ - **profiles** when creating the VM (Productivity, Software Development, Testing, Design, Games)+ that tune CPU, memory and options automatically;+ - the guest's apps in the Launchpad and the Dock, opening LordOS files with a guest+ app, clipboard and dragging files between the two;+ - the **KVM** hypervisor (the kernel's); **QEMU** as the device engine, with **swtpm** (TPM)+ and **OVMF** (UEFI and secure boot) for Windows 11;+ - the same drivers Proxmox uses: **virtio-win** (disk, network, memory, 2D display+ `viogpudo`, virtiofs for Windows) signed by Red Hat, the **QEMU guest agent**+ (`qemu-ga`) and the **SPICE agent** (clipboard, resolution, file dragging); they are+ downloaded from Fedora's official source the first time and their signature is verified; Linux+ guests already ship them in the kernel;+ - our own assistant (automatic download and installation, mounts virtio-win during the Windows+ install and installs the tools at the end), snapshots, cloning, host USB passthrough to the+ VM, shared folders (virtiofs), resolution that follows the window;+ - the VM's display inside our compositor via dmabuf (no QEMU windows);+ - **Coherence** mode: apps of a Linux guest as standalone LordOS windows (forwarding+ Wayland); Windows with our own agent, later;+ - accelerated 3D in Linux guests (virgl/venus); on Windows only 2D for now (there is no good free+ 3D driver);+ - another architecture (arm64 on a PC, amd64 on the Pi) through TCG emulation: it works, but 5–20×+ slower;+ - later, a lightweight engine of our own only for Linux guests (like crosvm/Firecracker).+- [ ] **Android:** our own container with LineageOS and apps from our Store.+- [ ] **Firewall, ask mode** (an alert on the first connection attempt, Little Snitch style).+- [ ] **Accessibility:** screen reader, zoom, high contrast.+- [ ] Full **demo video** (installation + tour, English voice-over with Spanish+ subtitles).diff --git a/docs/VM-SETUP.md b/docs/VM-SETUP.mdindex 8ea4dfc..2706a06 100644--- a/docs/VM-SETUP.md+++ b/docs/VM-SETUP.md@@ -1,26 +1,26 @@-# VM de desarrollo LordOS (Proxmox)+# LordOS development VM (Proxmox)-Registro reproducible de cada paso aplicado a la VM. Regla: partir de Debian 13 mínimo-y anotar aquí **todo** paquete o cambio que se agregue.+A reproducible log of every step applied to the VM. Rule: start from minimal Debian 13+and write down **every** package or change added here.-## Datos+## Facts-| Campo | Valor |+| Field | Value ||----------|-----------------------------------------|| Host | Proxmox VE 9.1 (`172.17.0.2`) || VMID | 115 — `lordos-dev` || IP | `172.17.0.51/24`, gw `172.17.0.1` |-| Usuario | `lord` (solo clave SSH, sudo sin clave) |-| Recursos | 4 vCPU (`host`), 4 GB RAM, 32 GB disco |+| User | `lord` (SSH key only, passwordless sudo) |+| Resources | 4 vCPU (`host`), 4 GB RAM, 32 GB disk || Video | `virtio` (virtio-gpu → `/dev/dri/card0`)|-Acceso: `ssh -i ~/.ssh/ssh/sshkey/lord.basex.pem [email protected]`-Pantalla: consola noVNC de Proxmox (VM 115).+Access: `ssh -i ~/.ssh/ssh/sshkey/lord.basex.pem [email protected]`+Display: Proxmox noVNC console (VM 115).-## Paso 1 — Crear la VM (en el host Proxmox)+## Step 1 — Create the VM (on the Proxmox host)-Imagen base: `debian-13-genericcloud-amd64.qcow2` (Debian oficial, sin escritorio ni-paquetes extra; ~320 paquetes base).+Base image: `debian-13-genericcloud-amd64.qcow2` (official Debian, no desktop and no+extra packages; ~320 base packages).```sh# /var/lib/vz/snippets/lordos-dev.yaml@@ -32,7 +32,7 @@ users:shell: /bin/bashsudo: ALL=(ALL) NOPASSWD:ALLlock_passwd: true- ssh_authorized_keys: [ "<clave pública>" ]+ ssh_authorized_keys: [ "<public key>" ]package_update: truepackages: [qemu-guest-agent]runcmd:@@ -51,12 +51,12 @@ qm resize 115 scsi0 32Gqm start 115```-Resultado: Debian 13.7, kernel `6.12.111+deb13-cloud-amd64`, 323 paquetes.+Result: Debian 13.7, kernel `6.12.111+deb13-cloud-amd64`, 323 packages.-## Paso 2 — Kernel genérico (necesario para gráficos)+## Step 2 — Generic kernel (needed for graphics)-El kernel `-cloud` **no incluye drivers DRM**: no existe `/dev/dri`, así que un compositor-Wayland no puede arrancar. Se cambia por el kernel genérico de Debian:+The `-cloud` kernel **ships no DRM drivers**: there is no `/dev/dri`, so a Wayland+compositor can't start. It is replaced with Debian's generic kernel:```shsudo apt-get install -y --no-install-recommends linux-image-amd64@@ -64,229 +64,229 @@ sudo apt-get purge -y 'linux-image-*-cloud-amd64' linux-image-cloud-amd64sudo reboot```-Resultado: kernel `6.12.111+deb13-amd64`, módulo `virtio_gpu` cargado,-`/dev/dri/card0` y `/dev/dri/renderD128` presentes.+Result: kernel `6.12.111+deb13-amd64`, `virtio_gpu` module loaded,+`/dev/dri/card0` and `/dev/dri/renderD128` present.-## Versiones disponibles en Debian 13 (verificado)+## Versions available in Debian 13 (verified)-| Paquete | Versión | Uso |+| Package | Version | Use ||-------------------------|-------------|----------------------------------|-| `libwlroots-0.18-dev` | 0.18.2 | base del compositor en C |-| `libwpewebkit-2.0-dev` | 2.48.3 | motor web embebido (shell React) |-| `cog` | 0.18.4 | lanzador WPE de referencia |-| `libwebkitgtk-6.0-dev` | 2.54.0 | alternativa a WPE |-| `nodejs` | 20.19.2 | build de la shell React |-| `foot` | 1.21.0 | terminal Wayland de prueba |+| `libwlroots-0.18-dev` | 0.18.2 | base for the compositor in C |+| `libwpewebkit-2.0-dev` | 2.48.3 | embedded web engine (React shell) |+| `cog` | 0.18.4 | reference WPE launcher |+| `libwebkitgtk-6.0-dev` | 2.54.0 | alternative to WPE |+| `nodejs` | 20.19.2 | building the React shell |+| `foot` | 1.21.0 | Wayland terminal for testing |-> Nota: estas versiones se relevaron antes de decidir la arquitectura propia. LordOS **no**-> usa wlroots, WebKit ni cog (ver `ARCHITECTURE.md`). `foot` servirá para probar M4.+> Note: these versions were surveyed before deciding on our own architecture. LordOS does **not**+> use wlroots, WebKit or cog (see `ARCHITECTURE.md`). `foot` will be useful to test M4.-## Paso 3 — Toolchain (única instalación de M1)+## Step 3 — Toolchain (the only install for M1)```shsudo apt-get install -y --no-install-recommends build-essential```-Trae gcc 14.2, make, libc6-dev y linux-libc-dev (headers `drm/drm_mode.h`, `linux/input.h`).-No hace falta nada más: `lord-server` solo enlaza `libc` y `libm` (verificado con `ldd`).-No hay `rsync` en la VM; el código se copia con `tar` por SSH:+It brings gcc 14.2, make, libc6-dev and linux-libc-dev (headers `drm/drm_mode.h`, `linux/input.h`).+Nothing else is needed: `lord-server` only links `libc` and `libm` (verified with `ldd`).+There is no `rsync` on the VM; the code is copied with `tar` over SSH:```shCOPYFILE_DISABLE=1 tar czf - --exclude build server | \ssh [email protected] 'mkdir -p ~/LordOS && cd ~/LordOS && tar xzf - && make -C server'```-## Paso 4 — Probar M1 y capturar la pantalla+## Step 4 — Test M1 and capture the screen```sh-# en la VM+# on the VMsudo ./build/lord-server --timeout 60 [--debug]```-Desde el host Proxmox:+From the Proxmox host:```sh-echo "screendump /tmp/lord.png -f png" | qm monitor 115 # captura real+echo "screendump /tmp/lord.png -f png" | qm monitor 115 # real screenshotpython3 /root/lord-qmp-input.py 115 1280 800 move 600 190 down move 380 320 up```-`tools/lord-qmp-input.py` (copiado a `/root/` del host) envía mouse **absoluto** por QMP-(`input-send-event`), igual que noVNC. El `mouse_move` del monitor HMP no sirve: manda-movimiento relativo, que el tablet USB de QEMU ignora.+`tools/lord-qmp-input.py` (copied to the host's `/root/`) sends an **absolute** mouse over QMP+(`input-send-event`), just like noVNC. The HMP monitor's `mouse_move` doesn't work: it sends+relative motion, which QEMU's USB tablet ignores.-## Paso 5 — Zona horaria (M2)+## Step 5 — Time zone (M2)-El reloj del tema usa la hora local del sistema:+The theme's clock uses the system's local time:```shsudo timedatectl set-timezone America/Argentina/Buenos_Aires```-## Paso 6 — Desplegar y correr M2+## Step 6 — Deploy and run M2-En el Mac: `npm install && npm run build` (genera `themes/default/theme.bundle.js`). Luego:+On the Mac: `npm install && npm run build` (generates `themes/default/theme.bundle.js`). Then:```shCOPYFILE_DISABLE=1 tar czf - --no-xattrs --exclude build --exclude node_modules --exclude legacy \server third_party assets themes | ssh [email protected] 'cd ~/LordOS && tar xzf - && make -C server -j4'-# en la VM, desde ~/LordOS/server:-sudo ./build/lord-server [--profile] # --profile: tiempos por primitiva y % repintado+# on the VM, from ~/LordOS/server:+sudo ./build/lord-server [--profile] # --profile: per-primitive timings and % repainted```-No se instaló ningún paquete nuevo para M2: QuickJS, stb e Inter van dentro del repo.+No new package was installed for M2: QuickJS, stb and Inter are inside the repo.-## Paso 7 — M3: carpetas del usuario y despliegue+## Step 7 — M3: user folders and deployment-Carpetas estándar para que Archivos tenga contenido (el servidor solo puede leer `$HOME`):+Standard folders so Files has content (the server can only read `$HOME`):```shmkdir -p ~/Escritorio ~/Documentos ~/Descargas ~/Imágenes ~/Música ~/Videos```-Despliegue: igual que el paso 6. No hace falta copiar `apps/`, `sdk/` ni `runtime/` a la VM-porque van dentro del bundle de cada tema; sí copiar `themes/` completo. `sudo ./build/lord-server` arranca como-root y pasa a `lord` (se ve en el log: `corriendo como lord (uid 1000)`). Ajustes del usuario:+Deployment: same as step 6. There is no need to copy `apps/`, `sdk/` or `runtime/` to the VM+because they are inside each theme's bundle; do copy the whole `themes/`. `sudo ./build/lord-server` starts as+root and switches to `lord` (visible in the log: `running as lord (uid 1000)`). User settings:`~/.config/lordos/settings.json`.-Pruebas con QMP: `tools/lord-qmp-input.py` ahora acepta `rdown`/`rup` (clic derecho) y-`wheelup`/`wheeldown`. Teclado: `echo "sendkey f4" | qm monitor 115` (HMP `sendkey`-manda scancodes; con distribución latam, `semicolon` = ñ y `bracket_left` = tilde).+QMP testing: `tools/lord-qmp-input.py` now accepts `rdown`/`rup` (right click) and+`wheelup`/`wheeldown`. Keyboard: `echo "sendkey f4" | qm monitor 115` (HMP `sendkey`+sends scancodes; with the latam layout, `semicolon` = ñ and `bracket_left` = dead acute accent).-No se instaló ningún paquete nuevo para M3.+No new package was installed for M3.-## Paso 8 — M4: terminal nativa+## Step 8 — M4: native terminal-No se instaló ningún paquete: la terminal es parte de `lord-server` y usa el `bash` que ya-trae Debian. Hay que copiar `assets/` completo (fuentes JetBrains Mono y-`assets/shell/lord-bash.sh`) además de `server/` y `themes/`.+No package was installed: the terminal is part of `lord-server` and uses the `bash` Debian+already ships. The whole `assets/` (JetBrains Mono fonts and+`assets/shell/lord-bash.sh`) has to be copied in addition to `server/` and `themes/`.-Prueba del emulador sin pantalla (dentro de la VM):+Headless emulator test (inside the VM):```shmake -C server test-printf '123456789日本語\r\n' | server/build/vt-dump 10 3 7 3 # reflujo con caracteres anchos+printf '123456789日本語\r\n' | server/build/vt-dump 10 3 7 3 # reflow with wide characters```-Escribir en la VM desde el host Proxmox (`tools/lord-type.py`, copiado a `/root/`; requiere-la distribución US en LordOS, botón ES/US de la barra de menú):+Typing into the VM from the Proxmox host (`tools/lord-type.py`, copied to `/root/`; it needs+the US layout in LordOS, the ES/US button in the menu bar):```shpython3 /root/lord-type.py 115 'ls --color=always\n'-python3 /root/lord-type.py 115 '{meta_l-d}' # Super+D: dividir panel+python3 /root/lord-type.py 115 '{meta_l-d}' # Super+D: split pane```-`sendkey` del monitor pierde teclas con ráfagas largas: el script las manda en tandas de 40.+The monitor's `sendkey` drops keys in long bursts: the script sends them in batches of 40.-Dispositivos detectados en la VM: teclado AT (`event0`), VMMouse (`event1`/`event2`) y-QEMU USB Tablet (`event3`, el que usa la consola noVNC).+Devices detected on the VM: AT keyboard (`event0`), VMMouse (`event1`/`event2`) and+QEMU USB Tablet (`event3`, the one the noVNC console uses).-+-## Paso 9 — M4: terminal completa (fuentes, shells, tmux)+## Step 9 — M4: full terminal (fonts, shells, tmux)-Paquetes instalados **solo para probar** funciones de la Terminal (LordOS no los necesita-para funcionar; si no están, esas funciones no se ofrecen o caen en un respaldo):+Packages installed **only to test** Terminal features (LordOS doesn't need them+to work; if they are missing, those features aren't offered or fall back):```shsudo apt-get install -y --no-install-recommends zsh fish tmux \fonts-noto-color-emoji fonts-dejavu-core fonts-firacode```-| Paquete | Para qué |+| Package | What for ||---|---|-| `zsh` 5.9, `fish` 4.0.2 | probar la integración con esos shells (`sudo chsh -s /usr/bin/zsh lord`; volver con `/bin/bash`) |-| `tmux` 3.5a | probar `tmux -CC` |-| `fonts-noto-color-emoji` | emoji a color (CBDT) |-| `fonts-firacode`, `fonts-dejavu-core` | elegir otra fuente monoespaciada, ligaduras de Fira Code, respaldo de símbolos |+| `zsh` 5.9, `fish` 4.0.2 | testing the integration with those shells (`sudo chsh -s /usr/bin/zsh lord`; go back with `/bin/bash`) |+| `tmux` 3.5a | testing `tmux -CC` |+| `fonts-noto-color-emoji` | color emoji (CBDT) |+| `fonts-firacode`, `fonts-dejavu-core` | choosing another monospace font, Fira Code ligatures, symbol fallback |-Para zsh se creó un `~/.zshrc` mínimo (si no existe, zsh abre su asistente de primera vez).+A minimal `~/.zshrc` was created for zsh (without one, zsh opens its first-run wizard).-Reiniciar el servidor **sin perder las terminales** (los shells quedan en sus guardianes):+Restarting the server **without losing the terminals** (the shells stay in their holders):```sh-sudo pkill -x lord-server # SIGTERM: guarda pantallas y deja los shells vivos+sudo pkill -x lord-server # SIGTERM: saves screens and leaves the shells alivecd ~/LordOS/server && sudo setsid -f sh -c "./build/lord-server > /tmp/lord.log 2>&1 < /dev/null"-ls /run/user/1000/lordos-term/ # un .sock (y .state) por sesión viva+ls /run/user/1000/lordos-term/ # one .sock (and .state) per live session```-Archivos de prueba de iTerm2 en `~/Descargas`: `Dracula.itermcolors` y-`Catppuccin Mocha.itermcolors` (del repositorio iTerm2-Color-Schemes), un `Profiles.json` y-un `com.googlecode.iterm2.plist` binario armados con el formato de iTerm2.+iTerm2 test files in `~/Descargas`: `Dracula.itermcolors` and+`Catppuccin Mocha.itermcolors` (from the iTerm2-Color-Schemes repository), a `Profiles.json` and+a binary `com.googlecode.iterm2.plist` built in iTerm2's format.-## Paso 10 — M5: idioma y región+## Step 10 — M5: language and region```shsudo apt-get install -y --no-install-recommends libxkbcommon-dev xkb-data libx11-data```-| Paquete | Versión | Para qué |+| Package | Version | What for ||---|---|---|-| `libxkbcommon-dev` (trae `libxkbcommon0`) | 1.7.0 | teclado: lord-server enlaza `-lxkbcommon` |-| `xkb-data` | 2.42 | todas las distribuciones de teclado |-| `libx11-data` | 1.8.12 | solo datos: tablas de compose (teclas muertas) en `/usr/share/X11/locale` |--Instalado **desde LordOS** (Ajustes → Idioma y región, por el ayudante privilegiado), durante-las pruebas: regiones `pt_BR.UTF-8` y `es_AR.UTF-8` (`locale-gen`), `/etc/default/locale` =-`es_AR.UTF-8`, y los paquetes `manpages-pt-br`, `hunspell-pt-br`, `aspell-pt-br`, `hyphen-pt-br`-y `mythes-pt-br`. La zona horaria se probó cambiándola a America/Sao_Paulo y se volvió a+| `libxkbcommon-dev` (brings `libxkbcommon0`) | 1.7.0 | keyboard: lord-server links `-lxkbcommon` |+| `xkb-data` | 2.42 | every keyboard layout |+| `libx11-data` | 1.8.12 | data only: compose tables (dead keys) in `/usr/share/X11/locale` |++Installed **from LordOS** (Settings → Language & Region, through the privileged helper) during+the tests: the `pt_BR.UTF-8` and `es_AR.UTF-8` regions (`locale-gen`), `/etc/default/locale` =+`es_AR.UTF-8`, and the packages `manpages-pt-br`, `hunspell-pt-br`, `aspell-pt-br`, `hyphen-pt-br`+and `mythes-pt-br`. The time zone was tested by changing it to America/Sao_Paulo and set back toAmerica/Argentina/Buenos_Aires.-El ayudante (`lord-server` hijo que queda como root) solo existe si el servidor arrancó con-sudo; el usuario `lord` está en el grupo `sudo`, que es lo que exige para atender.+The helper (a `lord-server` child that stays root) only exists if the server was started with+sudo; the user `lord` is in the `sudo` group, which is what it requires to serve requests.-## Paso 11 — M5b: escrituras complejas y métodos de entrada+## Step 11 — M5b: complex scripts and input methods```shsudo apt-get install -y fonts-noto-core fonts-noto-cjk skkdic rime-data-pinyin-simp```-| Paquete | Versión | Para qué |+| Package | Version | What for ||---|---|---|-| `fonts-noto-core` | 20201225-2 | Noto Sans/Naskh Arabic, Hebrew y el resto de las escrituras (42 MB) |-| `fonts-noto-cjk` | 1:20240730 | Noto Sans CJK y Noto Sans Mono CJK (JP, KR, SC, TC) en `.ttc` (91 MB) |-| `skkdic` | 20230109-1 | diccionario japonés SKK-JISYO.L (método kana) |-| `rime-data-pinyin-simp` | 0.0~git20241229 | diccionario de pinyin simplificado (método pinyin); trae `rime-data-stroke` |+| `fonts-noto-core` | 20201225-2 | Noto Sans/Naskh Arabic, Hebrew and the rest of the scripts (42 MB) |+| `fonts-noto-cjk` | 1:20240730 | Noto Sans CJK and Noto Sans Mono CJK (JP, KR, SC, TC) in `.ttc` (91 MB) |+| `skkdic` | 20230109-1 | Japanese SKK-JISYO.L dictionary (kana method) |+| `rime-data-pinyin-simp` | 0.0~git20241229 | simplified pinyin dictionary (pinyin method); brings `rime-data-stroke` |-Son solo datos (fuentes y diccionarios), sin bibliotecas nuevas. En una instalación normal los-instala el paquete de idioma desde Ajustes (japonés: fuentes CJK + skkdic; chino: + pinyin).-`iconv` para EUC-JP (el formato de SKK) ya viene en `libc6`.+They are data only (fonts and dictionaries), no new libraries. In a normal installation the+language pack installs them from Settings (Japanese: CJK fonts + skkdic; Chinese: + pinyin).+`iconv` for EUC-JP (SKK's format) already comes with `libc6`.-Pruebas en la VM (`make -C server test`):+Tests on the VM (`make -C server test`):```sh./build/bidi-test BidiCharacterTest.txt # https://www.unicode.org/Public/15.1.0/ucd/-./build/ime-test kana "toukyou_" # _ = Espacio, ^ = Enter, < = Retroceso+./build/ime-test kana "toukyou_" # _ = Space, ^ = Enter, < = Backspace./build/shape-test /usr/share/fonts/truetype/noto/NotoSansArabic-Regular.ttf ui arab 1 "مرحبا"```-La comparación con HarfBuzz (`shape-test` contra `uharfbuzz`) se corrió en la máquina de-desarrollo con las mismas fuentes copiadas de la VM.+The comparison with HarfBuzz (`shape-test` against `uharfbuzz`) was run on the development+machine with the same fonts copied from the VM.-## Paso 12 — M6: apps Linux (Wayland)+## Step 12 — M6: Linux apps (Wayland)```shsudo apt-get install -y --no-install-recommends libwayland-dev wayland-protocols libwayland-bin```-| Paquete | Versión | Para qué |+| Package | Version | What for ||---|---|---|-| `libwayland-dev` (trae `libwayland-server0`) | 1.23.1 | lord-server enlaza `-lwayland-server` |-| `wayland-protocols` | 1.44 | XML de xdg-shell y xdg-decoration |-| `libwayland-bin` | 1.23.1 | `wayland-scanner`: genera el código de los protocolos al compilar |+| `libwayland-dev` (brings `libwayland-server0`) | 1.23.1 | lord-server links `-lwayland-server` |+| `wayland-protocols` | 1.44 | xdg-shell and xdg-decoration XML |+| `libwayland-bin` | 1.23.1 | `wayland-scanner`: generates the protocol code at build time |-Apps de prueba (no hacen falta para LordOS):+Test apps (not needed for LordOS):```shsudo apt-get install -y --no-install-recommends foot gtk-4-examples featherpad qt6-wayland```-`foot` (terminal Wayland), `gtk4-demo` (GTK 4.18) y `featherpad` (Qt 6.8, con el plugin-Wayland de `qt6-wayland`). Se abren desde una pestaña nueva de la Terminal de LordOS (o por ssh-con `WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000`).+`foot` (Wayland terminal), `gtk4-demo` (GTK 4.18) and `featherpad` (Qt 6.8, with the Wayland+plugin from `qt6-wayland`). They are opened from a new tab in the LordOS Terminal (or over ssh+with `WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000`).-## Paso 13 — M7: apps, paquetes y servicios del sistema+## Step 13 — M7: apps, packages and system services-**Sonido** (`SOUND.md`):+**Sound** (`SOUND.md`):```shsudo apt-get install -y --no-install-recommends pipewire pipewire-pulse wireplumber pipewire-alsa@@ -294,127 +294,127 @@ sudo loginctl enable-linger lordsystemctl --user enable --now pipewire pipewire-pulse wireplumber```-| Paquete | Para qué |+| Package | What for ||---|---|-| `pipewire`, `pipewire-pulse`, `wireplumber` | servidor de sonido; lord-server le habla por el protocolo de PulseAudio |-| `pipewire-alsa` | las apps que usan ALSA directo pasan por PipeWire |-| `pulseaudio-utils`, `sound-theme-freedesktop` | solo para probar (`pactl`, `paplay` y sonidos `.oga`) |+| `pipewire`, `pipewire-pulse`, `wireplumber` | sound server; lord-server talks to it over the PulseAudio protocol |+| `pipewire-alsa` | apps that use ALSA directly go through PipeWire |+| `pulseaudio-utils`, `sound-theme-freedesktop` | testing only (`pactl`, `paplay` and `.oga` sounds) |-**WebAssembly** (`WASM.md`), solo para compilar las pruebas y la app de ejemplo:+**WebAssembly** (`WASM.md`), only to build the tests and the example app:```shsudo apt-get install -y --no-install-recommends clang lld wabt git ca-certificates```-`clang` y `lld` compilan C a wasm32 (`tests/wasm/demo.c`, `examples/apps/fractal/src/mandel.c`);-`wabt` convierte la suite oficial de la especificación (`~/wasm-spec`).+`clang` and `lld` compile C to wasm32 (`tests/wasm/demo.c`, `examples/apps/fractal/src/mandel.c`);+`wabt` converts the official specification suite (`~/wasm-spec`).-**Portapapeles**: `librsvg2-common`, solo para probar. Sin él, `gtk4-demo --run=clipboard` no-arranca, porque sus íconos son SVG.+**Clipboard**: `librsvg2-common`, testing only. Without it, `gtk4-demo --run=clipboard` doesn't+start, because its icons are SVG.-**Placa de sonido** (para probar con hardware y no solo salidas virtuales): en Proxmox,-`qm set 115 --audio0 device=ich9-intel-hda,driver=none` con la VM apagada; en la VM,-`sudo usermod -aG audio lord && sudo systemctl restart user@1000` (sin sesión con asiento,-`/dev/snd` solo es del grupo `audio`).+**Sound card** (to test with hardware and not only virtual outputs): in Proxmox,+`qm set 115 --audio0 device=ich9-intel-hda,driver=none` with the VM powered off; on the VM,+`sudo usermod -aG audio lord && sudo systemctl restart user@1000` (without a seated session,+`/dev/snd` only belongs to the `audio` group).-**Red y VPN** (`NETWORK.md`):+**Network and VPN** (`NETWORK.md`):```shsudo apt-get install -y --no-install-recommends wpasupplicant openvpn-# solo para las pruebas (punto de acceso, DHCP, radios y peer WireGuard de comparación):+# tests only (access point, DHCP, radios and a WireGuard peer for comparison):sudo apt-get install -y --no-install-recommends hostapd dnsmasq-base iw wireguard-tools```-LordOS lanza `wpa_supplicant` y `openvpn` con su ruta fija y una config generada por él. Las-pruebas de Wi-Fi usan el módulo `mac80211_hwsim` y las de VPN y DHCP, network namespaces: nunca-tocan eth0.+LordOS launches `wpa_supplicant` and `openvpn` with their fixed path and a config it generates. The+Wi-Fi tests use the `mac80211_hwsim` module and the VPN and DHCP tests use network namespaces: they never+touch eth0.-**Paquetes de Debian** (`PACKAGES.md`): no hace falta instalar nada. El motor propio usa las-fuentes de apt que ya están y `dpkg`, y guarda su índice en `/var/lib/lordos/pkg`-(~98 MB con trixie, updates, backports y security).+**Debian packages** (`PACKAGES.md`): nothing needs to be installed. Our own engine uses the+apt sources already there and `dpkg`, and keeps its index in `/var/lib/lordos/pkg`+(~98 MB with trixie, updates, backports and security).-**Escrituras de M5b** (`LANGUAGES.md`): `libthai-data` y `fonts-noto-core` ya estaban;-`libthai-dev` solo para comparar el corte del tailandés contra libthai.+**M5b scripts** (`LANGUAGES.md`): `libthai-data` and `fonts-noto-core` were already there;+`libthai-dev` only to compare Thai word breaking against libthai.-## VM 116 `lordos-gpu` (camino GPU)+## VM 116 `lordos-gpu` (GPU path)-Clon completo de la 115 para probar la composición por GPU sin tocar la de desarrollo:+A full clone of 115 to test GPU composition without touching the development VM:```sh-# en el host Proxmox+# on the Proxmox hostsed "s/^hostname: lordos-dev/hostname: lordos-gpu/" /var/lib/vz/snippets/lordos-dev.yaml > /var/lib/vz/snippets/lordos-gpu.yamlqm clone 115 116 --name lordos-gpu --fullqm set 116 --vga virtio,memory=64 --ipconfig0 ip=172.17.0.52/24,gw=172.17.0.1 --cicustom user=local:snippets/lordos-gpu.yamlqm start 116-# en la VM (172.17.0.52)+# on the VM (172.17.0.52)sudo apt-get install -y --no-install-recommends libgbm-dev libegl-dev libgles-dev libegl-mesa0 libgl1-mesa-dri-# solo pruebas+# tests onlysudo apt-get install -y --no-install-recommends mesa-utils mesa-utils-bin mesa-vulkan-drivers vulkan-tools glmark2-es2-wayland neverball-sudo usermod -aG kvm lord # /dev/udmabuf para build/dmabuf-client+sudo usermod -aG kvm lord # /dev/udmabuf for build/dmabuf-client```-`vga: virtio-gl` (virgl) no arranca en este host: solo tiene la placa ASPEED, sin render node-(se instalaron `libgl1` y `libegl1` en el host al probarlo). Adentro de la VM, Mesa usa llvmpipe-sobre virtio-gpu 2D. Detalle y mediciones en `GPU.md`.+`vga: virtio-gl` (virgl) doesn't start on this host: it only has the ASPEED card, with no render node+(`libgl1` and `libegl1` were installed on the host while trying it). Inside the VM, Mesa uses llvmpipe+on 2D virtio-gpu. Details and measurements in `GPU.md`.-## Paso 14 — M8: ISO live, GPU y VMs de prueba+## Step 14 — M8: live ISO, GPU and test VMs-**ISO live** (`ISO.md`). Al principio se armaba en la VM 115. Desde el ISO con lord-sessiond-(16 de octubre) se arma en la **VM 116**, en `~/LordOS-iso`, porque la 115 es la VM de-desarrollo del usuario:+**Live ISO** (`ISO.md`). At first it was built on VM 115. Since the ISO with lord-sessiond+(October 16) it is built on **VM 116**, in `~/LordOS-iso`, because 115 is the user's+development VM:```shsudo apt-get install -y --no-install-recommends debootstrap squashfs-tools xorriso grub-pc-bin \grub-efi-amd64-bin grub-common mtools dosfstools lintian libssl-dev-make -C server -j4 && sudo tools/iso/build.sh /var/tmp/lordos-iso # ~8 min, ISO de 651 MB+make -C server -j4 && sudo tools/iso/build.sh /var/tmp/lordos-iso # ~8 min, 651 MB ISO```-En la VM 116 se instalaron el 16 de octubre: `libssl-dev`, para compilar `lord-sessiond` (lo-pide `mkdeb.sh`), y los paquetes de build del ISO de arriba. `libgbm-dev libegl-dev libgles-dev`-ya estaban.+On VM 116 the following were installed on October 16: `libssl-dev`, to build `lord-sessiond` (required+by `mkdeb.sh`), and the ISO build packages above. `libgbm-dev libegl-dev libgles-dev`+were already there.-**GPU** (`GPU.md`): `libgbm-dev libegl-dev libgles-dev` para compilar con el camino por GPU.-Solo para las pruebas: `mesa-utils mesa-vulkan-drivers vulkan-tools glmark2-es2-wayland-neverball`. En el host Proxmox se instalaron `libgl1` y `libegl1`, cuando se intentó usar virgl;-no sirvió, porque el host no tiene GPU.+**GPU** (`GPU.md`): `libgbm-dev libegl-dev libgles-dev` to build with the GPU path.+Tests only: `mesa-utils mesa-vulkan-drivers vulkan-tools glmark2-es2-wayland+neverball`. On the Proxmox host `libgl1` and `libegl1` were installed when trying to use virgl;+it didn't work, because the host has no GPU.-**VMs de prueba en Proxmox:**+**Test VMs on Proxmox:**-| VMID | Nombre | Para qué |+| VMID | Name | What for ||---|---|---|-| 115 | `lordos-dev` | desarrollo (172.17.0.51) |-| 116 | `lordos-gpu` | clon de la 115 para el camino de GPU (172.17.0.52, `vga: virtio`); el usuario `lord` está en el grupo `kvm` (`/dev/udmabuf`) |-| 118 | `lordos-notes` | clon de la 115 para probar Notas (172.17.0.53; snippet `local:snippets/lordos-notes.yaml`); `wl-clipboard` solo para las pruebas del portapapeles |-| 116 | `lordos-gpu` | además, desde M8: arma el ISO live (`~/LordOS-iso`, `/var/tmp/lordos-iso`) |-| 117 | `lordos-live` | arranca el ISO live (4 GB, q35, `vga: virtio`, `audio0: ich9-intel-hda`, OVMF con efidisk o SeaBIOS). Arranca primero del CD. Tiene un disco `scsi0` de 24 GB con una instalación vieja de una prueba anterior |-| 121 | `lordos-install-tmp` | temporal, ya borrada: 24 GB, OVMF, `boot: order=scsi0;ide2`; ahí se instaló el ISO y se probó la pantalla de ingreso del sistema instalado (`qm destroy 121 --purge 1 --destroy-unreferenced-disks 1`) |--ISOs en `local:iso`: `lordos-live-0.7.0-amd64.iso` es el actual. Los anteriores se guardan con-su fecha, por ejemplo `lordos-live-0.7.0-amd64-20261016-1529.iso`, el último con `lordos-session`.--Scripts de prueba en `/root` del host, además de `lord-qmp-input.py`:-- `lordos-latam-type.py`: como `lord-type.py`, pero para la distribución latam, que es la del- ISO. `/` es `shift-7` y `-` es `slash`.-- `lordos-typecmd.sh <vm> <archivo>`: escribe una línea sacada de un archivo, para no pelear con- las comillas.-- `lordos-grubsel.sh <vm> <n> <captura>`: reinicia la VM y elige la entrada `n` de grub. Manda- `home` repetido para frenar la cuenta regresiva.--**VM 119 `lordos-spot`** (Spotlight y portapapeles, `SPOTLIGHT.md`): clon completo de la 115-(`qm clone 115 119 --name lordos-spot --full`), IP 172.17.0.54 por cloud-init (snippet-`local:snippets/lordos-spot.yaml`, igual al de la 116 con otro hostname) y MAC nueva. Solo para-las pruebas: `wl-clipboard` (`wl-copy`/`wl-paste`) y `tests/clip_secret.c`+| 115 | `lordos-dev` | development (172.17.0.51) |+| 116 | `lordos-gpu` | clone of 115 for the GPU path (172.17.0.52, `vga: virtio`); the user `lord` is in the `kvm` group (`/dev/udmabuf`) |+| 118 | `lordos-notes` | clone of 115 to test Notes (172.17.0.53; snippet `local:snippets/lordos-notes.yaml`); `wl-clipboard` only for the clipboard tests |+| 116 | `lordos-gpu` | also, since M8: builds the live ISO (`~/LordOS-iso`, `/var/tmp/lordos-iso`) |+| 117 | `lordos-live` | boots the live ISO (4 GB, q35, `vga: virtio`, `audio0: ich9-intel-hda`, OVMF with efidisk or SeaBIOS). Boots from the CD first. It has a 24 GB `scsi0` disk with an old installation from an earlier test |+| 121 | `lordos-install-tmp` | temporary, already deleted: 24 GB, OVMF, `boot: order=scsi0;ide2`; the ISO was installed there and the installed system's login screen was tested (`qm destroy 121 --purge 1 --destroy-unreferenced-disks 1`) |++ISOs in `local:iso`: `lordos-live-0.7.0-amd64.iso` is the current one. Earlier ones are kept with+their date, for example `lordos-live-0.7.0-amd64-20261016-1529.iso`, the last one with `lordos-session`.++Test scripts in the host's `/root`, besides `lord-qmp-input.py`:+- `lordos-latam-type.py`: like `lord-type.py`, but for the latam layout, which is the ISO's.+ `/` is `shift-7` and `-` is `slash`.+- `lordos-typecmd.sh <vm> <file>`: types one line taken from a file, to avoid fighting with+ quoting.+- `lordos-grubsel.sh <vm> <n> <screenshot>`: reboots the VM and picks grub entry `n`. It sends+ `home` repeatedly to stop the countdown.++**VM 119 `lordos-spot`** (Spotlight and clipboard, `SPOTLIGHT.md`): a full clone of 115+(`qm clone 115 119 --name lordos-spot --full`), IP 172.17.0.54 via cloud-init (snippet+`local:snippets/lordos-spot.yaml`, the same as 116's with another hostname) and a new MAC. Tests+only: `wl-clipboard` (`wl-copy`/`wl-paste`) and `tests/clip_secret.c`(`cc -o clip-secret tests/clip_secret.c -lwayland-client`).-## Paso 15 — M8: sesiones, pantalla de ingreso y escritorio remoto+## Step 15 — M8: sessions, login screen and remote desktop-Ver `SESSIONS.md` y `REMOTE.md`. En la VM 118 (172.17.0.53):+See `SESSIONS.md` and `REMOTE.md`. On VM 118 (172.17.0.53):```sh-sudo apt-get install -y --no-install-recommends libssl-dev # para compilar lord-sessiond-sudo apt-get install -y --no-install-recommends libgbm-dev libegl-dev libgles-dev libgl1-mesa-dri # camino GPU-make -C server -j4 # lord-server y lord-sessiond-# instalación de prueba, de root (lord-sessiond solo arranca sesiones con binarios de root):+sudo apt-get install -y --no-install-recommends libssl-dev # to build lord-sessiond+sudo apt-get install -y --no-install-recommends libgbm-dev libegl-dev libgles-dev libgl1-mesa-dri # GPU path+make -C server -j4 # lord-server and lord-sessiond+# test install, root-owned (lord-sessiond only starts sessions with root-owned binaries):sudo install -d /usr/local/lib/lordos/binsudo install -m 755 -o root -g root server/build/lord-sessiond server/build/lord-server /usr/local/lib/lordos/bin/sudo cp -r themes assets /usr/local/lib/lordos/ && sudo chown -R root:root /usr/local/lib/lordos@@ -422,34 +422,34 @@ sudo cp -r themes assets /usr/local/lib/lordos/ && sudo chown -R root:root /usr/- `lordos.service` (`/etc/systemd/system`): `ExecStart=/usr/local/lib/lordos/bin/lord-sessiond`,`ExecReload=/bin/kill -HUP $MAINPID`, `KillMode=process`, `[email protected]`.- Habilitado.-- Se sacaron el `lordos-remote.service` de la primera versión y el `lord-server` lanzado a mano.-- `/etc/default/keyboard` con `XKBLAYOUT="us"`: es la distribución de la pantalla de ingreso.- Sin ese archivo usa `latam`, la de LordOS.-- **Usuarios de prueba:**+ Enabled.+- The first version's `lordos-remote.service` and the hand-launched `lord-server` were removed.+- `/etc/default/keyboard` with `XKBLAYOUT="us"`: it is the login screen's layout.+ Without that file it uses `latam`, LordOS's.+- **Test users:**- `bob` (`useradd -m -s /bin/bash -c "Bob Prueba" bob`);- - las contraseñas de `lord` y `bob` son solo de prueba, para ingresar por el monitor y la web.-- `lordos-greeter` lo crea `lord-sessiond`.-- La placa es `virtio_gpu` sin 3D: por defecto la sesión del monitor compone por CPU, igual que- el lord-server de antes. Para probar el camino por GPU con llvmpipe se usa- `/etc/systemd/system/lordos.service.d/gpu.conf` con `Environment=LORD_GPU=1`.-- `/etc/lordos/remote/config`: `enabled=1` después de la prueba de Ajustes → Compartir,+ - the passwords of `lord` and `bob` are test-only, for logging in through the monitor and the web.+- `lordos-greeter` is created by `lord-sessiond`.+- The card is `virtio_gpu` without 3D: by default the monitor's session composites on the CPU, just like+ the old lord-server. To test the GPU path with llvmpipe,+ `/etc/systemd/system/lordos.service.d/gpu.conf` with `Environment=LORD_GPU=1` is used.+- `/etc/lordos/remote/config`: `enabled=1` after the Settings → Sharing test,`port=5673`.-**VM 119** (172.17.0.54) como cliente:+**VM 119** (172.17.0.54) as the client:-- `chromium`, para probar desde un navegador real;-- los clientes de prueba del scratchpad (`ws_test.py`), que hablan TLS y WebSocket con la- librería estándar de Python.+- `chromium`, to test from a real browser;+- the scratchpad's test clients (`ws_test.py`), which speak TLS and WebSocket with+ Python's standard library.-No se abrió ningún puerto ni regla de firewall: las VMs están en la misma LAN.+No port or firewall rule was opened: the VMs are on the same LAN.-## Paso 16 — M8: privacidad, aislamiento y firma de apps+## Step 16 — M8: privacy, isolation and app signing-Ver `PRIVACY.md` y `SIGNING.md`. VM propia, clon completo de la 115:+See `PRIVACY.md` and `SIGNING.md`. A VM of its own, a full clone of 115:```sh-# en el host Proxmox+# on the Proxmox hostsed "s/^hostname: lordos-spot/hostname: lordos-sandbox/" /var/lib/vz/snippets/lordos-spot.yaml \> /var/lib/vz/snippets/lordos-sandbox.yamlqm clone 115 122 --name lordos-sandbox --full@@ -457,15 +457,15 @@ qm set 122 --ipconfig0 ip=172.17.0.56/24,gw=172.17.0.1 --cicustom user=local:sniqm start 122```-| VMID | Nombre | Para qué |+| VMID | Name | What for ||---|---|---|-| 122 | `lordos-sandbox` | M8 privacidad/firma (172.17.0.56); clon de la 115, con `lord-sessiond` instalado (`Delegate=yes`) |+| 122 | `lordos-sandbox` | M8 privacy/signing (172.17.0.56); clone of 115, with `lord-sessiond` installed (`Delegate=yes`) |-- **Kernel**: `6.12.111+deb13-amd64` con Landlock ABI 6 (`/usr/include/linux/landlock.h`), seccomp- y cgroup v2 (`cpu memory pids` delegados en `[email protected]`). No hizo falta instalar nada- para el aislamiento: es todo del kernel y la libc.-- `libssl-dev` solo para compilar `lord-sessiond` (como en la 118); `lord-server` no lo enlaza.-- **`lord-sessiond` con cgroups delegados** (como en la 118, más `Delegate=yes`):+- **Kernel**: `6.12.111+deb13-amd64` with Landlock ABI 6 (`/usr/include/linux/landlock.h`), seccomp+ and cgroup v2 (`cpu memory pids` delegated in `[email protected]`). Nothing had to be installed+ for isolation: it is all kernel and libc.+- `libssl-dev` only to build `lord-sessiond` (as on 118); `lord-server` doesn't link it.+- **`lord-sessiond` with delegated cgroups** (as on 118, plus `Delegate=yes`):```shsudo install -d /usr/local/lib/lordos/bin@@ -474,34 +474,34 @@ qm start 122echo "AUTOLOGIN=lord" | sudo tee /etc/lordos/session.conf```- `/etc/systemd/system/lordos.service`: igual al de la 118 (`ExecStart=/usr/local/lib/lordos/bin/lord-sessiond`,- `KillMode=process`, `[email protected]`) **más `Delegate=yes`**; habilitado.- `assets/` lleva también `app-host.bundle.js` (el «app host» de las apps aisladas).-- **Usuarios y escritorio remoto, solo para las pruebas:** `bob` (`useradd -m -s /bin/bash -c "Bob Prueba" bob`);- `lord` y `bob` tienen una contraseña de prueba (letras y números, así se escribe igual con la- distribución latam de la pantalla de ingreso); `/etc/lordos/remote/config` con `enabled=1`,- `port=5673`. Los ingresos por el navegador se probaron con el cliente `ws_test.py` (TLS +- WebSocket con la biblioteca estándar de Python).-- **Sin `lord-sessiond`** (`lord-server` suelto con sudo, como en el desarrollo) no hay subárbol- delegado: las apps corren sin cgroup, con un aviso (respaldo esperado).-- **Apps de prueba instaladas:** `tests/lpk-evil` (sin firma) y `tests/lpk-legit` (firmada con la- clave de desarrollo), más Fractal; FeatherPad y foot ya estaban (de la 115).-- **Pruebas** (`make -C server test` y aparte): `build/sign-test` (55/55), `build/pkgstate-test`- (11/11, con un `.lpk` de prueba) y `build/sandbox-test` (13/13 app, 13/13 con red, 17/17- `helper`; necesita `XDG_RUNTIME_DIR` para la prueba del socket de Wayland).-- **Sincronizar** desde el Mac con un script de nombre propio (`sync-sandbox-122.sh`), nunca uno- genérico: otro agente llegó a mandar su árbol a esta VM por un `sync.sh` compartido.-- **Clave de firma de desarrollo**: en el Mac, `~/.config/lordos-dev/lordos-dev.key` (privada, no- se commitea); la pública está en `packaging/keys/lordos-dev.pub` y en `server/src/sec/keys.h`.--No tocar las VMs 115, 117, 118, 119, 120 ni 123.--## Paso 17 — M8: Monitor--Ver `MONITOR.md`. VM propia, clon completo de la 115:+ `/etc/systemd/system/lordos.service`: the same as on 118 (`ExecStart=/usr/local/lib/lordos/bin/lord-sessiond`,+ `KillMode=process`, `[email protected]`) **plus `Delegate=yes`**; enabled.+ `assets/` also carries `app-host.bundle.js` (the "app host" of isolated apps).+- **Users and remote desktop, tests only:** `bob` (`useradd -m -s /bin/bash -c "Bob Prueba" bob`);+ `lord` and `bob` have a test password (letters and digits, so it types the same with the+ login screen's latam layout); `/etc/lordos/remote/config` with `enabled=1`,+ `port=5673`. Browser logins were tested with the `ws_test.py` client (TLS ++ WebSocket with Python's standard library).+- **Without `lord-sessiond`** (a standalone `lord-server` with sudo, as in development) there is no delegated+ subtree: apps run without a cgroup, with a warning (expected fallback).+- **Test apps installed:** `tests/lpk-evil` (unsigned) and `tests/lpk-legit` (signed with the+ development key), plus Fractal; FeatherPad and foot were already there (from 115).+- **Tests** (`make -C server test` and separately): `build/sign-test` (55/55), `build/pkgstate-test`+ (11/11, with a test `.lpk`) and `build/sandbox-test` (13/13 app, 13/13 with network, 17/17+ `helper`; it needs `XDG_RUNTIME_DIR` for the Wayland socket test).+- **Sync** from the Mac with a script with its own name (`sync-sandbox-122.sh`), never a+ generic one: another agent once sent its tree to this VM through a shared `sync.sh`.+- **Development signing key**: on the Mac, `~/.config/lordos-dev/lordos-dev.key` (private, never+ committed); the public one is in `packaging/keys/lordos-dev.pub` and in `server/src/sec/keys.h`.++Do not touch VMs 115, 117, 118, 119, 120 or 123.++## Step 17 — M8: Monitor++See `MONITOR.md`. A VM of its own, a full clone of 115:```sh-# en el host Proxmox+# on the Proxmox hostsed "s/^hostname: lordos-spot/hostname: lordos-monitor/" /var/lib/vz/snippets/lordos-spot.yaml \> /var/lib/vz/snippets/lordos-monitor.yamlqm clone 115 123 --name lordos-monitor --full@@ -509,57 +509,57 @@ qm set 123 --ipconfig0 ip=172.17.0.55/24,gw=172.17.0.1 --cicustom user=local:sniqm start 123```-| VMID | Nombre | Para qué |+| VMID | Name | What for ||---|---|---|-| 123 | `lordos-monitor` | M8 Monitor (172.17.0.55, MAC `BC:24:11:03:28:0F`); clon de la 115 con `lord-sessiond` como la 118 |+| 123 | `lordos-monitor` | M8 Monitor (172.17.0.55, MAC `BC:24:11:03:28:0F`); clone of 115 with `lord-sessiond` as on 118 |-En la VM (172.17.0.55):+On the VM (172.17.0.55):```shsudo apt-get install -y --no-install-recommends libssl-dev # lord-sessiond-sudo apt-get install -y --no-install-recommends libgbm-dev libegl-dev libgles-dev libgl1-mesa-dri # camino GPU (prueba de LORD_GPU=1)-sudo apt-get install -y --no-install-recommends bc # solo para las mediciones (~/cpu.sh)+sudo apt-get install -y --no-install-recommends libgbm-dev libegl-dev libgles-dev libgl1-mesa-dri # GPU path (LORD_GPU=1 test)+sudo apt-get install -y --no-install-recommends bc # only for the measurements (~/cpu.sh)make -C server -j4 && make -C server testsudo install -d /usr/local/lib/lordos/bin /etc/lordossudo install -m 755 -o root -g root server/build/lord-sessiond server/build/lord-server /usr/local/lib/lordos/bin/sudo cp -r themes assets /usr/local/lib/lordos/ && sudo chown -R root:root /usr/local/lib/lordos```-- **`lordos.service`:** igual al de la 118 (`ExecStart=/usr/local/lib/lordos/bin/lord-sessiond`,- `KillMode=process`, `[email protected]`). Está habilitado.-- **Inicio de sesión:**- - `/etc/lordos/session.conf` con `AUTOLOGIN=lord`: entra solo después de cada reinicio, para- las capturas;- - `/etc/default/keyboard` con `XKBLAYOUT="us"`.-- **GPU:** `/etc/systemd/system/lordos.service.d/gpu.conf` (`LORD_GPU=1`) se usó una vez para- probar el camino por GPU con llvmpipe y se sacó. Las mediciones son por CPU.-- **Solo para las pruebas** (no se instaló nada):- - conexiones reales con `curl --limit-rate 30k` a espejos de Debian de varios países- (`ftp.<país>.debian.org`);- - Firefox ESR (ya estaba en la 115) abriendo `www.bbc.co.uk`;- - carga con `dd` y bucles de shell.-- **Scripts de medición:**- - `~/cpu.sh SEG`: % de CPU de `lord-server`;- - `~/thr.sh SEG`: lo mismo, por hilo.-- **Ninguna red tocada:** no se abrió ningún puerto ni se cambió la red de `eth0` (solo la IP por- cloud-init al clonar).--No tocar las VMs 115, 117, 118, 119, 120 ni 122.--## Paso 18 — Touchpad, gestos y pantallas táctiles (VM 123)--Ver `TRACKPAD.md`. En la VM 123 (172.17.0.55):--- `chromium` (155, de Debian) ya estaba en la VM y se usó para probar el pellizco por Wayland;-- `/dev/uinput` viene en el kernel de Debian;-- se instaló `linux-perf` (`apt-get install --no-install-recommends linux-perf`), solo para medir- en qué gasta CPU `lord-server` al mover el mapa (`perf record --call-graph dwarf`);-- `tpsim play --mouse ...` simula un mouse con rueda de alta resolución; enchufar y desenchufar en- caliente se prueba con `tpsim play` (crea el dispositivo, reproduce y lo quita);-- Fractal 1.1.0 (`examples/apps/fractal`, sin firma) se instaló desde Archivos → Tienda, para- probar los gestos en una app aislada.--Solo para las pruebas:+- **`lordos.service`:** the same as on 118 (`ExecStart=/usr/local/lib/lordos/bin/lord-sessiond`,+ `KillMode=process`, `[email protected]`). It is enabled.+- **Login:**+ - `/etc/lordos/session.conf` with `AUTOLOGIN=lord`: it logs in by itself after every reboot, for+ the screenshots;+ - `/etc/default/keyboard` with `XKBLAYOUT="us"`.+- **GPU:** `/etc/systemd/system/lordos.service.d/gpu.conf` (`LORD_GPU=1`) was used once to+ test the GPU path with llvmpipe and removed. The measurements are on the CPU.+- **Tests only** (nothing installed):+ - real connections with `curl --limit-rate 30k` to Debian mirrors in several countries+ (`ftp.<country>.debian.org`);+ - Firefox ESR (already on 115) opening `www.bbc.co.uk`;+ - load with `dd` and shell loops.+- **Measurement scripts:**+ - `~/cpu.sh SEC`: CPU % of `lord-server`;+ - `~/thr.sh SEC`: the same, per thread.+- **No network touched:** no port was opened and `eth0`'s network wasn't changed (only the IP via+ cloud-init when cloning).++Do not touch VMs 115, 117, 118, 119, 120 or 122.++## Step 18 — Touchpad, gestures and touchscreens (VM 123)++See `TRACKPAD.md`. On VM 123 (172.17.0.55):++- `chromium` (155, from Debian) was already on the VM and was used to test pinch over Wayland;+- `/dev/uinput` comes with Debian's kernel;+- `linux-perf` was installed (`apt-get install --no-install-recommends linux-perf`), only to measure+ where `lord-server` spends CPU while moving the map (`perf record --call-graph dwarf`);+- `tpsim play --mouse ...` simulates a high-resolution wheel mouse; hot plugging and unplugging+ is tested with `tpsim play` (it creates the device, plays back and removes it);+- Fractal 1.1.0 (`examples/apps/fractal`, unsigned) was installed from Files → Store, to+ test the gestures in an isolated app.++Tests only:```shmake -C server -j4 && make -C server test && server/build/tp-test@@ -567,56 +567,56 @@ cc -O2 -Wall -Wextra -o tests/touchpad-sim/tpsim tests/touchpad-sim/tpsim.c testsudo install -m 755 tests/touchpad-sim/tpsim /usr/local/bin/tpsim```-- **Servicios de prueba**, con `Before=lordos.service` para que `lord-sessiond` preste los- dispositivos simulados a la sesión al arrancar:+- **Test services**, with `Before=lordos.service` so `lord-sessiond` lends the+ simulated devices to the session at startup:- `tpsim-trackpad-123.service`: `tpsim serve /run/tpsim.fifo`;- `tpsim-ts-trackpad-123.service`: `tpsim serve --touchscreen /run/tpsim-ts.fifo`.- Quedaron **deshabilitados** al terminar (`systemctl disable`). Para volver a probar,- `sudo systemctl enable tpsim-trackpad-123` y reiniciar la VM.-- **Gestos:** `echo pinch-out > /run/tpsim.fifo`.-- **Capturas:** por el host Proxmox, `echo "screendump /tmp/x.png -f png" | qm monitor 123`.-- **Posición del puntero:** el mouse absoluto (la tablet USB de QEMU), con+ They were left **disabled** at the end (`systemctl disable`). To test again,+ `sudo systemctl enable tpsim-trackpad-123` and reboot the VM.+- **Gestures:** `echo pinch-out > /run/tpsim.fifo`.+- **Screenshots:** from the Proxmox host, `echo "screendump /tmp/x.png -f png" | qm monitor 123`.+- **Pointer position:** the absolute mouse (QEMU's USB tablet), with`tools/lord-qmp-input.py 123 1280 800 move X Y`.-- **Escritorio remoto sin navegador:** `RP_PINCH`/`RP_SCROLL` directo al socket de la sesión- (`/run/user/1000/lordos/remote.sock`), con un script de Python del scratchpad.-- **Red:** no se tocó la red de `eth0`.+- **Remote desktop without a browser:** `RP_PINCH`/`RP_SCROLL` straight to the session socket+ (`/run/user/1000/lordos/remote.sock`), with a Python script from the scratchpad.+- **Network:** `eth0`'s network wasn't touched.-## Paso 16 — M9: documentos, impresión y escáner (VM 116)+## Step 16 — M9: documents, printing and scanner (VM 116)-En la **VM 116** (172.17.0.52), en una carpeta aparte, `~/LordOS-m9`: `~/LordOS-iso` y su entorno-de armado no se tocaron.+On **VM 116** (172.17.0.52), in a separate folder, `~/LordOS-m9`: `~/LordOS-iso` and its build+environment were not touched.-**Para compilar `lord-doc`** (el ayudante de documentos, `DOCUMENTS.md`):+**To build `lord-doc`** (the documents helper, `DOCUMENTS.md`):```shsudo apt-get install -y --no-install-recommends libpoppler-glib-dev libarchive-dev pkg-config```-| Paquete | Versión | Para qué |+| Package | Version | What for ||---|---|---|-| `libpoppler-glib-dev` (trae `libpoppler-glib8t64`, `libcairo2-dev`, `libglib2.0-dev`, FreeType y fontconfig) | 25.03.0 | `lord-doc`: PDF |-| `libarchive-dev` (trae `libarchive13t64`) | 3.7.4 | `lord-doc`: comprimidos |+| `libpoppler-glib-dev` (brings `libpoppler-glib8t64`, `libcairo2-dev`, `libglib2.0-dev`, FreeType and fontconfig) | 25.03.0 | `lord-doc`: PDF |+| `libarchive-dev` (brings `libarchive13t64`) | 3.7.4 | `lord-doc`: archives |-Sin esos `-dev`, `make -C server` arma todo lo demás y no arma `build/lord-doc` (`DOCHELPER=0`).+Without those `-dev` packages, `make -C server` builds everything else and skips `build/lord-doc` (`DOCHELPER=0`).-**Para imprimir** (`PRINTING.md`):+**For printing** (`PRINTING.md`):```shsudo apt-get install -y --no-install-recommends cups printer-driver-cups-pdf cups-ipp-utils avahi-daemon avahi-utils-sudo usermod -aG lpadmin lord # administrar impresoras (los administradores de LordOS lo tienen)+sudo usermod -aG lpadmin lord # manage printers (LordOS administrators have it)```-| Paquete | Versión | Para qué |+| Package | Version | What for ||---|---|---|-| `cups` (`cups-daemon`, `cups-client`, `cups-filters`…) | 2.4.10 | la cola y los controladores; LordOS le habla IPP por `/run/cups/cups.sock` |-| `printer-driver-cups-pdf` | 3.0.2 | solo pruebas: la impresora virtual «PDF» (deja los trabajos en `~/PDF/`) |-| `cups-ipp-utils` | 2.4.10 | solo pruebas: `ippeveprinter`, una impresora IPP Everywhere «de la red» |-| `avahi-daemon`, `avahi-utils` | 0.8 | CUPS anuncia y encuentra impresoras; en las pruebas, anunciar el escáner (`avahi-publish`). El mDNS de LordOS no lo necesita |-| `libarchive-tools`, `zstd` | 3.7.4, 1.5.7 | solo pruebas: armar `.7z` y `.tar.zst` en `tests/doc_evil.sh` |-| `strace` | — | solo para depurar el ayudante |+| `cups` (`cups-daemon`, `cups-client`, `cups-filters`…) | 2.4.10 | the queue and the drivers; LordOS speaks IPP to it over `/run/cups/cups.sock` |+| `printer-driver-cups-pdf` | 3.0.2 | tests only: the virtual «PDF» printer (it leaves jobs in `~/PDF/`) |+| `cups-ipp-utils` | 2.4.10 | tests only: `ippeveprinter`, an IPP Everywhere printer "on the network" |+| `avahi-daemon`, `avahi-utils` | 0.8 | CUPS announces and finds printers; in the tests, announcing the scanner (`avahi-publish`). LordOS's mDNS doesn't need it |+| `libarchive-tools`, `zstd` | 3.7.4, 1.5.7 | tests only: building `.7z` and `.tar.zst` in `tests/doc_evil.sh` |+| `strace` | — | only for debugging the helper |-**Emuladores de prueba** (unidades de systemd temporales, como el usuario `lord`):+**Test emulators** (temporary systemd units, as the user `lord`):```shsudo systemd-run --unit=lord-test-ipp --uid=lord ippeveprinter -p 8631 -M LordOS \@@ -627,146 +627,146 @@ sudo systemd-run --unit=lord-test-escl-mdns --uid=lord avahi-publish -s "Escáne_uscan._tcp 8090 "rs=eSCL" "ty=Escáner de prueba LordOS"```-**La sesión en la VM 116**, como en el paso 15:+**The session on VM 116**, as in step 15:-- se instaló `lordos.service` (lord-sessiond) con `Delegate=yes`;-- los binarios van en `/usr/local/lib/lordos/bin`: `lord-sessiond`, `lord-server` y- **`lord-doc`**, que tiene que estar al lado de `lord-server`;-- `/etc/default/keyboard` con `XKBLAYOUT="us"`;-- la contraseña de `lord` es solo de prueba, para entrar por la pantalla de ingreso.+- `lordos.service` (lord-sessiond) was installed with `Delegate=yes`;+- the binaries go in `/usr/local/lib/lordos/bin`: `lord-sessiond`, `lord-server` and+ **`lord-doc`**, which has to sit next to `lord-server`;+- `/etc/default/keyboard` with `XKBLAYOUT="us"`;+- `lord`'s password is test-only, for logging in through the login screen.-Con `KillMode=process`, para reiniciar hay que parar también las sesiones:+With `KillMode=process`, restarting requires stopping the sessions too:```shsudo systemctl stop lordos; sudo pkill -x lord-server; sudo pkill -x lord-sessiondsudo systemctl reset-failed lordos; sudo systemctl start lordos```-Si no, systemd no vuelve a arrancar el servicio («Device or resource busy»), porque quedan-procesos en su cgroup.+Otherwise systemd doesn't start the service again («Device or resource busy»), because processes+are left in its cgroup.-**Archivos de prueba** en la carpeta de `lord`:+**Test files** in `lord`'s home folder:-- `~/Documentos/WebAssembly-2.0.pdf`: 224 páginas, con índice y enlaces;-- `~/Documentos/Formulario.pdf`: el formulario de `/usr/share/cups/data`;-- `~/Descargas`: los comprimidos de `tests/make_evil_archives.py`;-- `Lobster-Regular.ttf`: fuente OFL de google/fonts, para instalar.-- Mediciones: el archivo `~/.cache/lordos/doc-trace` activa el registro de tiempos de lord-doc.+- `~/Documentos/WebAssembly-2.0.pdf`: 224 pages, with an outline and links;+- `~/Documentos/Formulario.pdf`: the form from `/usr/share/cups/data`;+- `~/Descargas`: the archives from `tests/make_evil_archives.py`;+- `Lobster-Regular.ttf`: an OFL font from google/fonts, for installing.+- Measurements: the file `~/.cache/lordos/doc-trace` turns on lord-doc's timing log.-## Paso 19 — M9: medios (VM 119 `lordos-spot`)+## Step 19 — M9: media (VM 119 `lordos-spot`)-Ver `MEDIA.md`. La VM 119 (172.17.0.54), clon de la de desarrollo, quedó para los medios.+See `MEDIA.md`. VM 119 (172.17.0.54), a clone of the development VM, was set aside for media.-**Compilar** (`lord-media`; sin estos `-dev`, `make` compila todo lo demás sin él):+**Build** (`lord-media`; without these `-dev` packages, `make` builds everything else without it):```shsudo apt-get install -y --no-install-recommends libavcodec-dev libavformat-dev libavutil-dev \libswscale-dev libswresample-dev libva-dev```-En tiempo de ejecución: `libavcodec61 libavformat61 libavutil59 libswscale8 libswresample5 libva2-libva-drm2`. Para VA-API con AMD o Intel, también `mesa-va-drivers` (en la VM no sirve: virtio-gpu-2D no tiene driver, y `vainfo` falla).+At run time: `libavcodec61 libavformat61 libavutil59 libswscale8 libswresample5 libva2+libva-drm2`. For VA-API with AMD or Intel, also `mesa-va-drivers` (it doesn't help on the VM: 2D virtio-gpu+has no driver, and `vainfo` fails).-**Instalación como el `.deb`:** `lord-sessiond`, `lord-server` y `lord-media` (de root) en-`/usr/lib/lordos/bin`, con los temas y `assets` en `/usr/lib/lordos`.-- `lordos.service` es el de `tools/iso/rootfs`, sin `ExecStartPre`, más- `lordos.service.d/delegate.conf` con `Delegate=yes`.-- La contraseña de prueba de `lord` es para la pantalla de ingreso.-- El escritorio remoto se prendió solo para la prueba de la ventana protegida- (`/etc/lordos/remote/config`) y volvió a `enabled=0`.+**Installed like the `.deb`:** `lord-sessiond`, `lord-server` and `lord-media` (root-owned) in+`/usr/lib/lordos/bin`, with the themes and `assets` in `/usr/lib/lordos`.+- `lordos.service` is the one from `tools/iso/rootfs`, without `ExecStartPre`, plus+ `lordos.service.d/delegate.conf` with `Delegate=yes`.+- `lord`'s test password is for the login screen.+- Remote desktop was turned on only for the protected-window test+ (`/etc/lordos/remote/config`) and went back to `enabled=0`.-**Solo para las pruebas:**+**Tests only:**-| Paquete o cambio | Para qué |+| Package or change | What for ||---|---|-| `ffmpeg`, `vainfo`, `v4l-utils` | armar muestras, alimentar la cámara virtual, ver formatos |-| `linux-headers-amd64` + `v4l2loopback-dkms` | cámara virtual. Los headers trajeron el kernel 6.12.113 (se reinició para usarlo) |+| `ffmpeg`, `vainfo`, `v4l-utils` | building samples, feeding the virtual camera, inspecting formats |+| `linux-headers-amd64` + `v4l2loopback-dkms` | virtual camera. The headers brought kernel 6.12.113 (rebooted to use it) || `/etc/modprobe.d/lordos-test-cam.conf`, `/etc/modules-load.d/lordos-test-cam.conf` | `v4l2loopback devices=1 video_nr=10 card_label="Camara virtual (v4l2loopback)" exclusive_caps=1` |-| `/etc/udev/rules.d/70-lordos-test-video.rules` | `/dev/video*` del grupo `video` (con una webcam real lo da logind/`uaccess`) |-| servicio transitorio `lordos-test-camfeed` (`/usr/local/bin/lordos-test-camfeed`) | `ffmpeg` → `testsrc2` 1280×720 YUYV con la hora → `/dev/video10` |-| `module-null-sink` `lordos_prueba` + `module-remap-source` `mic_virtual` («Micrófono virtual», predeterminado) y el servicio `lordos-test-micfeed` | micrófono virtual con un clip en bucle (`paplay`) |-| `python3-pil` | `remote_shot.py` (scratchpad): cliente del escritorio remoto que arma la pantalla en PNG |-| `gdb` | encontrar el desborde de la cola de cuadros al final del archivo |-| `pulseaudio-utils`, `wl-clipboard` | `pactl` (streams y fuentes), `wl-paste` (portapapeles) |--**Muestras** (licencias libres; detalle en `~/Música/LICENCIAS.txt`):-- `~/Videos/Big Buck Bunny (1080p).mp4` (+ `.srt`), `Prueba de sincronía.mkv` (con una pista de- subtítulos);-- dos EP CC BY 3.0 de archive.org en `~/Música`, con carátula incrustada;-- `~/Imágenes/Muestras`: PNG, JPEG, WebP, BMP, HEIC, AVIF y un GIF animado;-- `~/media-src/sync.mp4`: el clip de sincronía.--Medir: `python3 server/tests/media_cpu.py 30` y `server/build/media-test play <archivo> …`.--Los servicios de prueba son transitorios y quedaron parados. Se vuelven a crear con+| `/etc/udev/rules.d/70-lordos-test-video.rules` | `/dev/video*` owned by the `video` group (with a real webcam, logind/`uaccess` grants it) |+| transient service `lordos-test-camfeed` (`/usr/local/bin/lordos-test-camfeed`) | `ffmpeg` → `testsrc2` 1280×720 YUYV with the time → `/dev/video10` |+| `module-null-sink` `lordos_prueba` + `module-remap-source` `mic_virtual` («Micrófono virtual», default) and the `lordos-test-micfeed` service | virtual microphone with a looping clip (`paplay`) |+| `python3-pil` | `remote_shot.py` (scratchpad): a remote desktop client that assembles the screen into a PNG |+| `gdb` | finding the frame-queue overflow at the end of the file |+| `pulseaudio-utils`, `wl-clipboard` | `pactl` (streams and sources), `wl-paste` (clipboard) |++**Samples** (free licenses; details in `~/Música/LICENCIAS.txt`):+- `~/Videos/Big Buck Bunny (1080p).mp4` (+ `.srt`), `Prueba de sincronía.mkv` (with a subtitle+ track);+- two CC BY 3.0 EPs from archive.org in `~/Música`, with embedded cover art;+- `~/Imágenes/Muestras`: PNG, JPEG, WebP, BMP, HEIC, AVIF and an animated GIF;+- `~/media-src/sync.mp4`: the sync clip.++Measuring: `python3 server/tests/media_cpu.py 30` and `server/build/media-test play <file> …`.++The test services are transient and were left stopped. They are recreated with`sudo systemd-run --unit=lordos-test-camfeed --uid=lord -p Restart=always /usr/local/bin/lordos-test-camfeed`-y lo mismo con `lordos-test-micfeed`.+and the same with `lordos-test-micfeed`.-## Paso 18 — Ventanas fluidas, bordes, cursores y sonido (VM 118)+## Step 18 — Smooth windows, edges, cursors and sound (VM 118)-Ver `WINDOWS.md` y `SOUND.md` (Tiempo real). En la VM 118 (172.17.0.53):+See `WINDOWS.md` and `SOUND.md` (Real time). On VM 118 (172.17.0.53):-- **Escritorio remoto apagado** (`/etc/lordos/remote/config`: `enabled=0`), para que la sesión no- componga por CPU por tener alguien mirando.-- **`/etc/lordos/session.conf`: `AUTOLOGIN=lord`**, para reiniciar la sesión con un script+- **Remote desktop off** (`/etc/lordos/remote/config`: `enabled=0`), so the session doesn't+ composite on the CPU because someone is watching.+- **`/etc/lordos/session.conf`: `AUTOLOGIN=lord`**, to restart the session with a script(`rm /run/lordos/autologin-done; systemctl restart lordos.service`).-- **Paquetes:**- - **`rtkit`**, el mismo que trae el ISO. Sirvió para comprobar que con polkit no da tiempo real a- las sesiones de `lord-sessiond`.- - **`chromium` 155** ya estaba instalado. Se abre en la sesión con+- **Packages:**+ - **`rtkit`**, the same one the ISO ships. It served to confirm that with polkit it doesn't grant real time to+ `lord-sessiond`'s sessions.+ - **`chromium` 155** was already installed. It is opened in the session with`WAYLAND_DISPLAY=wayland-0 XDG_RUNTIME_DIR=/run/user/1000 chromium --ozone-platform=wayland- --user-data-dir=~/.cache/chromium-ventanas`, para YouTube.-- **`lord` en el grupo `pipewire`** (`usermod -aG pipewire lord` y `systemctl restart user@1000`):- PipeWire en tiempo real, como en el ISO.-- **Tableta virtual para medir:** `~/uinput-ventanas-118.py`, que corre como root. Crea la tableta- «LordOS prueba tableta» y se la maneja por `/run/uinput-ventanas` (`move X Y`, `down`, `up`,- `drag X Y seg hz radio`). Tiene que existir antes de que la sesión tome el monitor.- - El mouse por QMP pierde eventos a más de ~20 por segundo.- - Con `mouse_set 3` (monitor de QEMU) el mouse de QMP es la tableta USB y no el VMMouse.-- **Archivos para las pruebas:**- - `~/tono-ventanas.wav` (tono de 5 minutos);- - `~/antes-ventanas/` (los temas de antes, para medir el «antes»);- - `~/LordOS-antes` (el árbol sin juntar el movimiento).-- **Camino GPU con llvmpipe:**- `/etc/systemd/system/lordos.service.d/gpu-ventanas.conf` con `Environment=LORD_GPU=1`. Se puso- solo para medir y se sacó.--## Paso 20 — M8: firewall por app, `lord-netperm` (VM 122 `lordos-sandbox`)--Ver `FIREWALL.md`, paso 2. En la VM 122 (172.17.0.56), que ya tenía `lord-sessiond` con+ --user-data-dir=~/.cache/chromium-ventanas`, for YouTube.+- **`lord` in the `pipewire` group** (`usermod -aG pipewire lord` and `systemctl restart user@1000`):+ real-time PipeWire, as in the ISO.+- **Virtual tablet for measuring:** `~/uinput-ventanas-118.py`, which runs as root. It creates the tablet+ «LordOS prueba tableta» and is driven through `/run/uinput-ventanas` (`move X Y`, `down`, `up`,+ `drag X Y sec hz radius`). It has to exist before the session takes the monitor.+ - The QMP mouse drops events above ~20 per second.+ - With `mouse_set 3` (QEMU monitor) the QMP mouse is the USB tablet and not the VMMouse.+- **Test files:**+ - `~/tono-ventanas.wav` (a 5-minute tone);+ - `~/antes-ventanas/` (the old themes, to measure the "before");+ - `~/LordOS-antes` (the tree without motion coalescing).+- **GPU path with llvmpipe:**+ `/etc/systemd/system/lordos.service.d/gpu-ventanas.conf` with `Environment=LORD_GPU=1`. It was added+ only for measuring and removed.++## Step 20 — M8: per-app firewall, `lord-netperm` (VM 122 `lordos-sandbox`)++See `FIREWALL.md`, step 2. On VM 122 (172.17.0.56), which already had `lord-sessiond` with`Delegate=yes`:-- **Paquetes:** ninguno nuevo. `clang` 19 ya estaba y compila `server/src/netperm/np.bpf.c`- (`BPF=1` sale solo si hay clang). El kernel `6.12.111+deb13-amd64` trae `CONFIG_BPF_SYSCALL`,- `CONFIG_CGROUP_BPF` y `CONFIG_BPF_JIT`. systemd-resolved 257 corre y `nsswitch.conf` usa+- **Packages:** none new. `clang` 19 was already there and compiles `server/src/netperm/np.bpf.c`+ (`BPF=1` is set automatically when clang is present). Kernel `6.12.111+deb13-amd64` has `CONFIG_BPF_SYSCALL`,+ `CONFIG_CGROUP_BPF` and `CONFIG_BPF_JIT`. systemd-resolved 257 is running and `nsswitch.conf` uses`resolve`.-- **Instalación:**+- **Installation:**```shmake -C server -j4 && make -C server testsudo install -m 755 -o root -g root server/build/lord-netperm server/build/lord-server /usr/local/lib/lordos/bin/- sudo install -m 644 lord-netperm.service /etc/systemd/system/ # la unidad de FIREWALL.md (ExecStart en /usr/local/lib/lordos/bin)+ sudo install -m 644 lord-netperm.service /etc/systemd/system/ # the unit from FIREWALL.md (ExecStart in /usr/local/lib/lordos/bin)sudo systemctl daemon-reload && sudo systemctl enable --now lord-netperm```- La unidad es la misma que va en el ISO (el texto se le pasó a la sesión principal). Tiene- `RestrictAddressFamilies=AF_UNIX AF_PACKET`, capacidades `CAP_BPF CAP_NET_ADMIN CAP_PERFMON+ The unit is the same one that goes into the ISO (the text was handed to the main session). It has+ `RestrictAddressFamilies=AF_UNIX AF_PACKET`, capabilities `CAP_BPF CAP_NET_ADMIN CAP_PERFMONCAP_DAC_READ_SEARCH CAP_NET_RAW`, `ProtectSystem=strict`, `ProtectHome=read-only`,- `ProtectControlGroups=yes` y `RuntimeDirectory=lordos` con `RuntimeDirectoryPreserve=yes`.-- **Reiniciar `lordos.service`:** con `KillMode=process`, un `systemctl restart` deja procesos de las- sesiones y systemd no puede volver a arrancar el servicio ("Device or resource busy"). Se hizo- `systemctl kill -s KILL --kill-whom=all lordos`, `reset-failed` y `start`. Para que vuelva a- entrar solo, se borró `/run/lordos/autologin-done`. `lord-netperm` se vuelve a enganchar solo- en la cgroup nueva.-- **Solo para las pruebas:**+ `ProtectControlGroups=yes` and `RuntimeDirectory=lordos` with `RuntimeDirectoryPreserve=yes`.+- **Restarting `lordos.service`:** with `KillMode=process`, a `systemctl restart` leaves session+ processes behind and systemd can't start the service again ("Device or resource busy"). What was done:+ `systemctl kill -s KILL --kill-whom=all lordos`, `reset-failed` and `start`. To have it log in+ by itself again, `/run/lordos/autologin-done` was deleted. `lord-netperm` reattaches by itself+ to the new cgroup.+- **Tests only:**- `~/.local/share/applications/nptest.desktop` ("Prueba de red"): `foot -e ~/bin/nptest-loop.sh`,- un bucle de `curl` a example.com y www.debian.org y `/dev/tcp` a la puerta de enlace cada 3 s;+ a loop of `curl` to example.com and www.debian.org and `/dev/tcp` to the gateway every 3 s;- `server/tests/netperm_integration.sh` (18/18), `server/tests/netperm_measure.sh`;- - destinos: la puerta de enlace (TCP 53), 127.0.0.1, example.com y www.debian.org. No se bajó- nada grande de internet.-- **Ninguna red tocada:** ni eth0 ni reglas de nftables. Los ganchos son de cgroup y solo- alcanzan a las apps de las sesiones de LordOS.+ - destinations: the gateway (TCP 53), 127.0.0.1, example.com and www.debian.org. Nothing large was+ downloaded from the internet.+- **No network touched:** neither eth0 nor nftables rules. The hooks are cgroup hooks and only+ reach the apps in LordOS sessions.- **`systemd-run --user` escape (M8 follow-up, no new packages).** `lord-netperm` now also attachesto each session user's `user@<uid>.service` and applies the per-user restriction union there (see`FIREWALL.md`, «Escape via `systemd-run --user`»). Tested as the restricted app `desktop:aisla`@@ -779,14 +779,14 @@ Ver `FIREWALL.md`, paso 2. En la VM 122 (172.17.0.56), que ya tenía `lord-sessirestricted scope, captured with `qm monitor 122` `screendump`. The lock screen was cleared by afull `lordos.service` restart with autologin (`rm /run/lordos/autologin-done`), not by changingany password.-- **Capturas** con `qm monitor 122` (`screendump`) desde el host. El mouse va por+- **Screenshots** with `qm monitor 122` (`screendump`) from the host. The mouse goes through`/root/lord-qmp-input.py 122`.-- **Marco y colores de las apps Linux** (`WAYLAND.md`):- - paquetes **`gnome-calculator`** (GTK 4/libadwaita) y **`mousepad`** (GTK 3), solo para probar;- - `/etc/chromium/master_preferences` con `"custom_chrome_frame": false` (la original quedó en+- **Frame and colors of Linux apps** (`WAYLAND.md`):+ - packages **`gnome-calculator`** (GTK 4/libadwaita) and **`mousepad`** (GTK 3), tests only;+ - `/etc/chromium/master_preferences` with `"custom_chrome_frame": false` (the original was kept as`master_preferences.orig-ventanas`);- - `/etc/firefox-esr/lordos.js` con `pref("browser.tabs.inTitlebar", 0)`;- - `assets/gtk/LordOS*` copiados a `/usr/share/themes/`.+ - `/etc/firefox-esr/lordos.js` with `pref("browser.tabs.inTitlebar", 0)`;+ - `assets/gtk/LordOS*` copied to `/usr/share/themes/`.## Step — M9: Passwords and the system keyring (VM 116 `lordos-gpu`)diff --git a/sdk/dock.js b/sdk/dock.jsindex e5ecd59..80812ac 100644--- a/sdk/dock.js+++ b/sdk/dock.js@@ -1,12 +1,12 @@-// dock.js — Dock y barra de tareas: apps fijadas (favoritas), ventanas agrupadas por app y el-// menú del clic derecho (como en macOS). Lo usan todos los temas; cada uno lo dibuja a su modo.+// dock.js — Dock and taskbar: pinned (favorite) apps, windows grouped by app and the+// right-click menu (as in macOS). Every theme uses it; each one draws it its own way.//-// const entries = useDockEntries(['files', 'terminal']) // fijadas por defecto del tema-// // entry = { id, name, Icon, windows: [ventana…], pinned, running, focused }-// dockActivate(entry) // clic: abre la app o trae su ventana-// dockMenu(entry) // ítems para el menú contextual: [{ label, onClick, checked, submenu, header } | '-']+// const entries = useDockEntries(['files', 'terminal']) // the theme's default pinned apps+// // entry = { id, name, Icon, windows: [window…], pinned, running, focused }+// dockActivate(entry) // click: opens the app or brings up its window+// dockMenu(entry) // items for the context menu: [{ label, onClick, checked, submenu, header } | '-']//-// Una app puede sumar sus propios ítems al menú (la Terminal: Nueva ventana, Nueva pestaña…):+// An app can add its own items to the menu (the Terminal: New Window, New Tab…):// registerDockMenu('terminal', (entry) => [{ label: '…', onClick }])import { createElement as h } from 'react';import { settings } from './settings.js';@@ -18,7 +18,7 @@ import { t } from './i18n.js';const menuProviders = new Map();export function registerDockMenu(appId, fn) { menuProviders.set(appId, fn); return () => menuProviders.delete(appId); }-// ---- fijadas (en ~/.config/lordos/settings.json → dockPinned) ----+// ---- pinned (in ~/.config/lordos/settings.json → dockPinned) ----let themeDefaults = [];const pinnedList = () => settings.get().dockPinned || themeDefaults;@@ -34,17 +34,17 @@ export const dock = {move(id, index) { dock.pin(id, index); },};-// ---- preferencias del Dock y de la barra de tareas (Ajustes → Escritorio y Dock) -----// Se guardan en settings.json. Izquierda y derecha son lados físicos de la pantalla, también con un-// idioma de derecha a izquierda (como macOS).+// ---- Dock and taskbar preferences (Settings → Desktop & Dock) ----+// Stored in settings.json. Left and right are physical sides of the screen, even with a+// right-to-left language (as in macOS).export const DOCK_DEFAULTS = {- dockPosition: 'bottom', // 'bottom' | 'left' | 'right' (tema Lord Default)- dockSize: 54, // px de cada ícono (36–80)- dockMagnify: true, // lupa- dockMagnifySize: 86, // px del ícono más grande con la lupa (más que dockSize)- dockAutohide: false, // se esconde y vuelve al tocar el borde- dockRecents: false, // muestra las últimas apps usadas que no están fijadas- taskbarPosition: 'bottom', // 'bottom' | 'top' | 'left' | 'right' (tema Clásico)+ dockPosition: 'bottom', // 'bottom' | 'left' | 'right' (Lord Default theme)+ dockSize: 54, // px of each icon (36–80)+ dockMagnify: true, // magnification+ dockMagnifySize: 86, // px of the largest icon when magnified (more than dockSize)+ dockAutohide: false, // hides and comes back when the edge is touched+ dockRecents: false, // shows the most recently used apps that aren't pinned+ taskbarPosition: 'bottom', // 'bottom' | 'top' | 'left' | 'right' (Classic theme)};export function dockPrefs(s = settings.get()) {const p = { ...DOCK_DEFAULTS };@@ -56,7 +56,7 @@ export function dockPrefs(s = settings.get()) {return p;}-// Apps usadas hace poco (para «Mostrar apps recientes»): cada app que abre una ventana pasa adelante.+// Recently used apps (for «Show recent apps»): each app that opens a window moves to the front.let openIds = new Set();windows.subscribe(() => {const now = new Set();@@ -69,7 +69,7 @@ windows.subscribe(() => {if (next.join('\n') !== cur.join('\n')) settings.set({ dockRecentApps: next });});-// A qué ícono del Dock pertenece una ventana: su app LordOS, o la app Linux de su .desktop.+// Which Dock icon a window belongs to: its LordOS app, or the Linux app from its .desktop.export function launcherIdOf(w) {if (!String(w.id).startsWith('linux#')) return appIdOf(w.id);const appId = w.args?.appId || '';@@ -78,7 +78,7 @@ export function launcherIdOf(w) {return a ? a.id : `linux:${appId || w.id}`;}-// opts.recents: cuántas apps recientes (no fijadas ni abiertas) se agregan al final, con recent: true.+// opts.recents: how many recent apps (neither pinned nor open) are appended at the end, with recent: true.export function useDockEntries(defaults = [], opts = {}) {themeDefaults = defaults;const s = useStore(settings);@@ -100,7 +100,7 @@ export function useDockEntries(defaults = [], opts = {}) {const out = [];for (const id of pinned) {const a = byId.get(id);- if (!a && !groups.has(id)) continue; // fijada pero desinstalada+ if (!a && !groups.has(id)) continue; // pinned but uninstalledout.push(entry(id, a, groups.get(id) || []));}for (const [id, wins] of groups) if (!pinned.includes(id)) out.push(entry(id, byId.get(id), wins));@@ -113,8 +113,8 @@ export function useDockEntries(defaults = [], opts = {}) {return out;}-// Clic en el ícono: sin ventanas abre la app; con ventanas trae la más reciente (si ya estaba-// al frente y hay varias, pasa a la siguiente, como ❖` en macOS).+// Click on the icon: with no windows it opens the app; with windows it brings up the most recent one (if it+// was already in front and there are several, it moves to the next, like ❖` in macOS).export function dockActivate(e) {if (!e.windows.length) { launchApp(e.id); return; }const top = wm.focused();diff --git a/sdk/wayland.js b/sdk/wayland.jsindex d253c7d..eaa334a 100644--- a/sdk/wayland.js+++ b/sdk/wayland.js@@ -78,7 +78,7 @@ globalThis.__lordWayland = (sid, type, d = {}) => {break;}// desde donde se apretó el botón (la app pide mover recién después de un umbral)- // lo sigue lord-server en C (wm.beginMove/beginResize, docs/VENTANAS.md); si no se puede (el tema no+ // lo sigue lord-server en C (wm.beginMove/beginResize, docs/WINDOWS.md); si no se puede (el tema no// marcó el nodo de la ventana), con los eventos del puntero como antescase 'move': if (win) { wm.focus(id); if (!wm.beginMove(id)) drag = { id, edges: null, start: { x: d.x, y: d.y, f: wm.frame(wm.get(id)) } }; } break;case 'resize': if (win) { wm.focus(id); if (!wm.beginResize(id, d.edges || 10)) drag = { id, edges: d.edges || 10, start: { x: d.x, y: d.y, f: wm.frame(wm.get(id)) } }; } break;@@ -125,7 +125,7 @@ locale.subscribe(() => setTimeout(() => {// Compositor: una app .lpk aislada publicó sus menús por el broker. Se ponen en la ventana de esa// app (linux#<superficie> con app_id = su id) para que el tema los muestre en su barra de menú;-// los clics vuelven a la app por lord.broker.menuClick. Ver docs/PRIVACIDAD.md.+// los clics vuelven a la app por lord.broker.menuClick. Ver docs/PRIVACY.md.function applyAppMenus(app) {if (typeof lord === 'undefined' || !lord.broker || typeof lord.broker.menus !== 'function') return;const wins = windows.get().filter((w) => surfaceOf(w.id) > 0 && w.args?.appId === app); // every window of the appdiff --git a/server/mk/vault-ctap.mk b/server/mk/vault-ctap.mkindex 16b779a..5b42802 100644--- a/server/mk/vault-ctap.mk+++ b/server/mk/vault-ctap.mk@@ -1,4 +1,4 @@-# FIDO2 de Contraseñas (src/vault/ctap2.c, p256.c, cbor.c, fidodev.c; docs/CONTRASENAS.md).+# FIDO2 de Contraseñas (src/vault/ctap2.c, p256.c, cbor.c, fidodev.c; docs/PASSWORDS.md).# ctap-test corre con `make test`; softfido y fido-e2e necesitan root (uhid): ver# ../tests/fido-soft/run-pw-116.sh. Los prerrequisitos van escritos a mano (este archivo se# incluye antes que mk/vault.mk).diff --git a/server/mk/vault-dbus.mk b/server/mk/vault-dbus.mkindex f133391..42ed188 100644--- a/server/mk/vault-dbus.mk+++ b/server/mk/vault-dbus.mk@@ -1,5 +1,5 @@# Secret Service (org.freedesktop.secrets) con D-Bus propio: src/vault/dbus.c y secretsvc.c-# (docs/CONTRASENAS.md). dbus-test corre en make test; secretsvc-demo se prueba con+# (docs/PASSWORDS.md). dbus-test corre en make test; secretsvc-demo se prueba con# tests/secretsvc/run-pw-116.sh contra el bus real y secret-tool.SS_SRC := src/vault/dbus.c src/vault/secretsvc.c src/vault/smem.c src/vault/vcrypto.c src/pkg/crypto.cSS_HDR := src/vault/dbus.h src/vault/secretsvc.h src/vault/smem.h src/vault/vcrypto.h src/pkg/crypto.hdiff --git a/server/mk/vault-import.mk b/server/mk/vault-import.mkindex d8f3d33..102b82f 100644--- a/server/mk/vault-import.mk+++ b/server/mk/vault-import.mk@@ -1,4 +1,4 @@-# Importar/exportar contraseñas (src/vault/vimport.c, csvp.c, kdbx.c, xmlmini.c; docs/CONTRASENAS.md).+# Importar/exportar contraseñas (src/vault/vimport.c, csvp.c, kdbx.c, xmlmini.c; docs/PASSWORDS.md).# La prueba usa smem sobre malloc (tests/import_smem_shim.c) para que ASan/LSan vean cada bloque.IMPORT_SRC := src/vault/vimport.c src/vault/csvp.c src/vault/kdbx.c src/vault/xmlmini.cIMPORT_HDR := src/vault/vimport.h src/vault/csvp.h src/vault/kdbx.h src/vault/xmlmini.h src/vault/vjson.h src/vault/smem.h src/vault/vstb.h src/vault/vcrypto.hdiff --git a/server/mk/vault.mk b/server/mk/vault.mkindex 28514b5..ef7a482 100644--- a/server/mk/vault.mk+++ b/server/mk/vault.mk@@ -1,4 +1,4 @@-# Contraseñas y llavero del sistema (src/vault, docs/CONTRASENAS.md). Monocypher 4.0.2 vendorizado+# Contraseñas y llavero del sistema (src/vault, docs/PASSWORDS.md). Monocypher 4.0.2 vendorizado# (CC0) en ../third_party/monocypher. Cada parte agrega sus pruebas en mk/vault-*.mk.MC_DIR := ../third_party/monocypherVAULT_CPP := -isystem $(MC_DIR)diff --git a/server/src/app/app.h b/server/src/app/app.hindex dc58e56..c0e09c0 100644--- a/server/src/app/app.h+++ b/server/src/app/app.h@@ -1,5 +1,5 @@/* app.h — «modo app» de lord-server: correr una app .lpk como su propio proceso aislado y- * cliente Wayland del compositor (ver appclient.c, docs/PRIVACIDAD.md). */+ * cliente Wayland del compositor (ver appclient.c, docs/PRIVACY.md). */#ifndef LORD_APP_H#define LORD_APP_Hdiff --git a/server/src/ui/js_broker.h b/server/src/ui/js_broker.hindex b4cb3ed..ad04725 100644--- a/server/src/ui/js_broker.h+++ b/server/src/ui/js_broker.h@@ -12,7 +12,7 @@ int js_broker_pending(void); /* events queued during an RPC, not dispatvoid js_broker_set_pkgdir(const char *dir); /* antes de la caja de arena */int js_broker_wants_network(void); /* la app declaró `network` y lo tiene permitido */void js_broker_register(JSContext *c, JSValue lord, const char *app_id);-/* lord.appWindows: the app's own windows (app/appclient.c, docs/PRIVACIDAD.md) */+/* lord.appWindows: the app's own windows (app/appclient.c, docs/PRIVACY.md) */void app_windows_register(JSContext *c, JSValue lord);/* RPCs over the broker for the app-side modules (js_brokercam.c). rpc_fd returns the passed fddiff --git a/server/src/vault/ctap2.h b/server/src/vault/ctap2.hindex 2ea0683..02cdf0b 100644--- a/server/src/vault/ctap2.h+++ b/server/src/vault/ctap2.h@@ -1,5 +1,5 @@/* ctap2.h — cliente FIDO2 propio (CTAP 2.0/2.1 sobre USB HID) para desbloquear la bóveda con una- * llave de seguridad (ver docs/CONTRASENAS.md, «Llave de seguridad FIDO2»).+ * llave de seguridad (ver docs/PASSWORDS.md, «Llave de seguridad FIDO2»).** Usa la extensión `hmac-secret`: la llave guarda un secreto por credencial (CredRandom) y, dado* un «salt» de 32 bytes, devuelve HMAC-SHA256(CredRandom, salt). Ese resultado es la clave quediff --git a/server/src/vault/dbus.h b/server/src/vault/dbus.hindex 61bc099..86f2622 100644--- a/server/src/vault/dbus.h+++ b/server/src/vault/dbus.h@@ -1,5 +1,5 @@/* dbus.h — cliente D-Bus propio y mínimo (sin libdbus ni sd-bus), lo justo para atender el- * Secret Service (secretsvc.c) desde lord-vault. Ver docs/CONTRASENAS.md, «Secret Service».+ * Secret Service (secretsvc.c) desde lord-vault. Ver docs/PASSWORDS.md, «Secret Service».** - Mensajes (especificación D-Bus 0.41): cabecera fija + campos a(yv) + cuerpo, alineación* por tipo, little endian al escribir y los dos órdenes al leer. Tipos: y b n q i u x t d sdiff --git a/server/src/vault/kdbx.h b/server/src/vault/kdbx.hindex abf8f38..5c17b66 100644--- a/server/src/vault/kdbx.h+++ b/server/src/vault/kdbx.h@@ -1,5 +1,5 @@/* kdbx.h — lector propio de bases de KeePass 2.x / KeePassXC (.kdbx), para importar (ver- * vimport.h y docs/CONTRASENAS.md, «Importar y exportar»).+ * vimport.h y docs/PASSWORDS.md, «Importar y exportar»).** Versiones: KDBX 4.0/4.1 (cabecera con SHA-256 y HMAC, bloques HMAC-SHA256, encabezado interno* con los adjuntos) y KDBX 3.1 (bloques con SHA-256, adjuntos en Meta/Binaries). KDF: Argon2d,diff --git a/server/src/vault/secretsvc.h b/server/src/vault/secretsvc.hindex fd03832..176ec4b 100644--- a/server/src/vault/secretsvc.h+++ b/server/src/vault/secretsvc.h@@ -1,5 +1,5 @@/* secretsvc.h — la API freedesktop Secret Service (org.freedesktop.secrets) sobre D-Bus, con un- * cliente D-Bus propio y mínimo (dbus.h: sin libdbus ni sd-bus). Ver docs/CONTRASENAS.md,+ * cliente D-Bus propio y mínimo (dbus.h: sin libdbus ni sd-bus). Ver docs/PASSWORDS.md,* «Secret Service».** Así Chromium, Firefox, libsecret/secret-tool y las demás apps Linux guardan sus contraseñas endiff --git a/server/src/vault/smem.h b/server/src/vault/smem.hindex 09e09e3..7d603a9 100644--- a/server/src/vault/smem.h+++ b/server/src/vault/smem.h@@ -1,4 +1,4 @@-/* smem.h — memoria para secretos de lord-vault (ver docs/CONTRASENAS.md, «Memoria»).+/* smem.h — memoria para secretos de lord-vault (ver docs/PASSWORDS.md, «Memoria»).** Todo lo descifrado (la bóveda, los campos, los pedidos y respuestas que llevan secretos) vive* en bloques de esta arena y no en el montón de la libc:diff --git a/server/src/vault/vclient.h b/server/src/vault/vclient.hindex 0e48974..11f8cb2 100644--- a/server/src/vault/vclient.h+++ b/server/src/vault/vclient.h@@ -1,4 +1,4 @@-/* vclient.h — lado de lord-server de lord-vault (ver vault.c y docs/CONTRASENAS.md).+/* vclient.h — lado de lord-server de lord-vault (ver vault.c y docs/PASSWORDS.md).** lord-server lanza el ayudante una vez por sesión (ruta fija: <carpeta de este binario>/lord-vault,* sin argumentos, entorno mínimo), le pasa la carpeta de las bóvedasdiff --git a/server/src/vault/vfile.c b/server/src/vault/vfile.cindex 98c3242..1141c16 100644--- a/server/src/vault/vfile.c+++ b/server/src/vault/vfile.c@@ -1,4 +1,4 @@-/* vfile.c — formato .lvault (ver vfile.h y docs/CONTRASENAS.md). */+/* vfile.c — formato .lvault (ver vfile.h y docs/PASSWORDS.md). */#include "vfile.h"#include "smem.h"#include "vcrypto.h"diff --git a/server/src/vault/vfile.h b/server/src/vault/vfile.hindex 94569f5..e3c3341 100644--- a/server/src/vault/vfile.h+++ b/server/src/vault/vfile.h@@ -1,4 +1,4 @@-/* vfile.h — el formato de archivo de la bóveda (.lvault), versión 1. Ver docs/CONTRASENAS.md,+/* vfile.h — el formato de archivo de la bóveda (.lvault), versión 1. Ver docs/PASSWORDS.md,* «El formato».** cabecera "LORDVLT\x1a", versión, largo de cabecera, id de la bóveda, fechas, contador,diff --git a/server/src/vault/vimport.h b/server/src/vault/vimport.hindex 3eaf9e6..79f912c 100644--- a/server/src/vault/vimport.h+++ b/server/src/vault/vimport.h@@ -1,4 +1,4 @@-/* vimport.h — importar y exportar contraseñas de otros gestores (ver docs/CONTRASENAS.md,+/* vimport.h — importar y exportar contraseñas de otros gestores (ver docs/PASSWORDS.md,* «Importar y exportar»). Corre adentro de lord-vault (encerrado, sin red): el archivo llega como* bytes ya leídos de un fd que abrió lord-server. Todo lo que se arma (textos, adjuntos) va en la* arena de secretos (smem.h) y imp_free lo borra.diff --git a/server/tests/clip_secret.c b/server/tests/clip_secret.cindex 9840985..e554ff5 100644--- a/server/tests/clip_secret.c+++ b/server/tests/clip_secret.c@@ -1,13 +1,13 @@-/* clip_secret.c — prueba del historial del portapapeles: un cliente Wayland que copia un texto- * marcándolo como secreto, igual que KeePassXC (ofrece text/plain y x-kde-passwordManagerHint).- * El historial de LordOS no tiene que guardarlo, pero sí se tiene que poder pegar.+/* clip_secret.c — clipboard history test: a Wayland client that copies a text+ * marking it as secret, just like KeePassXC (it offers text/plain and x-kde-passwordManagerHint).+ * LordOS's history must not store it, but it must still be possible to paste it.** cc -o clip-secret tests/clip_secret.c -lwayland-client* WAYLAND_DISPLAY=wayland-0 ./clip-secret "contraseña"*- * Necesita una ventana con foco de teclado para que el compositor acepte la selección; como no- * dibuja ninguna, usa el serial del primer evento de teclado que reciba (el compositor manda- * enter al dar el foco) o, si no llega, 0. */+ * It needs a window with keyboard focus for the compositor to accept the selection; since it+ * draws none, it uses the serial of the first keyboard event it receives (the compositor sends+ * enter when giving focus) or, if none arrives, 0. */#include <stdio.h>#include <stdlib.h>#include <string.h>@@ -40,11 +40,11 @@ static const struct wl_data_source_listener src = { .target = src_target, .sendint main(int argc, char **argv) {secret = argc > 1 ? argv[1] : "s3creta";struct wl_display *dpy = wl_display_connect(NULL);- if (!dpy) { fprintf(stderr, "sin Wayland\n"); return 1; }+ if (!dpy) { fprintf(stderr, "no Wayland\n"); return 1; }struct wl_registry *r = wl_display_get_registry(dpy);wl_registry_add_listener(r, ®, NULL);wl_display_roundtrip(dpy);- if (!seat || !ddm) { fprintf(stderr, "faltan wl_seat o wl_data_device_manager\n"); return 1; }+ if (!seat || !ddm) { fprintf(stderr, "wl_seat or wl_data_device_manager is missing\n"); return 1; }struct wl_data_device *dev = wl_data_device_manager_get_data_device(ddm, seat);struct wl_data_source *s = wl_data_device_manager_create_data_source(ddm);wl_data_source_add_listener(s, &src, NULL);@@ -53,8 +53,8 @@ int main(int argc, char **argv) {wl_data_source_offer(s, "x-kde-passwordManagerHint");wl_data_device_set_selection(dev, s, 0);wl_display_flush(dpy);- /* queda vivo unos segundos para servir el texto */+ /* stays alive for a few seconds to serve the text */for (int i = 0; i < 40 && !cancelled; i++) { wl_display_dispatch_pending(dpy); wl_display_flush(dpy); wl_display_roundtrip(dpy); usleep(100000); }- printf("listo\n");+ printf("ready\n");return 0;}diff --git a/server/tests/ctap_test.c b/server/tests/ctap_test.cindex 8b7510a..9336773 100644--- a/server/tests/ctap_test.c+++ b/server/tests/ctap_test.c@@ -1,8 +1,8 @@-/* ctap_test.c — capa FIDO2 sin hardware: CBOR (RFC 8949, apéndice A, rechazos y mutaciones al- * azar), P-256 (vectores de ECDH y k·G generados con python3-cryptography 43), la matemática del- * protocolo de PIN 1 / hmac-secret (contra los mismos vectores), CTAPHID (armado de una respuesta- * en varios paquetes, con KEEPALIVE, otro canal y continuaciones sueltas en el medio) contra un- * dispositivo falso por socketpair, y el reconocimiento de descriptores HID de fidodev.c. */+/* ctap_test.c — the FIDO2 layer without hardware: CBOR (RFC 8949, appendix A, rejections and random+ * mutations), P-256 (ECDH and k·G vectors generated with python3-cryptography 43), the math of+ * PIN protocol 1 / hmac-secret (against the same vectors), CTAPHID (reassembling a response+ * from several packets, with KEEPALIVE, another channel and stray continuations in between) against a+ * fake device over a socketpair, and fidodev.c's recognition of HID descriptors. */#include "vault/cbor.h"#include "vault/p256.h"#include "vault/ctap2.h"@@ -18,7 +18,7 @@#include <unistd.h>static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static size_t unhex(const char *h, uint8_t *out) {size_t k = 0;@@ -29,13 +29,13 @@ static int eqhex(const uint8_t *b, size_t n, const char *h) { uint8_t x[512]; si/* ---------- CBOR ---------- */-/* vuelve a codificar un ítem decodificado (prueba de ida y vuelta canónica) */+/* re-encodes a decoded item (canonical round-trip test) */static int reenc(const Cb *c, int i, CbW *w) {const CbItem *it = &c->it[i];switch (it->type) {case CB_UINT: cbw_uint(w, it->v); break;case CB_NINT: { uint8_t b = 0x20; (void)b;- /* -1 - v: con v que puede ser 2^64-1 */+ /* -1 - v: where v can be 2^64-1 */if (it->v < 24) { uint8_t x = (uint8_t)(0x20 | it->v); cbw_raw(w, &x, 1); }else { uint8_t hb[9]; int n; uint64_t v = it->v;if (v <= 0xff) { hb[0] = 0x38; hb[1] = (uint8_t)v; n = 2; }@@ -87,22 +87,22 @@ static void test_cbor(void) {snprintf(what, sizeof what, "CBOR RFC 8949 A: %s", ok[i]);check(roundtrip(b, n), what);}- /* el escritor solo */+ /* the writer alone */{uint8_t out[64];CbW w;cbw_init(&w, out, sizeof out);cbw_map(&w, 2); cbw_text(&w, "a"); cbw_int(&w, 1); cbw_text(&w, "b"); cbw_array(&w, 2); cbw_uint(&w, 2); cbw_uint(&w, 3);- check(eqhex(out, w.n, "a26161016162820203"), "CBOR escribir {a:1,b:[2,3]}");+ check(eqhex(out, w.n, "a26161016162820203"), "CBOR write {a:1,b:[2,3]}");cbw_init(&w, out, sizeof out);cbw_int(&w, -1000); cbw_int(&w, -25); cbw_uint(&w, 1000000000000ull);- check(eqhex(out, w.n, "3903e738181b000000e8d4a51000"), "CBOR escribir enteros");+ check(eqhex(out, w.n, "3903e738181b000000e8d4a51000"), "CBOR write integers");cbw_init(&w, out, 3);cbw_bytes(&w, "abcd", 4);- check(w.err, "CBOR escribir: búfer chico da error");+ check(w.err, "CBOR write: a small buffer gives an error");}- /* lo que se rechaza: flotantes, etiquetas, indefinidos, simples reservados, no mínimos,- * truncados, UTF-8 inválido, bytes de más, demasiado anidado */+ /* what is rejected: floats, tags, indefinite lengths, reserved simple values, non-minimal encodings,+ * truncation, invalid UTF-8, trailing bytes, nesting too deep */static const char *bad[] = {"f90000", "fa47c35000", "fb3ff199999999999a", "c074323031332d30332d32315432303a30343a30305a","5f42010243030405ff", "9f018202039f0405ffff", "bf61610161629f0203ffff", "7f657374726561646d696e67ff",@@ -117,18 +117,18 @@ static void test_cbor(void) {CbItem it[64];Cb c;char what[96];- snprintf(what, sizeof what, "CBOR rechaza %s", bad[i][0] ? bad[i] : "(vacío)");+ snprintf(what, sizeof what, "CBOR rejects %s", bad[i][0] ? bad[i] : "(empty)");check(cb_parse(&c, b, n, it, 64, 0) != 0, what);}- /* con allow_trailing: used dice dónde terminó */+ /* with allow_trailing: used says where it ended */{uint8_t b[8];size_t n = unhex("820102ffee", b);CbItem it[8];Cb c;- check(cb_parse(&c, b, n, it, 8, 1) == 0 && c.used == 3, "CBOR prefijo: used");+ check(cb_parse(&c, b, n, it, 8, 1) == 0 && c.used == 3, "CBOR prefix: used");}- /* búsqueda en mapas */+ /* map lookup */{uint8_t b[64];size_t n = unhex("a3010238180c626964a1617801", b); /* {1:2, -25:12, "id":{"x":1}} */@@ -141,9 +141,9 @@ static void test_cbor(void) {int m = cb_map_text(&c, 0, "id");ok2 = ok2 && cb_type(&c, m) == CB_MAP && cb_int(&c, cb_map_text(&c, m, "x"), &v) == 0 && v == 1;ok2 = ok2 && cb_map_int(&c, 0, 7) == -1 && cb_map_text(&c, 0, "nada") == -1;- check(ok2, "CBOR mapas: claves int y texto");+ check(ok2, "CBOR maps: int and text keys");}- /* mutaciones al azar: nunca se cae, y lo que acepta vuelve a codificarse igual (canónico) */+ /* random mutations: it never crashes, and whatever it accepts re-encodes identically (canonical) */{uint64_t s = 0x9e3779b97f4a7c15ull;int accepted = 0, bad_rt = 0;@@ -159,7 +159,7 @@ static void test_cbor(void) {switch (s % 4) {case 0: b[pos] ^= (uint8_t)(1u << ((s >> 32) % 8)); break;case 1: b[pos] = (uint8_t)(s >> 40); break;- case 2: n = pos; break; /* truncar */+ case 2: n = pos; break; /* truncate */default: if (n < sizeof b) { memmove(b + pos + 1, b + pos, n - pos); b[pos] = (uint8_t)(s >> 48); n++; } break;}}@@ -167,16 +167,16 @@ static void test_cbor(void) {Cb c;if (cb_parse(&c, b, n, it, 64, 0) == 0) { accepted++; if (!roundtrip(b, n)) bad_rt++; }}- printf("cbor: 200000 mutaciones, %d aceptadas\n", accepted);- check(bad_rt == 0, "CBOR mutaciones: lo aceptado es canónico");+ printf("cbor: 200000 mutations, %d accepted\n", accepted);+ check(bad_rt == 0, "CBOR mutations: what is accepted is canonical");}- /* más ítems que el arreglo del llamador */+ /* more items than the caller's array */{uint8_t b[64];size_t n = unhex("98190102030405060708090a0b0c0d0e0f101112131415161718181819", b);CbItem it[10];Cb c;- check(cb_parse(&c, b, n, it, 10, 0) != 0, "CBOR: tope de ítems");+ check(cb_parse(&c, b, n, it, 10, 0) != 0, "CBOR: item limit");}}@@ -204,26 +204,26 @@ static void test_p256(void) {check(p256_mul_base(k, x, y) == 0 && eqhex(x, 32, BASE[i][1]) && eqhex(y, 32, BASE[i][2]), "P-256 k·G");}unhex("ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", k); /* n */- check(p256_mul_base(k, x, y) == -1, "P-256 n·G = infinito");- check(p256_public(k, x, y) == -1, "P-256 clave privada = n se rechaza");+ check(p256_mul_base(k, x, y) == -1, "P-256 n·G = infinity");+ check(p256_public(k, x, y) == -1, "P-256 private key = n is rejected");memset(k, 0, 32);- check(p256_public(k, x, y) == -1, "P-256 clave privada 0 se rechaza");+ check(p256_public(k, x, y) == -1, "P-256 private key 0 is rejected");for (size_t i = 0; i < sizeof ECDH / sizeof *ECDH; i++) {uint8_t d1[32], d2[32], x1[32], y1[32], x2[32], y2[32];unhex(ECDH[i][0], d1); unhex(ECDH[i][1], d2);- check(p256_public(d1, x1, y1) == 0 && eqhex(x1, 32, ECDH[i][2]) && eqhex(y1, 32, ECDH[i][3]), "P-256 pública 1");- check(p256_public(d2, x2, y2) == 0 && eqhex(x2, 32, ECDH[i][4]) && eqhex(y2, 32, ECDH[i][5]), "P-256 pública 2");+ check(p256_public(d1, x1, y1) == 0 && eqhex(x1, 32, ECDH[i][2]) && eqhex(y1, 32, ECDH[i][3]), "P-256 public 1");+ check(p256_public(d2, x2, y2) == 0 && eqhex(x2, 32, ECDH[i][4]) && eqhex(y2, 32, ECDH[i][5]), "P-256 public 2");check(p256_ecdh(d1, x2, y2, z) == 0 && eqhex(z, 32, ECDH[i][6]), "P-256 ECDH d1·Q2");check(p256_ecdh(d2, x1, y1, z) == 0 && eqhex(z, 32, ECDH[i][6]), "P-256 ECDH d2·Q1");- check(p256_on_curve(x1, y1), "P-256 en la curva");+ check(p256_on_curve(x1, y1), "P-256 on the curve");y1[31] ^= 1;- check(!p256_on_curve(x1, y1) && p256_ecdh(d2, x1, y1, z) == -1, "P-256 punto fuera de la curva se rechaza");+ check(!p256_on_curve(x1, y1) && p256_ecdh(d2, x1, y1, z) == -1, "P-256 point off the curve is rejected");}- /* coordenada >= p */+ /* coordinate >= p */memset(x, 0xff, 32);memset(y, 0xff, 32);- check(!p256_on_curve(x, y), "P-256 coordenada >= p se rechaza");- /* par al azar: ECDH simétrico */+ check(!p256_on_curve(x, y), "P-256 coordinate >= p is rejected");+ /* random pair: symmetric ECDH */{uint8_t a[32], ax[32], ay[32], b[32], bx[32], by[32], z1[32], z2[32];int ok = 1;@@ -231,11 +231,11 @@ static void test_p256(void) {ok = p256_keypair(a, ax, ay) == 0 && p256_keypair(b, bx, by) == 0 &&p256_ecdh(a, bx, by, z1) == 0 && p256_ecdh(b, ax, ay, z2) == 0 && !memcmp(z1, z2, 32);}- check(ok, "P-256 20 pares al azar: ECDH simétrico");+ check(ok, "P-256 20 random pairs: symmetric ECDH");}}-/* ---------- protocolo de PIN 1 / hmac-secret ---------- */+/* ---------- PIN protocol 1 / hmac-secret ---------- */static void test_pinproto(void) {uint8_t d1[32], d2[32], x2[32], y2[32], z[32], key[32], h[32], enc[32], mac[32], iv[16];@@ -260,7 +260,7 @@ static void test_pinproto(void) {aes_wipe(&a);}-/* ---------- CTAPHID con un dispositivo falso ---------- */+/* ---------- CTAPHID with a fake device ---------- */static int dev_cbor_caps = 0x04;static uint8_t info_cbor[512];@@ -269,12 +269,12 @@ static size_t info_len;static void fake_send(int s, uint32_t cid, uint8_t cmd, const uint8_t *d, size_t n, int noise) {uint8_t p[64];if (noise) {- memset(p, 0, 64); p[0] = 0xde; p[1] = 0xad; p[2] = 0xbe; p[3] = 0xef; p[4] = 0x90; p[6] = 3; p[7] = 9; /* otro canal */+ memset(p, 0, 64); p[0] = 0xde; p[1] = 0xad; p[2] = 0xbe; p[3] = 0xef; p[4] = 0x90; p[6] = 3; p[7] = 9; /* another channel */send(s, p, 64, 0);memset(p, 0, 64); p[0] = (uint8_t)(cid >> 24); p[1] = (uint8_t)(cid >> 16); p[2] = (uint8_t)(cid >> 8); p[3] = (uint8_t)cid;p[4] = 0xbb; p[6] = 1; p[7] = 2; /* KEEPALIVE UPNEEDED */send(s, p, 64, 0);- p[4] = 0x05; /* continuación suelta */+ p[4] = 0x05; /* stray continuation */send(s, p, 64, 0);}memset(p, 0, 64);@@ -290,7 +290,7 @@ static void fake_send(int s, uint32_t cid, uint8_t cmd, const uint8_t *d, size_tmemcpy(p + 5, d + off, k);off += k;send(s, p, 64, 0);- if (noise && seq == 0) { /* keepalive entre continuaciones */+ if (noise && seq == 0) { /* keepalive between continuations */uint8_t q[64];memcpy(q, p, 4); memset(q + 4, 0, 60); q[4] = 0xbb; q[6] = 1; q[7] = 1;send(s, q, 64, 0);@@ -308,7 +308,7 @@ static void *fake_dev(void *arg) {for (;;) {ssize_t r = recv(s, in, sizeof in, 0);if (r <= 0) break;- if (r != 65 || in[0] != 0) { printf("FALLA: el cliente no escribió 65 bytes con reporte 0 (%zd)\n", r); fails++; break; }+ if (r != 65 || in[0] != 0) { printf("FAIL: the client did not write 65 bytes with report 0 (%zd)\n", r); fails++; break; }fake_packets++;uint8_t *p = in + 1;if (p[4] & 0x80) { cid = (uint32_t)p[0] << 24 | (uint32_t)p[1] << 16 | (uint32_t)p[2] << 8 | p[3]; cmd = p[4]; total = (size_t)p[5] << 8 | p[6]; got = total < 57 ? total : 57; memcpy(msg, p + 7, got); }@@ -319,7 +319,7 @@ static void *fake_dev(void *arg) {memcpy(rsp, msg, 8);rsp[8] = 0x11; rsp[9] = 0x22; rsp[10] = 0x33; rsp[11] = 0x44;rsp[12] = 2; rsp[13] = 5; rsp[14] = 4; rsp[15] = 3; rsp[16] = (uint8_t)dev_cbor_caps;- /* primero una respuesta a OTRO init (nonce distinto): el cliente la tiene que ignorar */+ /* first a reply to ANOTHER init (different nonce): the client has to ignore it */uint8_t other[17];memcpy(other, rsp, 17);other[0] ^= 0xff;@@ -331,17 +331,17 @@ static void *fake_dev(void *arg) {memcpy(rsp + 1, info_cbor, info_len);fake_send(s, cid, 0x90, rsp, info_len + 1, 1);} else if (cmd == 0x90 && msg[0] == 0x06) {- uint8_t rsp[] = { 0x00, 0xa1, 0x03, 0x07 }; /* {3: 7} reintentos */+ uint8_t rsp[] = { 0x00, 0xa1, 0x03, 0x07 }; /* {3: 7} retries */fake_send(s, cid, 0x90, rsp, sizeof rsp, 0);} else if (cmd == 0xc1) {- fake_send(s, cid, 0xc1, msg, total, 0); /* eco */+ fake_send(s, cid, 0xc1, msg, total, 0); /* echo */}}return NULL;}static void test_ctaphid(void) {- /* getInfo como el de una llave real (CTAP 2.1 PRE): 4 paquetes */+ /* getInfo like a real key's (CTAP 2.1 PRE): 4 packets */CbW w;cbw_init(&w, info_cbor, sizeof info_cbor);cbw_map(&w, 6);@@ -365,17 +365,17 @@ static void test_ctaphid(void) {FidoInfo info;int rc = fido_get_info(sv[0], &info);if (round == 0) {- check(rc == 0, "CTAPHID: getInfo en varios paquetes");- check(!strcmp(info.versions, "U2F_V2,FIDO_2_0,FIDO_2_1_PRE"), "CTAPHID: versiones");- check(info.hmac_secret == 1 && info.client_pin == 1 && info.pin_retries == 7, "CTAPHID: hmac-secret, PIN y reintentos");+ check(rc == 0, "CTAPHID: getInfo in several packets");+ check(!strcmp(info.versions, "U2F_V2,FIDO_2_0,FIDO_2_1_PRE"), "CTAPHID: versions");+ check(info.hmac_secret == 1 && info.client_pin == 1 && info.pin_retries == 7, "CTAPHID: hmac-secret, PIN and retries");check(!memcmp(info.aaguid, aaguid, 16), "CTAPHID: aaguid");uint8_t echo[200], back[200];for (int i = 0; i < 200; i++) echo[i] = (uint8_t)(i * 7);size_t bl = 0;rc = ctaphid_command(sv[0], 0xc1, echo, sizeof echo, back, sizeof back, &bl, 2000);- check(rc == 0 && bl == 200 && !memcmp(echo, back, 200), "CTAPHID: comando crudo de 200 bytes (ida y vuelta)");+ check(rc == 0 && bl == 200 && !memcmp(echo, back, 200), "CTAPHID: 200-byte raw command (round trip)");} else {- check(rc == 0 && info.hmac_secret == 0, "CTAPHID: llave solo U2F → sin hmac-secret");+ check(rc == 0 && info.hmac_secret == 0, "CTAPHID: U2F-only key → no hmac-secret");uint8_t cred[8] = { 1 }, salt[32] = { 0 }, out[32];check(fido_hmac_secret(sv[0], NULL, cred, 8, salt, out, 1000, NULL, NULL) == FIDO_ERR_NO_HMAC, "CTAPHID: U2F → FIDO_ERR_NO_HMAC");}@@ -383,33 +383,33 @@ static void test_ctaphid(void) {pthread_join(th, NULL);close(sv[1]);}- /* nadie contesta: se vence el plazo del INIT */+ /* nobody answers: the INIT deadline expires */{int sv[2];socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sv);FidoInfo info;- check(fido_get_info(sv[0], &info) == FIDO_ERR_TIMEOUT, "CTAPHID: sin respuesta → timeout");+ check(fido_get_info(sv[0], &info) == FIDO_ERR_TIMEOUT, "CTAPHID: no answer → timeout");close(sv[0]);close(sv[1]);}check(!strcmp(fido_strerror(FIDO_ERR_PIN_REQUIRED), "pin-required"), "fido_strerror");}-/* ---------- descriptores HID ---------- */+/* ---------- HID descriptors ---------- */static void test_desc(void) {uint8_t d[64];size_t n = unhex("06d0f10901a1010920150026ff007508954081020921150026ff00750895409102c0", d);- check(fidodev_desc_is_fido(d, n), "HID: descriptor FIDO");- n = unhex("0b0100d0f1a101c0", d); /* Usage de 32 bits (página en los 16 altos) */- check(fidodev_desc_is_fido(d, n), "HID: Usage de 32 bits");- n = unhex("05010906a101050719e029e7150025017501950881020507a102c0c0", d); /* teclado */- check(!fidodev_desc_is_fido(d, n), "HID: un teclado no es FIDO");- n = unhex("06d0f10901a1", d); /* cortado en el medio */- check(!fidodev_desc_is_fido(d, n), "HID: truncado");- n = unhex("06d0f10902a101c0", d); /* otra usage de la misma página */- check(!fidodev_desc_is_fido(d, n), "HID: página FIDO con otra usage");- check(fidodev_open("/etc/passwd") == -1 && fidodev_open("/dev/hidraw../x") == -1, "fidodev_open: rutas que no son hidraw");+ check(fidodev_desc_is_fido(d, n), "HID: FIDO descriptor");+ n = unhex("0b0100d0f1a101c0", d); /* 32-bit Usage (page in the high 16 bits) */+ check(fidodev_desc_is_fido(d, n), "HID: 32-bit Usage");+ n = unhex("05010906a101050719e029e7150025017501950881020507a102c0c0", d); /* keyboard */+ check(!fidodev_desc_is_fido(d, n), "HID: a keyboard is not FIDO");+ n = unhex("06d0f10901a1", d); /* cut in the middle */+ check(!fidodev_desc_is_fido(d, n), "HID: truncated");+ n = unhex("06d0f10902a101c0", d); /* another usage on the same page */+ check(!fidodev_desc_is_fido(d, n), "HID: FIDO page with another usage");+ check(fidodev_open("/etc/passwd") == -1 && fidodev_open("/dev/hidraw../x") == -1, "fidodev_open: paths that are not hidraw");}int main(void) {diff --git a/server/tests/dbus_test.c b/server/tests/dbus_test.cindex 03daa56..80c3ab4 100644--- a/server/tests/dbus_test.c+++ b/server/tests/dbus_test.c@@ -1,13 +1,13 @@-/* dbus_test.c — D-Bus propio y Secret Service (src/vault/dbus.c, secretsvc.c):- * - firmas, rutas y nombres válidos e inválidos;- * - ida y vuelta de cada tipo (escribir → armar → validar → leer) y casos de alineación;- * - mensajes reales capturados con dbus-monitor --binary (secret-tool + libsecret), si están;- * - rechazo de mensajes truncados, enormes, con firma, booleano, ruta o relleno inválidos;- * - «fuzz»: bytes cambiados y cortes al azar sobre mensajes válidos (nunca se cae);- * - la aritmética de 1024 bits contra pow() de Python y el grupo 2 de RFC 2409;- * - el Secret Service de punta a punta con un bus falso (socketpair + fork): sesiones plain y- * DH (cliente propio: modexp + HKDF + AES-128-CBC), crear, buscar, leer, cambiar, borrar,- * propiedades, introspección, bloquear y desbloquear con aviso (Prompt + Completed). */+/* dbus_test.c — our own D-Bus and Secret Service (src/vault/dbus.c, secretsvc.c):+ * - valid and invalid signatures, paths and names;+ * - round trip of every type (write → build → validate → read) and alignment cases;+ * - real messages captured with dbus-monitor --binary (secret-tool + libsecret), if present;+ * - rejection of truncated and huge messages, and of invalid signatures, booleans, paths or padding;+ * - "fuzz": flipped bytes and random cuts over valid messages (it never crashes);+ * - the 1024-bit arithmetic against Python's pow() and RFC 2409 group 2;+ * - the Secret Service end to end with a fake bus (socketpair + fork): plain and DH sessions+ * (our own client: modexp + HKDF + AES-128-CBC), create, search, read, change, delete,+ * properties, introspection, lock and unlock with a prompt (Prompt + Completed). */#include "vault/dbus.h"#include "vault/secretsvc.h"#include "vault/smem.h"@@ -26,13 +26,13 @@#include <unistd.h>static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static void unhex(const char *h, uint8_t *out, size_t n) {for (size_t i = 0; i < n; i++) { unsigned v; sscanf(h + 2 * i, "%2x", &v); out[i] = (uint8_t)v; }}-/* ---------- firmas ---------- */+/* ---------- signatures ---------- */static void t_sigs(void) {const char *good[] = { "", "s", "a{sv}", "(oayays)", "a{o(oayays)}", "aoao", "a{ss}", "vo", "a(yv)", "aaaai", "(i(s(b)))", "sa{sv}as", NULL };const char *bad[] = { "a", "a{", "a{sv", "{sv}", "()", "(s", "a{vs}", "a{(s)s}", "z", "ss)", "a{s}", "a{sss}", NULL };@@ -41,13 +41,13 @@ static void t_sigs(void) {char deep[80];memset(deep, 'a', 40);strcpy(deep + 40, "i");- check(!dbus_sig_valid(deep), "firma demasiado profunda");- check(dbus_path_valid("/") && dbus_path_valid("/org/freedesktop/secrets") && dbus_path_valid("/a_b/C9"), "rutas válidas");- check(!dbus_path_valid("") && !dbus_path_valid("org") && !dbus_path_valid("/a/") && !dbus_path_valid("//a") && !dbus_path_valid("/a-b"), "rutas inválidas");- check(dbus_name_valid("org.freedesktop.Secret.Service") && !dbus_name_valid("org") && !dbus_name_valid(".a.b") && !dbus_name_valid("a..b") && !dbus_name_valid("1a.b"), "nombres");+ check(!dbus_sig_valid(deep), "signature nested too deep");+ check(dbus_path_valid("/") && dbus_path_valid("/org/freedesktop/secrets") && dbus_path_valid("/a_b/C9"), "valid paths");+ check(!dbus_path_valid("") && !dbus_path_valid("org") && !dbus_path_valid("/a/") && !dbus_path_valid("//a") && !dbus_path_valid("/a-b"), "invalid paths");+ check(dbus_name_valid("org.freedesktop.Secret.Service") && !dbus_name_valid("org") && !dbus_name_valid(".a.b") && !dbus_name_valid("a..b") && !dbus_name_valid("1a.b"), "names");}-/* ---------- ida y vuelta ---------- */+/* ---------- round trip ---------- */static int build_parse(DHdr *h, DBuf *body, DMsg *m) {DBuf out;if (dbus_build(h, body, &out)) { dw_free(&out); return -1; }@@ -82,19 +82,19 @@ static void t_roundtrip(void) {dw_arr_end(&b, mk);dw_struct(&b); /* (oayays) */dw_str(&b, "/s/1"); dw_bytes(&b, raw, 16); dw_bytes(&b, raw, 5); dw_str(&b, "text/plain");- mk = dw_arr_begin(&b, 8); /* ax vacío: igual se alinea a 8 */+ mk = dw_arr_begin(&b, 8); /* empty ax: still aligned to 8 */dw_arr_end(&b, mk);const char *sig = "ybiuts" "og" "aya{ss}a{sv}(oayays)ax";DHdr h = { .type = DBUS_CALL, .serial = 9, .path = "/test", .iface = "a.b", .member = "M", .dest = "x.y", .sig = sig, .sender = ":1.1" };DMsg m;int r = build_parse(&h, &b, &m);- check(r == 0, "ida y vuelta: armar y validar");+ check(r == 0, "round trip: build and validate");if (r) { dw_free(&b); return; }- check(!strcmp(m.path, "/test") && !strcmp(m.iface, "a.b") && !strcmp(m.member, "M") && !strcmp(m.dest, "x.y") && !strcmp(m.sender, ":1.1") && !strcmp(m.sig, sig) && m.serial == 9, "campos de la cabecera");+ check(!strcmp(m.path, "/test") && !strcmp(m.iface, "a.b") && !strcmp(m.member, "M") && !strcmp(m.dest, "x.y") && !strcmp(m.sender, ":1.1") && !strcmp(m.sig, sig) && m.serial == 9, "header fields");DRd d;dr_init(&d, &m);- check(dr_u8(&d) == 0xab && dr_bool(&d) == 1 && dr_i32(&d) == -5 && dr_u32(&d) == 0xdeadbeef && dr_u64(&d) == 0x0123456789abcdefULL, "números");- check(!strcmp(dr_str(&d, NULL), "hola, ñandú") && !strcmp(dr_str(&d, NULL), "/org/freedesktop/secrets") && !strcmp(dr_sig(&d), "a{sv}"), "textos");+ check(dr_u8(&d) == 0xab && dr_bool(&d) == 1 && dr_i32(&d) == -5 && dr_u32(&d) == 0xdeadbeef && dr_u64(&d) == 0x0123456789abcdefULL, "numbers");+ check(!strcmp(dr_str(&d, NULL), "hola, ñandú") && !strcmp(dr_str(&d, NULL), "/org/freedesktop/secrets") && !strcmp(dr_sig(&d), "a{sv}"), "strings");uint32_t n;const uint8_t *p = dr_bytes(&d, &n);check(n == 300 && !memcmp(p, raw, 300), "ay");@@ -105,32 +105,32 @@ static void t_roundtrip(void) {end = dr_arr(&d, 8);k = 0;while (dr_more(&d, end)) { dr_struct(&d); dr_str(&d, NULL); const char *vs = dr_variant(&d); dr_skip(&d, vs); k++; }- check(k == 3, "a{sv} con dr_skip");+ check(k == 3, "a{sv} with dr_skip");dr_struct(&d);check(!strcmp(dr_str(&d, NULL), "/s/1"), "(oayays) o");dr_bytes(&d, &n); check(n == 16, "(oayays) params");dr_bytes(&d, &n); check(n == 5, "(oayays) value");check(!strcmp(dr_str(&d, NULL), "text/plain"), "(oayays) s");end = dr_arr(&d, 8);- check(!dr_more(&d, end) && !d.err && d.pos == d.len, "ax vacío y fin exacto");+ check(!dr_more(&d, end) && !d.err && d.pos == d.len, "empty ax and exact end");dbus_msg_free(&m);dw_free(&b);- /* alineación: y seguido de t (7 de relleno), cuerpo vacío sin firma */+ /* alignment: y followed by t (7 bytes of padding), empty body without a signature */dw_init(&b);dw_u8(&b, 1);dw_u64(&b, 2);- check(b.n == 16 && b.p[1] == 0 && b.p[7] == 0 && b.p[8] == 2, "relleno de y→t");+ check(b.n == 16 && b.p[1] == 0 && b.p[7] == 0 && b.p[8] == 2, "y→t padding");DHdr h2 = { .type = DBUS_RETURN, .serial = 3, .reply_serial = 2, .sig = "yt" };- check(build_parse(&h2, &b, &m) == 0, "yt válido");+ check(build_parse(&h2, &b, &m) == 0, "valid yt");dbus_msg_free(&m);dw_free(&b);DHdr h3 = { .type = DBUS_SIGNAL, .serial = 4, .path = "/", .iface = "a.b", .member = "S" };- check(build_parse(&h3, NULL, &m) == 0 && m.body_len == 0 && !strcmp(m.sig, ""), "señal sin cuerpo");+ check(build_parse(&h3, NULL, &m) == 0 && m.body_len == 0 && !strcmp(m.sig, ""), "signal without a body");dbus_msg_free(&m);}-/* ---------- rechazos ---------- */+/* ---------- rejections ---------- */static uint8_t *valid_msg(size_t *len) {DBuf b;dw_init(&b);@@ -154,7 +154,7 @@ static void t_reject(void) {size_t len;uint8_t *v = valid_msg(&len);DMsg m;- check(dbus_msg_parse(v, len, &m) == 0, "base válida");+ check(dbus_msg_parse(v, len, &m) == 0, "valid base");dbus_msg_free(&m);int ok = 1;for (size_t i = 0; i < len; i++) {@@ -162,71 +162,71 @@ static void t_reject(void) {if (s > 0 && s == (long)i) ok = 0;if (dbus_msg_parse(v, i, &m) == 0) { ok = 0; dbus_msg_free(&m); }}- check(ok, "todos los cortes se rechazan");+ check(ok, "every cut is rejected");uint8_t *w = malloc(len);- /* largo del cuerpo enorme */+ /* huge body length */memcpy(w, v, len); w[4] = 0xff; w[5] = 0xff; w[6] = 0xff; w[7] = 0x7f;- check(dbus_msg_size(w, len) == -1, "cuerpo de 2 GB");- /* versión mala / orden de bytes malo / tipo malo / serial 0 */- memcpy(w, v, len); w[3] = 2; check(dbus_msg_parse(w, len, &m) != 0, "versión 2");- memcpy(w, v, len); w[0] = 'x'; check(dbus_msg_parse(w, len, &m) != 0, "orden de bytes");- memcpy(w, v, len); w[1] = 9; check(dbus_msg_parse(w, len, &m) != 0, "tipo 9");+ check(dbus_msg_size(w, len) == -1, "2 GB body");+ /* bad version / bad byte order / bad type / serial 0 */+ memcpy(w, v, len); w[3] = 2; check(dbus_msg_parse(w, len, &m) != 0, "version 2");+ memcpy(w, v, len); w[0] = 'x'; check(dbus_msg_parse(w, len, &m) != 0, "byte order");+ memcpy(w, v, len); w[1] = 9; check(dbus_msg_parse(w, len, &m) != 0, "type 9");memcpy(w, v, len); memset(w + 8, 0, 4); check(dbus_msg_parse(w, len, &m) != 0, "serial 0");- /* buscar en el mensaje y romper: el booleano (último u32 antes del arreglo), la firma */+ /* find things in the message and break them: the boolean (last u32 before the array), the signature */uint8_t *sg = memmem(w, len, "sba{sv}", 7);memcpy(w, v, len); sg = memmem(w, len, "sba{sv}", 7);- if (sg) { sg[3] = '('; check(dbus_msg_parse(w, len, &m) != 0, "firma rota"); }+ if (sg) { sg[3] = '('; check(dbus_msg_parse(w, len, &m) != 0, "broken signature"); }memcpy(w, v, len); sg = memmem(w, len, "hola", 4);if (sg) {- sg[1] = 0; check(dbus_msg_parse(w, len, &m) != 0, "NUL adentro de un texto");+ sg[1] = 0; check(dbus_msg_parse(w, len, &m) != 0, "NUL inside a string");memcpy(w, v, len);- size_t bo = (size_t)(sg - w) + 5; /* después de "hola\0" viene el booleano alineado */+ size_t bo = (size_t)(sg - w) + 5; /* after "hola\0" comes the aligned boolean */bo = (bo + 3) & ~(size_t)3;- w[bo] = 2; check(dbus_msg_parse(w, len, &m) != 0, "booleano 2");+ w[bo] = 2; check(dbus_msg_parse(w, len, &m) != 0, "boolean 2");memcpy(w, v, len);- w[(size_t)(sg - w) + 5] = 7; /* relleno distinto de cero */- check(dbus_msg_parse(w, len, &m) != 0, "relleno no nulo");+ w[(size_t)(sg - w) + 5] = 7; /* non-zero padding */+ check(dbus_msg_parse(w, len, &m) != 0, "non-zero padding");}memcpy(w, v, len); sg = memmem(w, len, "/x", 2);- if (sg) { sg[1] = '-'; check(dbus_msg_parse(w, len, &m) != 0, "ruta inválida"); }- /* llamada sin member */+ if (sg) { sg[1] = '-'; check(dbus_msg_parse(w, len, &m) != 0, "invalid path"); }+ /* call without a member */DBuf out;DHdr h = { .type = DBUS_CALL, .serial = 1, .path = "/x" };dbus_build(&h, NULL, &out);- check(dbus_msg_parse(out.p, out.n, &m) != 0, "llamada sin member");+ check(dbus_msg_parse(out.p, out.n, &m) != 0, "call without a member");dw_free(&out);- /* error sin reply_serial */+ /* error without reply_serial */DHdr he = { .type = DBUS_ERROR, .serial = 1, .error = "a.b" };dbus_build(&he, NULL, &out);- check(dbus_msg_parse(out.p, out.n, &m) != 0, "error sin reply_serial");+ check(dbus_msg_parse(out.p, out.n, &m) != 0, "error without reply_serial");dw_free(&out);- /* cuerpo sin firma */+ /* body without a signature */DBuf b;dw_init(&b);dw_u32(&b, 1);DHdr hn = { .type = DBUS_RETURN, .serial = 1, .reply_serial = 1 };dbus_build(&hn, &b, &out);- check(dbus_msg_parse(out.p, out.n, &m) != 0, "cuerpo sin firma");+ check(dbus_msg_parse(out.p, out.n, &m) != 0, "body without a signature");dw_free(&out);- /* arreglo cuyo largo pasa el final y variante con dos tipos */+ /* array whose length runs past the end, and a variant with two types */dw_free(&b); dw_init(&b);dw_u32(&b, 1000);DHdr ha = { .type = DBUS_RETURN, .serial = 1, .reply_serial = 1, .sig = "ay" };dbus_build(&ha, &b, &out);- check(dbus_msg_parse(out.p, out.n, &m) != 0, "arreglo más largo que el cuerpo");+ check(dbus_msg_parse(out.p, out.n, &m) != 0, "array longer than the body");dw_free(&out);dw_free(&b); dw_init(&b);dw_sig(&b, "ss"); dw_str(&b, "a"); dw_str(&b, "b");DHdr hv = { .type = DBUS_RETURN, .serial = 1, .reply_serial = 1, .sig = "v" };dbus_build(&hv, &b, &out);- check(dbus_msg_parse(out.p, out.n, &m) != 0, "variante con dos tipos");+ check(dbus_msg_parse(out.p, out.n, &m) != 0, "variant with two types");dw_free(&out);- /* variantes anidadas sin fin */+ /* endlessly nested variants */dw_free(&b); dw_init(&b);for (int i = 0; i < 40; i++) dw_sig(&b, "v");dw_sig(&b, "y"); dw_u8(&b, 1);dbus_build(&hv, &b, &out);- check(dbus_msg_parse(out.p, out.n, &m) != 0, "variantes anidadas de más");+ check(dbus_msg_parse(out.p, out.n, &m) != 0, "too many nested variants");dw_free(&out);dw_free(&b);free(w);@@ -276,7 +276,7 @@ static int fuzz_one(const uint8_t *base, size_t len, int rounds) {return accepted;}-/* ---------- capturas reales ---------- */+/* ---------- real captures ---------- */static int t_capture(const char *file, uint8_t ***msgs, size_t **lens) {FILE *f = fopen(file, "rb");if (!f) return -1;@@ -303,7 +303,7 @@ static int t_capture(const char *file, uint8_t ***msgs, size_t **lens) {}p += (size_t)s;}- check(!bad, "capturas: todos los mensajes válidos");+ check(!bad, "captures: every message valid");return count;}@@ -319,17 +319,17 @@ static void t_modexp(void) {unhex(MODEXP[i][0], b, 128); unhex(MODEXP[i][1], e, 128); unhex(MODEXP[i][2], m, 128); unhex(MODEXP[i][3], want, 128);if (ss_dh_modexp(b, e, m, got) || memcmp(got, want, 128)) { ok = 0; printf(" modexp vector %d\n", i); }}- check(ok, "modexp contra pow() de Python");- check(!memcmp(ss_dh_prime(), (const uint8_t *)"\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x0f\xda\xa2", 12) && ss_dh_prime()[127] == 0xff, "primo del grupo 2");+ check(ok, "modexp against Python's pow()");+ check(!memcmp(ss_dh_prime(), (const uint8_t *)"\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x0f\xda\xa2", 12) && ss_dh_prime()[127] == 0xff, "group 2 prime");uint8_t even[128] = { 0 }, one[128] = { 0 }, out[128];even[127] = 4; one[127] = 1;- check(ss_dh_modexp(one, one, even, out) != 0, "módulo par rechazado");+ check(ss_dh_modexp(one, one, even, out) != 0, "even modulus rejected");double t0 = (double)clock();for (int i = 0; i < 10; i++) ss_dh_modexp(one, (const uint8_t *)MODEXP[0][1], ss_dh_prime(), out);- printf("modexp de 1024 bits: %.2f ms\n", ((double)clock() - t0) / CLOCKS_PER_SEC * 100.0);+ printf("1024-bit modexp: %.2f ms\n", ((double)clock() - t0) / CLOCKS_PER_SEC * 100.0);}-/* ---------- Secret Service con un bus falso ---------- */+/* ---------- Secret Service with a fake bus ---------- */static DConn bus;static uint32_t bserial = 100;static int completed_seen, completed_dismissed, item_created_seen;@@ -348,8 +348,8 @@ static int bus_read_line(int fd, char *out, size_t cap) {static void bus_send(DHdr *h, DBuf *b) { h->serial = ++bserial; dbus_send(&bus, h, b); }-/* espera la respuesta a serial (contesta con error las llamadas del servicio al bus, toma nota de- * las señales). 1 RETURN, 0 ERROR, -1 nada */+/* waits for the reply to serial (answers the service's calls to the bus with an error, takes note of+ * the signals). 1 RETURN, 0 ERROR, -1 nothing */static int bus_wait(uint32_t serial, DMsg *m, int ms) {double end = (double)time(NULL) + ms / 1000.0 + 1;while ((double)time(NULL) < end) {@@ -364,7 +364,7 @@ static int bus_wait(uint32_t serial, DMsg *m, int ms) {if (!serial) return 2;continue;}- if (m->type == DBUS_CALL) { /* GetConnectionUnixProcessID: contestar 4242 */+ if (m->type == DBUS_CALL) { /* GetConnectionUnixProcessID: answer 4242 */if (!strcmp(m->member, "GetConnectionUnixProcessID")) {DBuf b; dw_init(&b); dw_u32(&b, 4242);DHdr h = { .type = DBUS_RETURN, .reply_serial = m->serial, .dest = ":1.7", .sig = "u", .sender = "org.freedesktop.DBus" };@@ -481,7 +481,7 @@ static int get_secret_val(DRd *d, const Cli *c, char *out, size_t cap) {return 0;}-/* El flujo real con el bus falso: hace falta contestar Hello y RequestName antes. */+/* The real flow with the fake bus: Hello and RequestName have to be answered first. */static int fake_bus_start(pid_t *pid_out) {int sv[2];if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) return -1;@@ -512,7 +512,7 @@ static int fake_bus_start(pid_t *pid_out) {if (!strcmp(m.member, "Hello")) { dw_str(&b, ":1.7"); sig = "s"; }else if (!strcmp(m.member, "RequestName")) {DRd d; dr_init(&d, &m);- check(!strcmp(dr_str(&d, NULL), "org.freedesktop.secrets") && dr_u32(&d) == 4, "RequestName con DO_NOT_QUEUE");+ check(!strcmp(dr_str(&d, NULL), "org.freedesktop.secrets") && dr_u32(&d) == 4, "RequestName with DO_NOT_QUEUE");dw_u32(&b, 1); sig = "u";} else { dbus_msg_free(&m); dw_free(&b); return -1; }DHdr h = { .type = DBUS_RETURN, .reply_serial = m.serial, .dest = ":1.7", .sig = sig, .sender = "org.freedesktop.DBus" };@@ -537,7 +537,7 @@ static char *create(const Cli *c, const char *label, const char *user, const chadw_struct(&b); dw_str(&b, "org.freedesktop.Secret.Item.Label"); dw_variant(&b, "s"); dw_str(&b, label);dw_struct(&b); dw_str(&b, "org.freedesktop.Secret.Item.Attributes"); dw_variant(&b, "a{ss}");attrs2(&b, "service", "demo", "user", user);- dw_struct(&b); dw_str(&b, "otra.cosa"); dw_variant(&b, "a{sv}"); /* desconocida: se saltea */+ dw_struct(&b); dw_str(&b, "otra.cosa"); dw_variant(&b, "a{sv}"); /* unknown: skipped */size_t mk2 = dw_arr_begin(&b, 8); dw_struct(&b); dw_str(&b, "x"); dw_variant(&b, "u"); dw_u32(&b, 1); dw_arr_end(&b, mk2);dw_arr_end(&b, mk);put_secret(&b, c, secret);@@ -591,8 +591,8 @@ static int search_count(const char *user, int *nlocked) {static void t_service_flow(void) {pid_t pid;- if (fake_bus_start(&pid)) { check(0, "bus falso: arranque"); return; }- check(1, "bus falso: SASL, Hello y RequestName");+ if (fake_bus_start(&pid)) { check(0, "fake bus: startup"); return; }+ check(1, "fake bus: SASL, Hello and RequestName");Cli plain, dh;check(open_session(&plain, 0) == 0, "OpenSession plain");check(open_session(&dh, 1) == 0, "OpenSession dh-ietf1024-sha256-aes128-cbc-pkcs7");@@ -602,17 +602,17 @@ static void t_service_flow(void) {char *it2 = create(&dh, "Banco", "beto", "secreto con DH: 0123456789abcdef", 0, &err);check(it2 != NULL, "CreateItem (DH)");char *it3 = create(&dh, "Banco", "beto", "reemplazado", 1, &err);- check(it3 && it2 && !strcmp(it2, it3), "CreateItem replace reusa el ítem");+ check(it3 && it2 && !strcmp(it2, it3), "CreateItem replace reuses the item");char v[128];check(read_item(it1, &plain, ":1.9", v) == 0 && !strcmp(v, "clave plana ñ"), "GetSecret plain");- check(read_item(it1, &dh, ":1.9", v) == 0 && !strcmp(v, "clave plana ñ"), "GetSecret DH (descifrado del lado cliente)");- check(read_item(it2, &dh, ":1.9", v) == 0 && !strcmp(v, "reemplazado"), "secreto reemplazado");- check(read_item(it1, &plain, ":1.66", v) != 0 && !strcmp(v, "org.freedesktop.Secret.Error.NoSession"), "sesión de otro cliente: NoSession");+ check(read_item(it1, &dh, ":1.9", v) == 0 && !strcmp(v, "clave plana ñ"), "GetSecret DH (decrypted on the client side)");+ check(read_item(it2, &dh, ":1.9", v) == 0 && !strcmp(v, "reemplazado"), "secret replaced");+ check(read_item(it1, &plain, ":1.66", v) != 0 && !strcmp(v, "org.freedesktop.Secret.Error.NoSession"), "another client's session: NoSession");int nl = -1;check(search_count(NULL, &nl) == 2 && nl == 0, "SearchItems (service=demo)");check(search_count("ana", NULL) == 1, "SearchItems (user=ana)");- check(search_count("nadie", NULL) == 0, "SearchItems sin resultados");- /* GetSecrets de los dos */+ check(search_count("nadie", NULL) == 0, "SearchItems with no results");+ /* GetSecrets of both */{DBuf b; dw_init(&b);size_t mk = dw_arr_begin(&b, 4); dw_str(&b, it1); dw_str(&b, it2); dw_str(&b, "/org/freedesktop/secrets/collection/login/nada"); dw_arr_end(&b, mk);@@ -627,9 +627,9 @@ static void t_service_flow(void) {while (dr_more(&d, end)) { dr_struct(&d); dr_str(&d, NULL); char s[128]; if (get_secret_val(&d, &dh, s, sizeof s)) good = 0; n++; }dbus_msg_free(&m);}- check(r == 1 && n == 2 && good, "GetSecrets (2 de 3, DH)");+ check(r == 1 && n == 2 && good, "GetSecrets (2 of 3, DH)");}- /* SetSecret por DH */+ /* SetSecret over DH */{DBuf b; dw_init(&b);put_secret(&b, &dh, "nuevo valor");@@ -639,7 +639,7 @@ static void t_service_flow(void) {if (r >= 0) dbus_msg_free(&m);check(r == 1 && read_item(it1, &plain, ":1.9", v) == 0 && !strcmp(v, "nuevo valor"), "SetSecret (DH)");}- /* propiedades */+ /* properties */{DBuf b; dw_init(&b); dw_str(&b, "org.freedesktop.Secret.Item");DMsg m;@@ -658,7 +658,7 @@ static void t_service_flow(void) {}dbus_msg_free(&m);}- check(r == 1 && found == 2, "Properties.GetAll del ítem");+ check(r == 1 && found == 2, "Properties.GetAll of the item");dw_init(&b); dw_str(&b, "org.freedesktop.Secret.Item"); dw_str(&b, "Label"); dw_variant(&b, "s"); dw_str(&b, "Correo 2");r = call(":1.9", it1, "org.freedesktop.DBus.Properties", "Set", "ssv", &b, &m);dw_free(&b);@@ -676,7 +676,7 @@ static void t_service_flow(void) {if (r == 1) { DRd d; dr_init(&d, &m); ok = !strcmp(dr_variant(&d), "ao"); size_t e = dr_arr(&d, 4); ok = ok && dr_more(&d, e) && !strcmp(dr_str(&d, NULL), "/org/freedesktop/secrets/collection/login"); dbus_msg_free(&m); }check(ok, "Service.Collections");}- /* alias, introspección, errores */+ /* alias, introspection, errors */{DBuf b; dw_init(&b); dw_str(&b, "default");DMsg m;@@ -688,11 +688,11 @@ static void t_service_flow(void) {r = call(":1.9", "/org/freedesktop/secrets", "org.freedesktop.DBus.Introspectable", "Introspect", "", NULL, &m);ok = 0;if (r == 1) { DRd d; dr_init(&d, &m); const char *x = dr_str(&d, NULL); ok = strstr(x, "OpenSession") && strstr(x, "<node name=\"collection\"/>"); dbus_msg_free(&m); }- check(ok, "Introspect del servicio");+ check(ok, "Introspect of the service");r = call(":1.9", "/org/freedesktop/secrets/collection/login", "org.freedesktop.DBus.Introspectable", "Introspect", "", NULL, &m);ok = 0;if (r == 1) { DRd d; dr_init(&d, &m); const char *x = dr_str(&d, NULL); ok = strstr(x, "CreateItem") && strstr(x, "<node name=\"i0001\"/>"); dbus_msg_free(&m); }- check(ok, "Introspect de la colección con sus ítems");+ check(ok, "Introspect of the collection with its items");r = call(":1.9", "/org/freedesktop/secrets/collection/login", "org.freedesktop.Secret.Collection", "Delete", "", NULL, &m);ok = r == 0 && !strcmp(m.error, "org.freedesktop.DBus.Error.NotSupported");if (r >= 0) dbus_msg_free(&m);@@ -700,22 +700,22 @@ static void t_service_flow(void) {r = call(":1.9", "/org/freedesktop/secrets", "org.freedesktop.Secret.Service", "Inventado", "", NULL, &m);ok = r == 0 && !strcmp(m.error, "org.freedesktop.DBus.Error.UnknownMethod");if (r >= 0) dbus_msg_free(&m);- check(ok, "método desconocido");+ check(ok, "unknown method");r = call(":1.9", "/no/existe", NULL, "Ping", "", NULL, &m);ok = r == 0;if (r >= 0) dbus_msg_free(&m);- check(ok, "objeto desconocido");+ check(ok, "unknown object");dw_init(&b); dw_str(&b, "plain");r = call(":1.9", "/org/freedesktop/secrets", "org.freedesktop.Secret.Service", "OpenSession", "s", &b, &m);dw_free(&b);ok = r == 0 && !strcmp(m.error, "org.freedesktop.DBus.Error.InvalidArgs");if (r >= 0) dbus_msg_free(&m);- check(ok, "firma equivocada: InvalidArgs");+ check(ok, "wrong signature: InvalidArgs");r = call(":1.9", "/org/freedesktop/secrets", "org.freedesktop.DBus.Peer", "Ping", "", NULL, &m);if (r >= 0) dbus_msg_free(&m);check(r == 1, "Peer.Ping");}- /* bloquear → búsqueda vacía, GetSecret IsLocked → Unlock con aviso → Completed */+ /* lock → empty search, GetSecret IsLocked → Unlock with a prompt → Completed */{DBuf b; dw_init(&b);size_t mk = dw_arr_begin(&b, 4); dw_str(&b, "/org/freedesktop/secrets/collection/login"); dw_arr_end(&b, mk);@@ -724,8 +724,8 @@ static void t_service_flow(void) {if (r >= 0) dbus_msg_free(&m);check(r == 1, "Lock");int nlk = -1;- check(search_count(NULL, &nlk) == 0 && nlk == 2, "bloqueado: los ítems van en la lista locked");- check(read_item(it1, &plain, ":1.9", v) != 0 && !strcmp(v, "org.freedesktop.Secret.Error.IsLocked"), "bloqueado: IsLocked");+ check(search_count(NULL, &nlk) == 0 && nlk == 2, "locked: the items go in the locked list");+ check(read_item(it1, &plain, ":1.9", v) != 0 && !strcmp(v, "org.freedesktop.Secret.Error.IsLocked"), "locked: IsLocked");r = call(":1.9", "/org/freedesktop/secrets", "org.freedesktop.Secret.Service", "Unlock", "ao", &b, &m);dw_free(&b);char prompt[96] = "";@@ -738,7 +738,7 @@ static void t_service_flow(void) {snprintf(prompt, sizeof prompt, "%s", dr_str(&d, NULL));dbus_msg_free(&m);}- check(r == 1 && nun == 0 && !strncmp(prompt, "/org/freedesktop/secrets/prompt/", 32), "Unlock devuelve un aviso");+ check(r == 1 && nun == 0 && !strncmp(prompt, "/org/freedesktop/secrets/prompt/", 32), "Unlock returns a prompt");dw_init(&b); dw_str(&b, "");completed_seen = 0;r = call(":1.9", prompt, "org.freedesktop.Secret.Prompt", "Prompt", "s", &b, &m);@@ -746,10 +746,10 @@ static void t_service_flow(void) {if (r >= 0) dbus_msg_free(&m);check(r == 1, "Prompt.Prompt");for (int i = 0; i < 40 && !completed_seen; i++) { DMsg s; if (bus_wait(0, &s, 100) == 1) dbus_msg_free(&s); }- check(completed_seen == 1 && completed_dismissed == 0, "Completed (no cancelado)");- check(read_item(it1, &plain, ":1.9", v) == 0 && !strcmp(v, "nuevo valor"), "desbloqueado: GetSecret de nuevo");+ check(completed_seen == 1 && completed_dismissed == 0, "Completed (not dismissed)");+ check(read_item(it1, &plain, ":1.9", v) == 0 && !strcmp(v, "nuevo valor"), "unlocked: GetSecret again");}- /* borrar */+ /* delete */{DMsg m;int r = call(":1.9", it1, "org.freedesktop.Secret.Item", "Delete", "", NULL, &m);@@ -759,7 +759,7 @@ static void t_service_flow(void) {if (r >= 0) dbus_msg_free(&m);check(r == 1 && read_item(it2, &plain, ":1.9", v) != 0, "Session.Close");}- check(item_created_seen >= 2, "señales ItemCreated");+ check(item_created_seen >= 2, "ItemCreated signals");free(it1); free(it2); free(it3);kill(pid, SIGKILL);waitpid(pid, NULL, 0);@@ -773,7 +773,7 @@ int main(int argc, char **argv) {t_roundtrip();t_reject();t_modexp();- /* fuzz sobre mensajes propios y capturados */+ /* fuzz over our own and captured messages */size_t len;uint8_t *v = valid_msg(&len);int acc = fuzz_one(v, len, 100000);@@ -784,10 +784,10 @@ int main(int argc, char **argv) {int acc2 = 0;for (int i = 0; i < ncap; i++) { acc2 += fuzz_one(caps[i], clens[i], 4000); free(caps[i]); }free(caps); free(clens);- if (ncap >= 0) printf("capturas reales: %d mensajes de libsecret\n", ncap);- else printf("capturas reales: no está tests/secretsvc/libsecret-capture.bin (se saltea)\n");- printf("fuzz: 100000 + %d mutaciones, aceptadas %d + %d, sin caídas\n", ncap > 0 ? ncap * 4000 : 0, acc, acc2);- check(1, "fuzz sin caídas");+ if (ncap >= 0) printf("real captures: %d messages from libsecret\n", ncap);+ else printf("real captures: tests/secretsvc/libsecret-capture.bin is missing (skipped)\n");+ printf("fuzz: 100000 + %d mutations, accepted %d + %d, no crashes\n", ncap > 0 ? ncap * 4000 : 0, acc, acc2);+ check(1, "fuzz without crashes");t_service_flow();printf("dbus-test: %d/%d\n", total - fails, total);return fails ? 1 : 0;diff --git a/server/tests/fido_e2e.c b/server/tests/fido_e2e.cindex 1245e62..23af9ae 100644--- a/server/tests/fido_e2e.c+++ b/server/tests/fido_e2e.c@@ -1,6 +1,6 @@-/* fido_e2e.c — el cliente CTAP2 de punta a punta contra el autenticador por software- * (../tests/fido-soft/softfido.c, por uhid). Lo corre tests/fido-soft/run-pw-116.sh con sudo.- * Solo prueba contra softfido: una llave real (YubiKey, SoloKey, Nitrokey) NO está probada acá. */+/* fido_e2e.c — the CTAP2 client end to end against the software authenticator+ * (../tests/fido-soft/softfido.c, over uhid). tests/fido-soft/run-pw-116.sh runs it with sudo.+ * It only tests against softfido: a real key (YubiKey, SoloKey, Nitrokey) is NOT tested here. */#include "vault/ctap2.h"#include "vault/fidodev.h"@@ -12,7 +12,7 @@#include <unistd.h>static int fails, total;-static void check(int ok, const char *what) { total++; printf("%s %s\n", ok ? "ok " : "FALLA", what); if (!ok) fails++; }+static void check(int ok, const char *what) { total++; printf("%s %s\n", ok ? "ok " : "FAIL ", what); if (!ok) fails++; }static int touches;static void on_status(void *ud, int st) { (void)ud; if (st == FIDO_ST_TOUCH) touches++; }@@ -32,51 +32,51 @@ int main(void) {FidoDev devs[8];int n = fidodev_list(devs, 8), soft = -1;for (int i = 0; i < n; i++) {- printf("llave: %s «%s» %04x:%04x\n", devs[i].path, devs[i].name, devs[i].vid, devs[i].pid);+ printf("key: %s «%s» %04x:%04x\n", devs[i].path, devs[i].name, devs[i].vid, devs[i].pid);if (strstr(devs[i].name, "LordOS Soft FIDO2")) soft = i;}- check(soft >= 0, "fidodev_list encuentra el autenticador por software");+ check(soft >= 0, "fidodev_list finds the software authenticator");if (soft < 0) return 1;- check(devs[soft].vid == 0x1209 && devs[soft].pid == 0x5f1d, "fidodev: vid:pid de uevent");+ check(devs[soft].vid == 0x1209 && devs[soft].pid == 0x5f1d, "fidodev: vid:pid from uevent");int fd = fidodev_open(devs[soft].path);check(fd >= 0, "fidodev_open");if (fd < 0) return 1;FidoInfo info;check(fido_get_info(fd, &info) == 0, "getInfo");- check(info.hmac_secret == 1 && info.client_pin == 0, "getInfo: hmac-secret, sin PIN");+ check(info.hmac_secret == 1 && info.client_pin == 0, "getInfo: hmac-secret, no PIN");uint8_t cred[FIDO_CRED_MAX], cred2[FIDO_CRED_MAX];size_t cl = 0, cl2 = 0;touches = 0;int rc = fido_make_credential(fd, NULL, cred, &cl, 10000, on_status, NULL);- check(rc == 0 && cl > 0, "makeCredential con hmac-secret");- check(touches > 0, "makeCredential: avisó «tocá la llave»");+ check(rc == 0 && cl > 0, "makeCredential with hmac-secret");+ check(touches > 0, "makeCredential: asked to «touch the key»");uint8_t saltA[32], saltB[32], o1[32], o2[32], o3[32];for (int i = 0; i < 32; i++) { saltA[i] = (uint8_t)i; saltB[i] = (uint8_t)(255 - i); }long long t0 = now_ms();rc = fido_hmac_secret(fd, NULL, cred, cl, saltA, o1, 10000, on_status, NULL);- printf("hmac-secret: %lld ms (con 3 «toques» simulados de 100 ms)\n", now_ms() - t0);+ printf("hmac-secret: %lld ms (with 3 simulated 100 ms «touches»)\n", now_ms() - t0);check(rc == 0, "hmac-secret salt A");- check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 10000, NULL, NULL) == 0 && !memcmp(o1, o2, 32), "hmac-secret: mismo salt → mismo secreto");- check(fido_hmac_secret(fd, NULL, cred, cl, saltB, o3, 10000, NULL, NULL) == 0 && memcmp(o1, o3, 32), "hmac-secret: otro salt → otro secreto");+ check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 10000, NULL, NULL) == 0 && !memcmp(o1, o2, 32), "hmac-secret: same salt → same secret");+ check(fido_hmac_secret(fd, NULL, cred, cl, saltB, o3, 10000, NULL, NULL) == 0 && memcmp(o1, o3, 32), "hmac-secret: another salt → another secret");- check(fido_make_credential(fd, NULL, cred2, &cl2, 10000, NULL, NULL) == 0, "segunda credencial");- check(fido_hmac_secret(fd, NULL, cred2, cl2, saltA, o2, 10000, NULL, NULL) == 0 && memcmp(o1, o2, 32), "otra credencial → otro secreto");+ check(fido_make_credential(fd, NULL, cred2, &cl2, 10000, NULL, NULL) == 0, "second credential");+ check(fido_hmac_secret(fd, NULL, cred2, cl2, saltA, o2, 10000, NULL, NULL) == 0 && memcmp(o1, o2, 32), "another credential → another secret");uint8_t bad[FIDO_CRED_MAX];memcpy(bad, cred, cl);bad[cl / 2] ^= 0x40;rc = fido_hmac_secret(fd, NULL, bad, cl, saltA, o2, 10000, NULL, NULL);- check(rc == FIDO_ERR_NO_CREDENTIAL, "credencial ajena → FIDO_ERR_NO_CREDENTIAL");+ check(rc == FIDO_ERR_NO_CREDENTIAL, "foreign credential → FIDO_ERR_NO_CREDENTIAL");- check(set_mode(fd, 1) == 0, "modo: nadie toca");+ check(set_mode(fd, 1) == 0, "mode: nobody touches");t0 = now_ms();rc = fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 1200, NULL, NULL);long long dt = now_ms() - t0;- check(rc == FIDO_ERR_TIMEOUT && dt >= 1100 && dt < 3500, "sin toque → FIDO_ERR_TIMEOUT a tiempo");- printf(" (tardó %lld ms con plazo de 1200)\n", dt);+ check(rc == FIDO_ERR_TIMEOUT && dt >= 1100 && dt < 3500, "no touch → FIDO_ERR_TIMEOUT on time");+ printf(" (took %lld ms with a 1200 ms deadline)\n", dt);cancel_fd = fd;pthread_t th;@@ -84,30 +84,30 @@ int main(void) {t0 = now_ms();rc = fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 10000, NULL, NULL);pthread_join(th, NULL);- check(rc == FIDO_ERR_CANCELLED && now_ms() - t0 < 3000, "fido_cancel desde otro hilo → FIDO_ERR_CANCELLED");+ check(rc == FIDO_ERR_CANCELLED && now_ms() - t0 < 3000, "fido_cancel from another thread → FIDO_ERR_CANCELLED");rc = set_mode(fd, 2);if (rc) printf(" set_mode: %s\n", fido_strerror(rc));- check(rc == 0, "modo: el usuario rechaza");- check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 5000, NULL, NULL) == FIDO_ERR_DENIED, "rechazo → FIDO_ERR_DENIED");+ check(rc == 0, "mode: the user declines");+ check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 5000, NULL, NULL) == FIDO_ERR_DENIED, "declined → FIDO_ERR_DENIED");set_mode(fd, 0);- check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 5000, NULL, NULL) == 0 && !memcmp(o1, o2, 32), "después de todo eso, vuelve a dar el mismo secreto");+ check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 5000, NULL, NULL) == 0 && !memcmp(o1, o2, 32), "after all that, it gives the same secret again");/* PIN */- check(fido_set_pin(fd, "12") == FIDO_ERR_PIN_INVALID, "setPIN: muy corto se rechaza (cliente)");+ check(fido_set_pin(fd, "12") == FIDO_ERR_PIN_INVALID, "setPIN: too short is rejected (client)");check(fido_set_pin(fd, "1234") == 0, "setPIN 1234");- check(fido_get_info(fd, &info) == 0 && info.client_pin == 1 && info.pin_retries == 8, "getInfo: con PIN, 8 reintentos");- check(fido_set_pin(fd, "5678") == FIDO_ERR_DENIED, "setPIN otra vez → rechazado (ya tiene)");- check(fido_make_credential(fd, NULL, cred2, &cl2, 5000, NULL, NULL) == FIDO_ERR_PIN_REQUIRED, "makeCredential sin PIN → FIDO_ERR_PIN_REQUIRED");- check(fido_make_credential(fd, "0000", cred2, &cl2, 5000, NULL, NULL) == FIDO_ERR_PIN_INVALID, "PIN equivocado → FIDO_ERR_PIN_INVALID");- check(fido_get_info(fd, &info) == 0 && info.pin_retries == 7, "un reintento menos");- check(fido_make_credential(fd, "1234", cred2, &cl2, 5000, NULL, NULL) == 0, "makeCredential con PIN");- check(fido_get_info(fd, &info) == 0 && info.pin_retries == 8, "PIN bien: reintentos de vuelta a 8");- check(fido_hmac_secret(fd, "1234", cred2, cl2, saltA, o2, 5000, NULL, NULL) == 0, "hmac-secret con PIN (UV)");- check(fido_hmac_secret(fd, NULL, cred2, cl2, saltA, o3, 5000, NULL, NULL) == 0, "hmac-secret de la misma credencial sin PIN (solo toque)");- printf(" (softfido es CTAP 2.0: con y sin UV dan %s)\n", memcmp(o2, o3, 32) ? "distinto" : "lo mismo");- check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 5000, NULL, NULL) == 0 && !memcmp(o1, o2, 32), "la credencial de antes del PIN sigue dando lo mismo");- check(fido_hmac_secret(fd, "9999", cred, cl, saltA, o2, 5000, NULL, NULL) == FIDO_ERR_PIN_INVALID, "hmac-secret con PIN equivocado → FIDO_ERR_PIN_INVALID");+ check(fido_get_info(fd, &info) == 0 && info.client_pin == 1 && info.pin_retries == 8, "getInfo: with PIN, 8 retries");+ check(fido_set_pin(fd, "5678") == FIDO_ERR_DENIED, "setPIN again → denied (already set)");+ check(fido_make_credential(fd, NULL, cred2, &cl2, 5000, NULL, NULL) == FIDO_ERR_PIN_REQUIRED, "makeCredential without PIN → FIDO_ERR_PIN_REQUIRED");+ check(fido_make_credential(fd, "0000", cred2, &cl2, 5000, NULL, NULL) == FIDO_ERR_PIN_INVALID, "wrong PIN → FIDO_ERR_PIN_INVALID");+ check(fido_get_info(fd, &info) == 0 && info.pin_retries == 7, "one retry fewer");+ check(fido_make_credential(fd, "1234", cred2, &cl2, 5000, NULL, NULL) == 0, "makeCredential with PIN");+ check(fido_get_info(fd, &info) == 0 && info.pin_retries == 8, "correct PIN: retries back to 8");+ check(fido_hmac_secret(fd, "1234", cred2, cl2, saltA, o2, 5000, NULL, NULL) == 0, "hmac-secret with PIN (UV)");+ check(fido_hmac_secret(fd, NULL, cred2, cl2, saltA, o3, 5000, NULL, NULL) == 0, "hmac-secret of the same credential without PIN (touch only)");+ printf(" (softfido is CTAP 2.0: with and without UV they give %s)\n", memcmp(o2, o3, 32) ? "different results" : "the same");+ check(fido_hmac_secret(fd, NULL, cred, cl, saltA, o2, 5000, NULL, NULL) == 0 && !memcmp(o1, o2, 32), "the credential from before the PIN still gives the same");+ check(fido_hmac_secret(fd, "9999", cred, cl, saltA, o2, 5000, NULL, NULL) == FIDO_ERR_PIN_INVALID, "hmac-secret with a wrong PIN → FIDO_ERR_PIN_INVALID");close(fd);printf("fido-e2e: %d/%d\n", total - fails, total);diff --git a/server/tests/import/gen-kdbx.py b/server/tests/import/gen-kdbx.pyindex 5f46e47..dee1600 100644--- a/server/tests/import/gen-kdbx.py+++ b/server/tests/import/gen-kdbx.py@@ -1,4 +1,4 @@-# KDBX 4 con pykeepass (otro cifrado/KDF/archivo llave), mismas entradas que sample.xml.+# KDBX 4 with pykeepass (other cipher/KDF/key file), same entries as sample.xml.from pykeepass import PyKeePass, create_databaseimport copy, datetimePW = 'lordos-prueba'@@ -33,7 +33,7 @@ e.mtime = datetime.datetime(2025, 1, 2, 3, 4, 5, tzinfo=datetime.timezone.utc)k.add_entry(inet, 'Correo', '[email protected]', 'correo-123', url='https://mail.example.org', tags=['web'])k.add_entry(srv, 'vps1', 'root', 'ssh-pass', url='ssh://203.0.113.5:22')k.add_entry(k.root_group, 'Raíz suelta', 'u', 'p')-# una entrada en la papelera: no se importa+# an entry in the trash: it is not importedtrash = k.add_entry(k.root_group, 'Borrada', 'x', 'y')k.trash_entry(trash)d0 = k.kdbx.header.value.dynamic_header.kdf_parameters.data.dictdiff --git a/server/tests/import/gen-kdbx.sh b/server/tests/import/gen-kdbx.shindex 194aa59..bc58dbd 100755--- a/server/tests/import/gen-kdbx.sh+++ b/server/tests/import/gen-kdbx.sh@@ -1,7 +1,7 @@#!/bin/sh-# Genera las bóvedas KDBX de prueba (VM 116). Contraseña de todas: "lordos-prueba"-# kx3-aeskdf.kdbx: KeePassXC 2.7.10 (keepassxc-cli import de sample.xml): KDBX 3.1, AES-256, AES-KDF-# kx4-*.kdbx: pykeepass 4.2.0 (KDBX 4), con las mismas entradas+# Generates the KDBX test vaults (VM 116). Password for all of them: "lordos-prueba"+# kx3-aeskdf.kdbx: KeePassXC 2.7.10 (keepassxc-cli import of sample.xml): KDBX 3.1, AES-256, AES-KDF+# kx4-*.kdbx: pykeepass 4.2.0 (KDBX 4), with the same entriesset -ecd "$(dirname "$0")"rm -f kx*.kdbx kx-*.key kx-*.keyxdiff --git a/server/tests/import_smem_shim.c b/server/tests/import_smem_shim.cindex b1d9d86..5d75e73 100644--- a/server/tests/import_smem_shim.c+++ b/server/tests/import_smem_shim.c@@ -1,6 +1,6 @@-/* import_smem_shim.c — la API de smem.h sobre malloc, solo para las pruebas de los importadores:- * así AddressSanitizer y LeakSanitizer ven cada bloque (la arena real usa su propio mmap y los- * desbordes adentro de un trozo no se detectarían). Borra al liberar, como la real. */+/* import_smem_shim.c — the smem.h API on top of malloc, only for the importer tests:+ * this way AddressSanitizer and LeakSanitizer see every block (the real arena uses its own mmap and+ * overflows inside a chunk would go undetected). It wipes on free, like the real one. */#include "vault/smem.h"#include <malloc.h>diff --git a/server/tests/import_test.c b/server/tests/import_test.cindex 2d3f0bd..6ab3e29 100644--- a/server/tests/import_test.c+++ b/server/tests/import_test.c@@ -1,15 +1,15 @@-/* import_test.c — importadores de la bóveda (src/vault/vimport.c, csvp.c, kdbx.c, xmlmini.c).+/* import_test.c — the vault importers (src/vault/vimport.c, csvp.c, kdbx.c, xmlmini.c).*- * Datos en tests/import/:- * - CSV/JSON escritos a mano con los encabezados de cada exportador (Chrome, Firefox, Apple,- * Bitwarden CSV y JSON) y keepassxc.csv, exportado de verdad por keepassxc-cli 2.7.10;- * - bóvedas KDBX reales (gen-kdbx.sh/gen-kdbx.py en la VM 116): kx3-aeskdf.kdbx (KeePassXC- * 2.7.10, KDBX 3.1, AES-256 + AES-KDF, flujo interno Salsa20) y kx4-*.kdbx (pykeepass 4.2.0,- * KDBX 4.0: AES/Argon2d, ChaCha20/Argon2id + archivo llave binario, AES/Argon2id + archivo- * llave XML 2.0, ChaCha20/AES-KDF). La contraseña de todas es "lordos-prueba".- * Además: ida y vuelta del CSV propio, KDBX con contraseña equivocada, alterado y cortado, y- * miles de mutaciones (cortes y bytes cambiados) de cada muestra, con ASan/UBSan si el- * compilador los tiene. Mide el CSV de 10 000 entradas y el desbloqueo de cada KDBX. */+ * Data in tests/import/:+ * - CSV/JSON written by hand with each exporter's headers (Chrome, Firefox, Apple,+ * Bitwarden CSV and JSON) and keepassxc.csv, really exported by keepassxc-cli 2.7.10;+ * - real KDBX vaults (gen-kdbx.sh/gen-kdbx.py on VM 116): kx3-aeskdf.kdbx (KeePassXC+ * 2.7.10, KDBX 3.1, AES-256 + AES-KDF, Salsa20 inner stream) and kx4-*.kdbx (pykeepass 4.2.0,+ * KDBX 4.0: AES/Argon2d, ChaCha20/Argon2id + binary key file, AES/Argon2id + XML 2.0+ * key file, ChaCha20/AES-KDF). The password for all of them is "lordos-prueba".+ * Also: round trip of our own CSV, KDBX with a wrong password, tampered and truncated, and+ * thousands of mutations (cuts and changed bytes) of each sample, with ASan/UBSan if the+ * compiler has them. Measures the 10,000-entry CSV and unlocking each KDBX. */#include "vault/vimport.h"#include "vault/kdbx.h"#include "vault/xmlmini.h"@@ -25,14 +25,14 @@#define PW "lordos-prueba"static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static int eq(const char *a, const char *b) { return a && b && !strcmp(a, b); }static uint8_t *slurp(const char *name, size_t *n) {char p[256];snprintf(p, sizeof p, DIR "%s", name);FILE *f = fopen(p, "rb");- if (!f) { printf("no está %s\n", p); exit(2); }+ if (!f) { printf("missing %s\n", p); exit(2); }fseek(f, 0, SEEK_END);long sz = ftell(f);fseek(f, 0, SEEK_SET);@@ -65,21 +65,21 @@ static int parse_file(const char *name, int kind, const char *pw, const char *kfreturn r;}-/* ---------- CSV y JSON ---------- */+/* ---------- CSV and JSON ---------- */static void test_csv_reader(void) {const char *s = "\xef\xbb\xbf" "a,\"b,1\",\"c\"\"d\"\r\n\r\n\"multi\nlínea\",,x\nlast,";Csv c;CsvRow r = { 0 };csv_init(&c, s, strlen(s));- check(csv_next(&c, &r) == 1 && r.n == 3 && eq(r.f[0], "a") && eq(r.f[1], "b,1") && eq(r.f[2], "c\"d"), "CSV: comillas y BOM");- check(csv_next(&c, &r) == 1 && r.n == 3 && eq(r.f[0], "multi\nlínea") && eq(r.f[1], "") && eq(r.f[2], "x"), "CSV: salto adentro y vacío");- check(csv_next(&c, &r) == 1 && r.n == 2 && eq(r.f[1], ""), "CSV: coma final");- check(csv_next(&c, &r) == 0, "CSV: fin");+ check(csv_next(&c, &r) == 1 && r.n == 3 && eq(r.f[0], "a") && eq(r.f[1], "b,1") && eq(r.f[2], "c\"d"), "CSV: quotes and BOM");+ check(csv_next(&c, &r) == 1 && r.n == 3 && eq(r.f[0], "multi\nlínea") && eq(r.f[1], "") && eq(r.f[2], "x"), "CSV: embedded newline and empty field");+ check(csv_next(&c, &r) == 1 && r.n == 2 && eq(r.f[1], ""), "CSV: trailing comma");+ check(csv_next(&c, &r) == 0, "CSV: end");csv_row_free(&r);const char *bad = "a,\"sin cerrar\n";csv_init(&c, bad, strlen(bad));- check(csv_next(&c, &r) == -1, "CSV: comillas sin cerrar");+ check(csv_next(&c, &r) == -1, "CSV: unclosed quotes");csv_row_free(&r);}@@ -95,75 +95,75 @@ static void test_formats(void) {for (size_t i = 0; i < sizeof det / sizeof *det; i++) {d = slurp(det[i].f, &n);char w[80];- snprintf(w, sizeof w, "detectar %s", det[i].f);+ snprintf(w, sizeof w, "detect %s", det[i].f);check(imp_detect(d, n, det[i].f) == det[i].kind, w);free(d);}- check(parse_file("chrome.csv", 0, NULL, NULL, &l) == 0 && l.n == 3, "Chrome: 3 entradas");+ check(parse_file("chrome.csv", 0, NULL, NULL, &l) == 0 && l.n == 3, "Chrome: 3 entries");const ImpEntry *e = find(&l, "ejemplo.com");- check(e && eq(e->password, "pa,ss\"word") && eq(e->username, "[email protected]") && eq(e->url, "https://ejemplo.com/login") && !e->notes, "Chrome: campos");+ check(e && eq(e->password, "pa,ss\"word") && eq(e->username, "[email protected]") && eq(e->url, "https://ejemplo.com/login") && !e->notes, "Chrome: fields");e = find(&l, "banco.example");- check(e && eq(e->password, "ñandú-€-123") && eq(e->notes, "nota con\nsalto de línea"), "Chrome: unicode y nota");- check(find(&l, "sin-nombre.example.org") != NULL, "Chrome: título desde la URL");+ check(e && eq(e->password, "ñandú-€-123") && eq(e->notes, "nota con\nsalto de línea"), "Chrome: unicode and note");+ check(find(&l, "sin-nombre.example.org") != NULL, "Chrome: title from the URL");imp_free(&l);- check(parse_file("firefox.csv", 0, NULL, NULL, &l) == 0 && l.n == 2, "Firefox: 2 entradas");+ check(parse_file("firefox.csv", 0, NULL, NULL, &l) == 0 && l.n == 2, "Firefox: 2 entries");e = find(&l, "mozilla.org");- check(e && eq(e->password, "r3d\"panda") && e->created == 1700000000 && e->modified == 1700000600, "Firefox: campos y fechas");+ check(e && eq(e->password, "r3d\"panda") && e->created == 1700000000 && e->modified == 1700000600, "Firefox: fields and dates");e = find(&l, "accounts.example.com");- check(e && !e->username && eq(e->password, "only-pass"), "Firefox: sin usuario");+ check(e && !e->username && eq(e->password, "only-pass"), "Firefox: no username");imp_free(&l);- check(parse_file("apple.csv", 0, NULL, NULL, &l) == 0 && l.n == 2, "Apple: 2 entradas");+ check(parse_file("apple.csv", 0, NULL, NULL, &l) == 0 && l.n == 2, "Apple: 2 entries");e = find(&l, "example.com (ana)");check(e && eq(e->password, "x,y") && e->otp && !strncmp(e->otp, "otpauth://totp/example.com:ana?secret=JBSWY3DPEHPK3PXP", 53), "Apple: OTPAuth");e = find(&l, "GitHub");- check(e && eq(e->notes, "Nota \"importante\"") && !e->otp, "Apple: nota");+ check(e && eq(e->notes, "Nota \"importante\"") && !e->otp, "Apple: note");imp_free(&l);- check(parse_file("bitwarden.csv", 0, NULL, NULL, &l) == 0 && l.n == 2, "Bitwarden CSV: 2 entradas");+ check(parse_file("bitwarden.csv", 0, NULL, NULL, &l) == 0 && l.n == 2, "Bitwarden CSV: 2 entries");e = find(&l, "Twitter");int ft = -1;check(e && e->favorite && eq(e->group, "Redes Sociales") && eq(e->url, "https://twitter.com") && e->nurls == 1 && eq(e->urls[0], "https://x.com") &&eq(field(e, "PIN", &ft), "1234") && eq(field(e, "campo1", NULL), "valor1") && eq(e->otp, "JBSWY3DPEHPK3PXP"), "Bitwarden CSV: login");e = find(&l, "Nota secreta");- check(e && eq(e->kind, "note") && eq(e->notes, "Contenido de la nota") && !e->group, "Bitwarden CSV: nota");+ check(e && eq(e->kind, "note") && eq(e->notes, "Contenido de la nota") && !e->group, "Bitwarden CSV: note");imp_free(&l);- check(parse_file("bitwarden.json", 0, NULL, NULL, &l) == 0 && l.n == 4, "Bitwarden JSON: 4 entradas");- check(l.ngroups == 2, "Bitwarden JSON: carpetas (también la vacía)");+ check(parse_file("bitwarden.json", 0, NULL, NULL, &l) == 0 && l.n == 4, "Bitwarden JSON: 4 entries");+ check(l.ngroups == 2, "Bitwarden JSON: folders (including the empty one)");e = find(&l, "Banco Ñandú");check(e && e->favorite && eq(e->group, "Finanzas") && eq(e->username, "juan") && eq(e->password, "p@\"ss\\w0rd") &&eq(e->url, "https://banco.example.com") && e->nurls == 1 && eq(e->notes, "línea1\nlínea2") && e->otp &&e->created == 1704164645 && e->modified == 1738555506, "Bitwarden JSON: login");ft = -1;check(eq(field(e, "PIN", &ft), "9876") && ft == IMPF_HIDDEN && eq(field(e, "Cliente", NULL), "000123") &&- eq(field(e, "Activo", NULL), "true") && !field(e, "Vinculado", NULL), "Bitwarden JSON: campos propios");+ eq(field(e, "Activo", NULL), "true") && !field(e, "Vinculado", NULL), "Bitwarden JSON: custom fields");e = find(&l, "Visa");ft = -1;check(e && eq(e->kind, "card") && eq(field(e, "holder", NULL), "Juan Pérez") && eq(field(e, "number", &ft), "4111111111111111") && ft == IMPF_HIDDEN &&- eq(field(e, "expiry", NULL), "07/2029") && eq(field(e, "cvv", NULL), "123") && eq(e->group, "Finanzas"), "Bitwarden JSON: tarjeta");+ eq(field(e, "expiry", NULL), "07/2029") && eq(field(e, "cvv", NULL), "123") && eq(e->group, "Finanzas"), "Bitwarden JSON: card");e = find(&l, "Yo");- check(e && eq(e->kind, "identity") && eq(field(e, "lastName", NULL), "Pérez") && eq(field(e, "passportNumber", NULL), "AAA123") && !field(e, "middleName", NULL), "Bitwarden JSON: identidad");+ check(e && eq(e->kind, "identity") && eq(field(e, "lastName", NULL), "Pérez") && eq(field(e, "passportNumber", NULL), "AAA123") && !field(e, "middleName", NULL), "Bitwarden JSON: identity");e = find(&l, "Nota");- check(e && eq(e->kind, "note") && eq(e->notes, "texto secreto \xf0\x9f\x94\x91"), "Bitwarden JSON: nota con emoji (pares sustitutos)");+ check(e && eq(e->kind, "note") && eq(e->notes, "texto secreto \xf0\x9f\x94\x91"), "Bitwarden JSON: note with emoji (surrogate pairs)");imp_free(&l);- check(parse_file("bitwarden-encrypted.json", 0, NULL, NULL, &l) == -1 && eq(l.err, "encrypted-export"), "Bitwarden JSON cifrado: aviso");+ check(parse_file("bitwarden-encrypted.json", 0, NULL, NULL, &l) == -1 && eq(l.err, "encrypted-export"), "encrypted Bitwarden JSON: warning");- check(parse_file("keepassxc.csv", 0, NULL, NULL, &l) == 0 && l.n == 4, "KeePassXC CSV: 4 entradas (sin la papelera)");+ check(parse_file("keepassxc.csv", 0, NULL, NULL, &l) == 0 && l.n == 4, "KeePassXC CSV: 4 entries (without the trash)");e = find(&l, "Banco Ñandú");check(e && eq(e->group, "Internet/Bancos") && eq(e->password, "s3cr3t&\"<€") && eq(e->notes, "línea 1\nlínea 2") && e->otp &&- e->created == 1709634030 && e->modified == 1735787045, "KeePassXC CSV: campos, carpeta y fechas");+ e->created == 1709634030 && e->modified == 1735787045, "KeePassXC CSV: fields, folder and dates");e = find(&l, "Raíz suelta");- check(e && !e->group, "KeePassXC CSV: entrada de la raíz");+ check(e && !e->group, "KeePassXC CSV: root entry");imp_free(&l);}static void test_roundtrip(void) {ImpList a, b;- check(parse_file("bitwarden.json", 0, NULL, NULL, &a) == 0, "ida y vuelta: leer");- /* agregar etiquetas para probarlas también */+ check(parse_file("bitwarden.json", 0, NULL, NULL, &a) == 0, "round trip: read");+ /* add tags to test them too */ImpEntry *e = &a.v[0];e->tags = sm_alloc(2 * sizeof(char *));e->tags[0] = sm_strdup("uno");@@ -171,13 +171,13 @@ static void test_roundtrip(void) {e->ntags = 2;char *csv = NULL;size_t n = 0;- check(exp_csv(&a, &csv, &n) == 0, "exportar CSV propio");- check(imp_detect((uint8_t *)csv, n, NULL) == IMP_LORD_CSV, "detectar CSV propio");- check(imp_parse(0, (uint8_t *)csv, n, NULL, NULL, 0, &b) == 0 && b.n == a.n, "volver a leer el CSV propio");+ check(exp_csv(&a, &csv, &n) == 0, "export our own CSV");+ check(imp_detect((uint8_t *)csv, n, NULL) == IMP_LORD_CSV, "detect our own CSV");+ check(imp_parse(0, (uint8_t *)csv, n, NULL, NULL, 0, &b) == 0 && b.n == a.n, "read our own CSV back");int same = 1;for (int i = 0; i < a.n && i < b.n; i++) {const ImpEntry *x = &a.v[i], *y = &b.v[i];-#define S(f) if (!((!x->f && !y->f) || eq(x->f, y->f))) { same = 0; printf(" distinto %s en %d: «%s» «%s»\n", #f, i, x->f ? x->f : "-", y->f ? y->f : "-"); }+#define S(f) if (!((!x->f && !y->f) || eq(x->f, y->f))) { same = 0; printf(" different %s at %d: «%s» «%s»\n", #f, i, x->f ? x->f : "-", y->f ? y->f : "-"); }S(title) S(username) S(password) S(url) S(notes) S(otp) S(group) S(kind)#undef Sif (x->ntags != y->ntags || x->nfields != y->nfields || x->nurls != y->nurls || x->favorite != y->favorite || x->created != y->created || x->modified != y->modified) same = 0;@@ -185,7 +185,7 @@ static void test_roundtrip(void) {if (!eq(x->fields[k].key, y->fields[k].key) || !eq(x->fields[k].value, y->fields[k].value) || x->fields[k].type != y->fields[k].type) same = 0;for (int k = 0; same && k < x->ntags; k++) if (!eq(x->tags[k], y->tags[k])) same = 0;}- check(same, "CSV propio: todo igual");+ check(same, "our own CSV: everything identical");sm_free(csv);imp_free(&a);imp_free(&b);@@ -196,26 +196,26 @@ static void test_roundtrip(void) {static void check_kdbx_content(const ImpList *l, const char *name, int v4) {char w[160];#define C(cond, what) do { snprintf(w, sizeof w, "%s: %s", name, what); check(cond, w); } while (0)- C(l->n == 4, "4 entradas (sin la papelera)");+ C(l->n == 4, "4 entries (without the trash)");const ImpEntry *e = find(l, "Banco Ñandú");- C(e != NULL, "entrada del banco");+ C(e != NULL, "bank entry");if (!e) return;- C(eq(e->username, "juan.pérez") && eq(e->password, "s3cr3t&\"<€") && eq(e->url, "https://banco.example.com/login"), "usuario, contraseña (protegida) y URL");- C(eq(e->notes, "línea 1\nlínea 2"), "notas");+ C(eq(e->username, "juan.pérez") && eq(e->password, "s3cr3t&\"<€") && eq(e->url, "https://banco.example.com/login"), "username, password (protected) and URL");+ C(eq(e->notes, "línea 1\nlínea 2"), "notes");C(e->otp && strstr(e->otp, "secret=JBSWY3DPEHPK3PXP"), "TOTP");- C(eq(e->group, "Internet/Bancos"), "carpeta anidada");- C(has_tag(e, "finanzas") && has_tag(e, "importante") && e->ntags == 2, "etiquetas");+ C(eq(e->group, "Internet/Bancos"), "nested folder");+ C(has_tag(e, "finanzas") && has_tag(e, "importante") && e->ntags == 2, "tags");int ft = -1;- C(eq(field(e, "PIN", &ft), "4321") && ft == IMPF_HIDDEN, "campo protegido");+ C(eq(field(e, "PIN", &ft), "4321") && ft == IMPF_HIDDEN, "protected field");ft = -1;- C(eq(field(e, "Cliente", &ft), "00012345") && ft == IMPF_TEXT, "campo de texto");- C(e->natts == 1 && eq(e->atts[0].name, "adjunto.txt") && e->atts[0].len == 25 && !memcmp(e->atts[0].data, "Hola, adjunto de prueba!\n", 25), "adjunto");- C(e->created == 1709634030 && e->modified == 1735787045, "fechas");+ C(eq(field(e, "Cliente", &ft), "00012345") && ft == IMPF_TEXT, "text field");+ C(e->natts == 1 && eq(e->atts[0].name, "adjunto.txt") && e->atts[0].len == 25 && !memcmp(e->atts[0].data, "Hola, adjunto de prueba!\n", 25), "attachment");+ C(e->created == 1709634030 && e->modified == 1735787045, "dates");const ImpEntry *s = find(l, "vps1");- C(s && eq(s->group, "Servidores") && eq(s->password, "ssh-pass"), "otra carpeta");+ C(s && eq(s->group, "Servidores") && eq(s->password, "ssh-pass"), "another folder");const ImpEntry *r = find(l, "Raíz suelta");- C(r && !r->group && eq(r->password, "p"), "entrada de la raíz");- C(!find(l, "Borrada"), "la papelera no se importa");+ C(r && !r->group && eq(r->password, "p"), "root entry");+ C(!find(l, "Borrada"), "the trash is not imported");(void)v4;#undef C}@@ -234,35 +234,35 @@ static void test_kdbx(void) {int r = parse_file(dbs[i].f, 0, PW, dbs[i].kf, &l);double t1 = now_ms();char w[320];- snprintf(w, sizeof w, "%s: abre (%s)", dbs[i].f, r ? l.err : "ok");+ snprintf(w, sizeof w, "%s: opens (%s)", dbs[i].f, r ? l.err : "ok");check(r == 0, w);printf(" %s: %.1f ms\n", dbs[i].f, t1 - t0);if (!r) check_kdbx_content(&l, dbs[i].f, dbs[i].v4);imp_free(&l);- /* contraseña equivocada / sin el archivo llave */+ /* wrong password / without the key file */r = parse_file(dbs[i].f, 0, "otra", dbs[i].kf, &l);- snprintf(w, sizeof w, "%s: contraseña equivocada → bad-password (%s)", dbs[i].f, l.err);+ snprintf(w, sizeof w, "%s: wrong password → bad-password (%s)", dbs[i].f, l.err);check(r == -1 && eq(l.err, "bad-password"), w);if (dbs[i].kf) {r = parse_file(dbs[i].f, 0, PW, NULL, &l);- snprintf(w, sizeof w, "%s: sin archivo llave → bad-password (%s)", dbs[i].f, l.err);+ snprintf(w, sizeof w, "%s: no key file → bad-password (%s)", dbs[i].f, l.err);check(r == -1 && eq(l.err, "bad-password"), w);}- /* alterado: un byte de la cabecera y uno del cuerpo; cortado */+ /* tampered: one byte of the header and one of the body; truncated */size_t n;uint8_t *d = slurp(dbs[i].f, &n);size_t kn = 0;uint8_t *k = dbs[i].kf ? slurp(dbs[i].kf, &kn) : NULL;d[40] ^= 1;r = imp_parse(0, d, n, PW, k, kn, &l);- snprintf(w, sizeof w, "%s: cabecera alterada → error (%s)", dbs[i].f, l.err);+ snprintf(w, sizeof w, "%s: tampered header → error (%s)", dbs[i].f, l.err);check(r == -1 && (dbs[i].v4 ? eq(l.err, "corrupt") : (eq(l.err, "corrupt") || eq(l.err, "bad-password"))), w);d[40] ^= 1;d[n - 40] ^= 0x10;r = imp_parse(0, d, n, PW, k, kn, &l);- snprintf(w, sizeof w, "%s: cuerpo alterado → corrupt (%s)", dbs[i].f, l.err);+ snprintf(w, sizeof w, "%s: tampered body → corrupt (%s)", dbs[i].f, l.err);check(r == -1 && (eq(l.err, "corrupt") || (!dbs[i].v4 && eq(l.err, "bad-password"))), w);d[n - 40] ^= 0x10;size_t cuts[] = { 0, 5, 11, 60, 200, n / 2, n - 17, n - 1 };@@ -271,16 +271,16 @@ static void test_kdbx(void) {r = imp_parse(0, d, cuts[c], PW, k, kn, &l);if (r != -1 || !(eq(l.err, "truncated") || eq(l.err, "corrupt") || eq(l.err, "empty") || eq(l.err, "unknown-format") || eq(l.err, "bad-password"))) {ok = 0;- printf(" corte en %zu: %d %s\n", cuts[c], r, l.err);+ printf(" cut at %zu: %d %s\n", cuts[c], r, l.err);}}- snprintf(w, sizeof w, "%s: cortado → truncated/corrupt", dbs[i].f);+ snprintf(w, sizeof w, "%s: truncated → truncated/corrupt", dbs[i].f);check(ok, w);free(d);free(k);}- /* AES-KDF: AES-NI y tablas T contra el AES de referencia (vcrypto.c) */+ /* AES-KDF: AES-NI and T-tables against the reference AES (vcrypto.c) */{uint8_t c[32], sd[32], r1[32], r2[32], r3[32];for (int i = 0; i < 32; i++) { c[i] = (uint8_t)(i * 7 + 1); sd[i] = (uint8_t)(255 - i * 3); }@@ -288,19 +288,19 @@ static void test_kdbx(void) {kdbx_aes_kdf_mode = 0; kdbx_aes_kdf(c, sd, 1000, r2);kdbx_aes_kdf_mode = 1; kdbx_aes_kdf(c, sd, 1000, r3);kdbx_aes_kdf_mode = 0;- check(!memcmp(r1, r2, 32) && !memcmp(r1, r3, 32), "AES-KDF rápido = referencia");+ check(!memcmp(r1, r2, 32) && !memcmp(r1, r3, 32), "fast AES-KDF = reference");}- /* archivos llave */+ /* key files */uint8_t out[32], want[32];const char *hex = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f";for (int i = 0; i < 32; i++) want[i] = (uint8_t)i;- check(kdbx_keyfile_key((const uint8_t *)hex, 64, out) == 0 && !memcmp(out, want, 32), "archivo llave de 64 hex");- check(kdbx_keyfile_key(want, 32, out) == 0 && !memcmp(out, want, 32), "archivo llave de 32 bytes");+ check(kdbx_keyfile_key((const uint8_t *)hex, 64, out) == 0 && !memcmp(out, want, 32), "64-hex key file");+ check(kdbx_keyfile_key(want, 32, out) == 0 && !memcmp(out, want, 32), "32-byte key file");const char *x1 = "<?xml version=\"1.0\"?><KeyFile><Meta><Version>1.00</Version></Meta><Key><Data>AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=</Data></Key></KeyFile>";- check(kdbx_keyfile_key((const uint8_t *)x1, strlen(x1), out) == 0 && !memcmp(out, want, 32), "archivo llave XML 1.0");+ check(kdbx_keyfile_key((const uint8_t *)x1, strlen(x1), out) == 0 && !memcmp(out, want, 32), "XML 1.0 key file");const char *x2 = "<KeyFile><Meta><Version>2.0</Version></Meta><Key><Data Hash=\"DEADBEEF\">00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F</Data></Key></KeyFile>";- check(kdbx_keyfile_key((const uint8_t *)x2, strlen(x2), out) == -1, "archivo llave XML 2.0 con Hash equivocado");+ check(kdbx_keyfile_key((const uint8_t *)x2, strlen(x2), out) == -1, "XML 2.0 key file with a wrong Hash");}/* ---------- XML ---------- */@@ -308,25 +308,25 @@ static void test_kdbx(void) {static void test_xml(void) {const char *ok = "<?xml version=\"1.0\"?><!-- c --><a x='1' y=\"<&AB\"><b>t><![CDATA[<raw>&]]></b><c/></a>";XNode *r = xml_parse(ok, strlen(ok), NULL);- check(r && eq(r->name, "a") && eq(xml_attr(r, "y"), "<&AB") && eq(xml_text(xml_child(r, "b")), "t><raw>&") && xml_child(r, "c"), "XML: entidades, CDATA, vacío");+ check(r && eq(r->name, "a") && eq(xml_attr(r, "y"), "<&AB") && eq(xml_text(xml_child(r, "b")), "t><raw>&") && xml_child(r, "c"), "XML: entities, CDATA, empty element");xml_free(r);const char *bad[] = {"<!DOCTYPE a [<!ENTITY x \"y\">]><a>&x;</a>", "<a><b></a></b>", "<a>&unknown;</a>", "<a", "<a></a><b></b>", "<a x=1></a>", "texto<a/>",};int all = 1;- for (size_t i = 0; i < sizeof bad / sizeof *bad; i++) { r = xml_parse(bad[i], strlen(bad[i]), NULL); if (r) { all = 0; xml_free(r); printf(" aceptó: %s\n", bad[i]); } }- check(all, "XML: rechaza DOCTYPE, mal anidado, entidades desconocidas, cortado");- /* profundidad */+ for (size_t i = 0; i < sizeof bad / sizeof *bad; i++) { r = xml_parse(bad[i], strlen(bad[i]), NULL); if (r) { all = 0; xml_free(r); printf(" accepted: %s\n", bad[i]); } }+ check(all, "XML: rejects DOCTYPE, bad nesting, unknown entities, truncated");+ /* depth */char *deep = malloc(6000);size_t n = 0;for (int i = 0; i < 1000; i++) { memcpy(deep + n, "<a>", 3); n += 3; }r = xml_parse(deep, n, NULL);- check(!r, "XML: tope de profundidad");+ check(!r, "XML: depth limit");xml_free(r);free(deep);}-/* ---------- mutaciones ---------- */+/* ---------- mutations ---------- */static uint64_t rng = 0x5eed1234abcdULL;static uint32_t rnd(void) { rng ^= rng << 13; rng ^= rng >> 7; rng ^= rng << 17; return (uint32_t)rng; }@@ -347,12 +347,12 @@ static void fuzz(void) {memcpy(d, orig, n);size_t len = n;int mode = (int)(rnd() % 3);- if (mode == 0) len = rnd() % (n + 1); /* corte */+ if (mode == 0) len = rnd() % (n + 1); /* cut */else {int flips = 1 + (int)(rnd() % 4);for (int k = 0; k < flips; k++) {size_t pos = rnd() % n;- if (kdbx && !strncmp(files[f], "kx3", 3) && pos < 240) pos += 240; /* v3: la cabecera no tiene hash: no inflar las rondas */+ if (kdbx && !strncmp(files[f], "kx3", 3) && pos < 240) pos += 240; /* v3: the header has no hash: don't inflate the rounds */if (pos >= n) pos = n - 1;d[pos] = mode == 1 ? (uint8_t)(d[pos] ^ (1u << (rnd() % 8))) : (uint8_t)rnd();}@@ -375,11 +375,11 @@ static void fuzz(void) {free(d);free(orig);}- printf(" mutaciones: %ld lecturas (%ld aceptadas) en %.0f ms\n", runs, okparse, now_ms() - t0);- check(1, "mutaciones sin caerse");+ printf(" mutations: %ld parses (%ld accepted) in %.0f ms\n", runs, okparse, now_ms() - t0);+ check(1, "mutations without crashing");}-/* ---------- rendimiento ---------- */+/* ---------- performance ---------- */static void bench(void) {size_t cap = 10000 * 120 + 64, n = 0;@@ -391,20 +391,20 @@ static void bench(void) {double t0 = now_ms();int r = imp_parse(0, (uint8_t *)s, n, NULL, NULL, 0, &l);double t1 = now_ms();- check(r == 0 && l.n == 10000, "CSV de 10 000 entradas");- printf(" CSV de Chrome con 10 000 entradas (%zu KB): %.1f ms\n", n / 1024, t1 - t0);+ check(r == 0 && l.n == 10000, "10,000-entry CSV");+ printf(" Chrome CSV with 10,000 entries (%zu KB): %.1f ms\n", n / 1024, t1 - t0);char *csv;size_t cn;t0 = now_ms();r = exp_csv(&l, &csv, &cn);- printf(" exportar 10 000 entradas: %.1f ms\n", now_ms() - t0);+ printf(" exporting 10,000 entries: %.1f ms\n", now_ms() - t0);if (!r) sm_free(csv);imp_free(&l);free(s);}int main(void) {- /* topes chicos: las mutaciones no pueden pedir KDF enormes */+ /* small caps: mutations can't ask for huge KDFs */kdbx_max_aes_rounds = 200000;kdbx_max_argon_kib = 8192;test_csv_reader();@@ -414,7 +414,7 @@ int main(void) {test_kdbx();fuzz();bench();- /* un KDBX real con los valores de KeePassXC (si se pasó KDBX_BENCH=archivo) */+ /* a real KDBX with KeePassXC's values (if KDBX_BENCH=file was given) */const char *b = getenv("KDBX_BENCH");if (b) {kdbx_max_aes_rounds = 500000000ull;@@ -428,7 +428,7 @@ int main(void) {ImpList l;double t0 = now_ms();int r = imp_parse(0, buf, n, getenv("KDBX_PW") ? getenv("KDBX_PW") : PW, NULL, 0, &l);- printf(" %s: %s, %d entradas, %.0f ms\n", b, r ? l.err : "ok", l.n, now_ms() - t0);+ printf(" %s: %s, %d entries, %.0f ms\n", b, r ? l.err : "ok", l.n, now_ms() - t0);imp_free(&l);}}diff --git a/server/tests/qr/qr_ref.h b/server/tests/qr/qr_ref.hindex 6ce16f0..0602e62 100644--- a/server/tests/qr/qr_ref.h+++ b/server/tests/qr/qr_ref.h@@ -1,6 +1,6 @@-/* KAT: qrcodegen de Nayuki 1.8 (referencia de la norma; segno agrega 8 bits de relleno de más cuando- * los datos terminan justo en un byte). BIG: segno 1.6.6, con capacidad llena (sin relleno), y- * verificado igual contra qrcodegen. */+/* KAT: Nayuki's qrcodegen 1.8 (the standard's reference; segno adds 8 extra padding bits when+ * the data ends exactly on a byte). BIG: segno 1.6.6, at full capacity (no padding), and+ * verified identical against qrcodegen. */typedef struct { const char *data; int ecc, ver, mask; const char *rows[57]; } QrKat;static const QrKat KAT[] = {{ "HELLO WORLD", 2, 1, 0, {"111111101100001111111", "100000101001001000001", "101110101001101011101", "101110101000001011101", "101110101010001011101", "100000100010001000001", "111111101010101111111", "000000001000000000000", "011010110000101011111", "010000001111000010001", "001101110110001011000", "011011010011010101110", "100010101011101110101", "000000001101001000101", "111111101010000101100", "100000100101101101000", "101110101010001111111", "101110100101010100010", "101110101001011101001", "100000101011110001011", "111111100001011100001"} },diff --git a/server/tests/qr_test.c b/server/tests/qr_test.cindex 1f084f9..b1db9f5 100644--- a/server/tests/qr_test.c+++ b/server/tests/qr_test.c@@ -1,11 +1,11 @@-/* qr_test.c — códigos QR propios (src/vault/qr.c):- * 1. respuestas conocidas: matrices generadas con segno (tests/qr/qr_ref.h), con la máscara- * elegida por la penalización y, en versiones grandes, con la máscara fija (hash);- * 2. ida y vuelta: codificar → dibujar (escala 2–8, invertido, girado, ruido, desenfoque) → leer;- * 3. corrección de errores: módulos invertidos hasta la capacidad (lee) y más allá (falla);- * 4. imágenes reales (PNG de segno en tests/qr/, incluida una captura con interfaz);- * 5. «fuzz»: imágenes al azar y QR dañados no pueden romper nada.- * Se corre desde server/ (make test). */+/* qr_test.c — our own QR codes (src/vault/qr.c):+ * 1. known answers: matrices generated with segno (tests/qr/qr_ref.h), with the mask+ * chosen by the penalty score and, for large versions, with a fixed mask (hash);+ * 2. round trip: encode → draw (scale 2–8, inverted, rotated, noise, blur) → decode;+ * 3. error correction: modules flipped up to the capacity (decodes) and beyond (fails);+ * 4. real images (segno PNGs in tests/qr/, including a screenshot with UI);+ * 5. "fuzz": random images and damaged QR codes can't break anything.+ * Run from server/ (make test). */#include "vault/qr.h"#include "vault/vstb.h"#include "vault/smem.h"@@ -20,7 +20,7 @@int qr_encode_ex(const uint8_t *data, size_t len, int ecc, int mask, int minver, uint8_t *modules, int *size, int *mask_out);static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static uint64_t rs = 0x9e3779b97f4a7c15ULL;static uint32_t rnd(void) { rs ^= rs << 13; rs ^= rs >> 7; rs ^= rs << 17; return (uint32_t)(rs >> 11); }@@ -28,7 +28,7 @@ static double now(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t);static uint8_t M[QR_MAX_SIZE * QR_MAX_SIZE];-/* Dibuja la matriz: escala sc, zona en blanco de 4, giro en grados, invertido. */+/* Draws the matrix: scale sc, quiet zone of 4, rotation in degrees, inverted. */static uint32_t *raster(const uint8_t *m, int s, double sc, double deg, int inv, int *W, int *H) {double side = (s + 8) * sc, a = deg * M_PI / 180, ca = cos(a), sa = sin(a);int w = (int)ceil(side * (fabs(ca) + fabs(sa))) + 4;@@ -104,19 +104,19 @@ int main(void) {uint8_t out[4096];int s, mask;- /* ---- 1. respuestas conocidas ---- */+ /* ---- 1. known answers ---- */for (size_t k = 0; k < sizeof KAT / sizeof KAT[0]; k++) {const QrKat *q = &KAT[k];int v = qr_encode_ex((const uint8_t *)q->data, strlen(q->data), q->ecc, -1, q->ver, M, &s, &mask);char what[96];- snprintf(what, sizeof what, "KAT «%s» versión %d", q->data, q->ver);+ snprintf(what, sizeof what, "KAT «%s» version %d", q->data, q->ver);check(v == q->ver, what);- snprintf(what, sizeof what, "KAT «%s» máscara elegida %d (segno %d)", q->data, mask, q->mask);+ snprintf(what, sizeof what, "KAT «%s» chosen mask %d (segno %d)", q->data, mask, q->mask);check(mask == q->mask, what);qr_encode_ex((const uint8_t *)q->data, strlen(q->data), q->ecc, q->mask, q->ver, M, &s, NULL);int same = 1;for (int y = 0; y < s; y++) for (int x = 0; x < s; x++) if ((q->rows[y][x] == '1') != M[y * s + x]) same = 0;- snprintf(what, sizeof what, "KAT «%s» matriz igual a segno", q->data);+ snprintf(what, sizeof what, "KAT «%s» matrix identical to segno", q->data);check(same, what);}{@@ -127,21 +127,21 @@ int main(void) {const QrBig *b = &BIG[k];int v = qr_encode_ex(txt, (size_t)b->len, b->ecc, b->mask, b->ver, M, &s, NULL);char what[96];- snprintf(what, sizeof what, "versión %d ecc %d máscara %d: hash igual a segno", b->ver, b->ecc, b->mask);+ snprintf(what, sizeof what, "version %d ecc %d mask %d: hash identical to segno", b->ver, b->ecc, b->mask);check(v == b->ver && fnv(M, s) == b->hash, what);- /* un byte más no entra en esa versión */+ /* one more byte doesn't fit in that version */v = qr_encode_ex(txt, (size_t)b->len + 1, b->ecc, b->mask, b->ver, M, &s, NULL);- check(v != b->ver, "un byte más sube de versión");+ check(v != b->ver, "one more byte bumps the version");}}- check(qr_encode((const uint8_t *)"x", 1, QR_ECC_L, M, &s) == 1 && s == 21, "versión 1");+ check(qr_encode((const uint8_t *)"x", 1, QR_ECC_L, M, &s) == 1 && s == 21, "version 1");{static uint8_t big[3000];memset(big, 'a', sizeof big);- check(qr_encode(big, 2954, QR_ECC_L, M, &s) == -1, "no entra en la versión 40");+ check(qr_encode(big, 2954, QR_ECC_L, M, &s) == -1, "doesn't fit in version 40");}- /* ---- 2. ida y vuelta ---- */+ /* ---- 2. round trip ---- */int rt_ok = 0, rt_n = 0, rot_ok = 0, rot_n = 0;for (int it = 0; it < 360; it++) {int ecc = (int)(rnd() % 4), kind = (int)(rnd() % 3);@@ -153,7 +153,7 @@ int main(void) {static uint8_t data[7100];for (int i = 0; i < len; i++) data[i] = kind == 0 ? (uint8_t)('0' + rnd() % 10) : kind == 1 ? (uint8_t)ALN[rnd() % 45] : (uint8_t)(rnd() % 255 + 1);int v = qr_encode(data, (size_t)len, ecc, M, &s);- if (v < 0) { check(0, "codificar dato al azar"); continue; }+ if (v < 0) { check(0, "encode random data"); continue; }int extra = (int)(rnd() % 10);double sc = 2 + rnd() % 7;while ((s + 8) * sc > 900 && sc > 2) sc--;@@ -168,14 +168,14 @@ int main(void) {int n = qr_decode(px, w, h, out, sizeof out);int ok = n == len && !memcmp(out, data, (size_t)len);if (deg != 0) { rot_n++; rot_ok += ok; } else { rt_n++; rt_ok += ok; }- if (!ok) printf(" no leyó: versión %d ecc %d largo %d escala %.0f giro %.0f inv %d extra %d\n", v, ecc, len, sc, deg, inv, extra);+ if (!ok) printf(" not decoded: version %d ecc %d length %d scale %.0f rotation %.0f inv %d extra %d\n", v, ecc, len, sc, deg, inv, extra);free(px);}- printf("ida y vuelta: %d/%d derechas, %d/%d giradas ±10°\n", rt_ok, rt_n, rot_ok, rot_n);- check(rt_ok == rt_n, "ida y vuelta (todas las derechas)");- check(rot_ok * 100 >= rot_n * 95, "ida y vuelta giradas (≥ 95 %)");+ printf("round trip: %d/%d upright, %d/%d rotated ±10°\n", rt_ok, rt_n, rot_ok, rot_n);+ check(rt_ok == rt_n, "round trip (all upright ones)");+ check(rot_ok * 100 >= rot_n * 95, "round trip rotated (≥ 95 %)");- /* ---- 3. corrección de errores (versión 1-H: 17 de corrección, hasta 8 palabras) ---- */+ /* ---- 3. error correction (version 1-H: 17 correction codewords, up to 8 words) ---- */{const char *msg = "LORDOS-2FA";int good = 0, bad_fail = 0, bad_wrong = 0;@@ -196,14 +196,14 @@ int main(void) {if (it < 40) good += ok;else if (n < 0) bad_fail++;else if (!ok) bad_wrong++;- else bad_fail++; /* se salvó igual (flips repetidos): cuenta como limpio */+ else bad_fail++; /* recovered anyway (repeated flips): counts as clean */}- printf("corrección: %d/40 con hasta 8 módulos mal; con 80–100 mal: %d sin leer, %d mal leídos\n", good, bad_fail, bad_wrong);- check(good == 40, "corrige hasta la capacidad");- check(bad_wrong <= 1, "más allá de la capacidad falla limpio");+ printf("correction: %d/40 with up to 8 bad modules; with 80–100 bad: %d not decoded, %d decoded wrong\n", good, bad_fail, bad_wrong);+ check(good == 40, "corrects up to the capacity");+ check(bad_wrong <= 1, "beyond the capacity it fails cleanly");}- /* ---- 4. imágenes reales ---- */+ /* ---- 4. real images ---- */{struct { const char *file, *want; } real[] = {{ "tests/qr/wifi.png", "WIFI:T:WPA;S:Casa Lord;P:clave-segura-123;;" },@@ -217,7 +217,7 @@ int main(void) {int w = 0, h = 0;uint32_t *px = f ? vstb_decode_argb(f, n, &w, &h) : NULL;char what[96];- snprintf(what, sizeof what, "imagen real %s", real[k].file);+ snprintf(what, sizeof what, "real image %s", real[k].file);double t0 = now();int r = px ? qr_decode(px, w, h, out, sizeof out) : -1;double t1 = now();@@ -246,25 +246,25 @@ int main(void) {for (int f = 0; f < 5 + it * 3; f++) M[rnd() % (unsigned)(s * s)] ^= 1;int w, h;uint32_t *px = raster(M, s, 3, 0, it % 2, &w, &h);- /* rectángulos tapados */+ /* covered rectangles */for (int r = 0; r < it % 4; r++) {int x0 = (int)(rnd() % (unsigned)w), y0 = (int)(rnd() % (unsigned)h), rw = (int)(rnd() % 40), rh = (int)(rnd() % 40);for (int y = y0; y < y0 + rh && y < h; y++) for (int x = x0; x < x0 + rw && x < w; x++) px[y * w + x] = rnd();}qr_decode(px, w, h, out, sizeof out);- qr_decode(px, w, h, out, 3); /* búfer chico: nunca se pasa */+ qr_decode(px, w, h, out, 3); /* small buffer: never overrun */free(px);}- check(crashes == 0, "fuzz sin romper");- check(qr_decode(NULL, 0, 0, out, sizeof out) == -1, "entrada nula");+ check(crashes == 0, "fuzz without breaking");+ check(qr_decode(NULL, 0, 0, out, sizeof out) == -1, "null input");}- /* ---- tiempos ---- */+ /* ---- timings ---- */{const char *wifi = "WIFI:T:WPA;S:Casa Lord;P:clave-segura-123;;";double t0 = now();for (int i = 0; i < 1000; i++) qr_encode((const uint8_t *)wifi, strlen(wifi), QR_ECC_M, M, &s);- printf("tiempo: generar el QR de una red Wi-Fi: %.3f ms\n", (now() - t0));+ printf("time: generating the QR of a Wi-Fi network: %.3f ms\n", (now() - t0));}printf("qr-test: %d/%d\n", total - fails, total);diff --git a/server/tests/secretsvc/modexp_vectors.h b/server/tests/secretsvc/modexp_vectors.hindex b958787..6e9aee9 100644--- a/server/tests/secretsvc/modexp_vectors.h+++ b/server/tests/secretsvc/modexp_vectors.h@@ -1,4 +1,4 @@-/* base, exponente, módulo, resultado (pow de Python 3, semilla 20261017) */+/* base, exponent, modulus, result (Python 3 pow, seed 20261017) */{ "4ee04dcc3d99dcbb2a04ba6ec48129d36111a8dcf862c588e65b58e37ebc9b7f57aedcbe823b2ba861b03f5e52c5c6cb5c4b98abc82468d315949e4a8e1937c103332693cc80b94c2d99c8c3fa1ed6cf53ade73a011c4bf8d971395eb58fe03f22f412cb909429dbc3774faa730ef045e7849b9950a04f7e40b8106029e0ddab", "fc423eacee719bb34e02aaca289374054e8bca354b4dd2c6a059048549e4c53c09e452ad60ab938df8551a9f6aa87bc25a35f009ee9ca8b4e7f86789b8a6d4e49165b049d759f8ab2c7da9c2927cd89dca896360c64495fa23741abd120869525db0a0434d66cc8b6ddf36d6522bde78cca127ec66a0ed505a5154e852970eb0", "af6f4ce7b583d83d2dac5231161dca46903e33c18cc9c5bc6598d69183535922fa8c2e87ecdc92f97a451e772d22bf79964dc0c2546e2301db0af0c78dab8a6cf13a2d6e8e1ae976c0df8eb985855a4787cfffacf078f42586056a0acb0b79a2e46893867c089f4e1f1d1f01a9d9a5102ec746997017125e07c3e62447ce57e9", "533accfd7da64c9468b4d8d9a104c0ce3128fa660a53fc25ff8df3e955ddafb648d795a103a479243406081c0af76870cef1b2951759028773f88a34f86ff705566b5ecfb1d7870ec98b9d8c3381bf01df0c0337a4f40f0075611af2dd0723ad635f32aec76aab9398442d8728ec755de0b75b0ac0b4080359092f3d550c6307" },{ "07e2884ce519226b88abb17b806327efcfe4e6cd4be256ac9ce59a1bde410015d7aacfc6c1607ebd393540621ca1cfa613c33eb3828b7ff5658b29f3b05bf97273c47d402d813bcde3c3f92613411c79fd4ef0538cfba83ddce35e0912af33a4605557e40c32cf6127684b8ff898b045f23238e7ebd233787f361f6e9ebb0376", "4c8d7a8097b0b7cffd1b777a694dd72f5e7f7789790c79c2b195e6fe7075be75052fefa465725930cb89e9e55da81a027f7ba2515963341f828f17a73b4663444fa645c775cc589871d21420ee64b522e808bd9e81dea4c41f4f8394e4870d8593f441780295e6ea19796c663633a8181aabdb2fa037a28c01d4f359e10925d0", "b22a90e70ed22c3626c23b4cd86ba1ab7ccd4820a68d469617ef709c576c1cfd2d0e40ef624521ec1fda2b42c4939364168bcc2420a29b455a7b1301fb3a50b3cbbd8010e84de2f37dca4029c477816e7ddc7c0a4a2258cf016c9f046b123880b06daf1d2739d38014f518ce7682fa49f870f14ead5f3cdcc410b3776d52750b", "21caea46a8ab0ce10922110074713afc2fb2912b939c77b9a4db3f00f1e42b86ba21fb82a0dfc9c663806a03fb7f7e5faa5311857839bd3bb5ddfa4930588fd015d47c65b4879cc6ffc326bb8dbd6955dfb26d04a4cd8d6b2f2f7ac233bf19da98c244fe630de548dbc4c72d36fc8ceebe2dad1b52bd9692de474e76447ce89c" },{ "9f9b0c7b7c0132f47aa6e2a65d7648196d31b65893b9fb30758a81996b7d602e5c8e105285637dd7d857a8d35ab49445f3984153c49186df1bba9dc38585720f79d8e3ad32568391936451033b838553dce0f872798b6a735b8a7a1e8b0e9fe5a0cf17ee61ae9c570f7b8bbb240ff0a5c10db95d0675bb47ccacfaf266a7f92e", "63d53c0e866b092970e23b7dcc4b94a65db60b50bc4f869c5bf47a7549d325ee5a8257677e9b348585150838c5f32a389298ef680568a1ba164286eca496b3ad49717dbf837ca269722d958302573ee6853159f5736c5f0c8b053b3d868726b65a307c7781c030e220a0cdf29a643c7a787c7339f6532a0d78729eb5dcd91133", "f3c9c4b7bdb48a864af4002006fcffce70144b74b890c3fc8c6f95eb9ba2ed47b12f0c01c0e1556dc38b86330a5f5f940c8e504f963cc710f0e9b88d04ddf2294929ae8cc3dcf815a67748fe73a2652733cd21078e7a94fb948b07b12443d93d25045eb5398c48cab17edf087e13ded28af3fcee039f2a031de6b801a9f74fbd", "f00607ecd1fdacc903ff8164ff85b1a548b255d53bf4d1ca746a6f82971963c39811c4c9229ef6e1b9ae5323e5464b30f691db74814f1a398c625631fce296e03a4fb1e1327090b884cdbfd17325e2740dfbcf331df67f00ddd65b0f6a974fbf62a1433317ed32dcf5699dc5ea94421983a6ef55e69a357fb68ef0c291275168" },diff --git a/server/tests/secretsvc/run-pw-116.sh b/server/tests/secretsvc/run-pw-116.shindex 22f5552..36738de 100644--- a/server/tests/secretsvc/run-pw-116.sh+++ b/server/tests/secretsvc/run-pw-116.sh@@ -1,9 +1,9 @@#!/bin/sh-# run-pw-116.sh — Secret Service propio contra el bus real y libsecret (secret-tool).-# Uso (en la VM, desde server/, con build/secretsvc-demo ya compilado):+# run-pw-116.sh — our own Secret Service against the real bus and libsecret (secret-tool).+# Usage (on the VM, from server/, with build/secretsvc-demo already built):# sh tests/secretsvc/run-pw-116.sh [--capture tests/secretsvc/libsecret-capture.bin]-# Necesita libsecret-tools (secret-tool) y dbus-bin (dbus-send, dbus-monitor).-# Deja el bus como estaba: ningún demo queda con el nombre org.freedesktop.secrets.+# Needs libsecret-tools (secret-tool) and dbus-bin (dbus-send, dbus-monitor).+# Leaves the bus as it was: no demo keeps the name org.freedesktop.secrets.set -ucd "$(dirname "$0")/../.." || exit 1: "${XDG_RUNTIME_DIR:=/run/user/$(id -u)}"@@ -15,47 +15,47 @@ CAP=""LOG=$(mktemp /tmp/ss-demo-XXXXXX.log)ok=0; bad=0pass() { ok=$((ok+1)); echo "ok $1"; }-fail() { bad=$((bad+1)); echo "FALLA $1"; }+fail() { bad=$((bad+1)); echo "FAIL $1"; }owner() { dbus-send --session --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.NameHasOwner string:org.freedesktop.secrets 2>/dev/null | grep -q "boolean true"; }-if owner; then echo "org.freedesktop.secrets ya tiene dueño: no se prueba"; exit 2; fi-pgrep -f "[g]nome-keyring-daemon" >/dev/null && echo "aviso: gnome-keyring-daemon está corriendo"-[ -x build/secretsvc-demo ] || { echo "falta build/secretsvc-demo"; exit 2; }+if owner; then echo "org.freedesktop.secrets already has an owner: not testing"; exit 2; fi+pgrep -f "[g]nome-keyring-daemon" >/dev/null && echo "warning: gnome-keyring-daemon is running"+[ -x build/secretsvc-demo ] || { echo "build/secretsvc-demo is missing"; exit 2; }start() { build/secretsvc-demo "$@" --seconds 60 >>"$LOG" 2>&1 & DEMO=$!; i=0; while ! owner && [ $i -lt 50 ]; do sleep 0.1; i=$((i+1)); done; }stop() { kill "$DEMO" 2>/dev/null; wait "$DEMO" 2>/dev/null; }MON=""if [ -n "$CAP" ]; then dbus-monitor --session --binary "type='method_call',destination='org.freedesktop.secrets'" >"$CAP" 2>/dev/null & MON=$!; sleep 0.3; fi-# --- desbloqueado ---+# --- unlocked ---start-owner && pass "el demo tiene org.freedesktop.secrets" || fail "el demo no tomó el nombre"-build/secretsvc-demo --seconds 2 >>"$LOG" 2>&1; [ $? -eq 3 ] && pass "un segundo servicio ve el nombre ocupado (ss_start = 1)" || fail "segundo servicio"+owner && pass "the demo owns org.freedesktop.secrets" || fail "the demo did not take the name"+build/secretsvc-demo --seconds 2 >>"$LOG" 2>&1; [ $? -eq 3 ] && pass "a second service sees the name taken (ss_start = 1)" || fail "second service"printf 'contraseña ñandú 123' | secret-tool store --label="Prueba LordOS" service lordos-demo user ana && pass "secret-tool store" || fail "secret-tool store"v=$(secret-tool lookup service lordos-demo user ana); [ "$v" = "contraseña ñandú 123" ] && pass "secret-tool lookup" || fail "secret-tool lookup ($v)"printf 'otra' | secret-tool store --label="Segunda" service lordos-demo user betosecret-tool search --all service lordos-demo >/tmp/ss-search.$$ 2>&1-grep -q "label = Prueba LordOS" /tmp/ss-search.$$ && grep -q "label = Segunda" /tmp/ss-search.$$ && pass "secret-tool search --all (2 ítems)" || { fail "secret-tool search"; cat /tmp/ss-search.$$; }-grep -q "secret = contraseña ñandú 123" /tmp/ss-search.$$ && pass "search trae los secretos" || fail "search sin secretos"+grep -q "label = Prueba LordOS" /tmp/ss-search.$$ && grep -q "label = Segunda" /tmp/ss-search.$$ && pass "secret-tool search --all (2 items)" || { fail "secret-tool search"; cat /tmp/ss-search.$$; }+grep -q "secret = contraseña ñandú 123" /tmp/ss-search.$$ && pass "search returns the secrets" || fail "search without secrets"printf 'cambiada' | secret-tool store --label="Prueba LordOS" service lordos-demo user ana-v=$(secret-tool lookup service lordos-demo user ana); [ "$v" = "cambiada" ] && pass "store de nuevo reemplaza" || fail "reemplazo ($v)"+v=$(secret-tool lookup service lordos-demo user ana); [ "$v" = "cambiada" ] && pass "storing again replaces" || fail "replace ($v)"secret-tool clear service lordos-demo user ana; v=$(secret-tool lookup service lordos-demo user ana); [ -z "$v" ] && pass "secret-tool clear" || fail "clear ($v)"secret-tool lock --collection=login && pass "secret-tool lock" || fail "secret-tool lock"-v=$(timeout 15 secret-tool lookup service lordos-demo user beto); [ "$v" = "otra" ] && pass "lookup bloqueado: Unlock con aviso y después el secreto" || fail "lookup tras lock ($v)"+v=$(timeout 15 secret-tool lookup service lordos-demo user beto); [ "$v" = "otra" ] && pass "locked lookup: Unlock with a prompt, then the secret" || fail "lookup after lock ($v)"stop-# --- bloqueado: el aviso se acepta solo al segundo ---+# --- locked: the prompt accepts itself after one second ---start --locked-printf 'con aviso' | timeout 15 secret-tool store --label="Bloqueado" service lordos-demo user carla && pass "store con el llavero bloqueado (aviso de desbloqueo)" || fail "store bloqueado"-v=$(timeout 15 secret-tool lookup service lordos-demo user carla); [ "$v" = "con aviso" ] && pass "lookup después del aviso" || fail "lookup bloqueado ($v)"+printf 'con aviso' | timeout 15 secret-tool store --label="Bloqueado" service lordos-demo user carla && pass "store with the keyring locked (unlock prompt)" || fail "locked store"+v=$(timeout 15 secret-tool lookup service lordos-demo user carla); [ "$v" = "con aviso" ] && pass "lookup after the prompt" || fail "locked lookup ($v)"stop[ -n "$MON" ] && { kill "$MON" 2>/dev/null; wait "$MON" 2>/dev/null; }-grep -q "OpenSession dh-ietf1024-sha256-aes128-cbc-pkcs7" "$LOG" && pass "libsecret negoció dh-ietf1024-sha256-aes128-cbc-pkcs7" || echo "nota: libsecret no usó DH"-grep -q "OpenSession plain" "$LOG" && echo "nota: también hubo sesiones plain"-grep -q "Unlock → aviso" "$LOG" && pass "Unlock pasó por un Prompt" || echo "nota: no hubo Prompt"-owner && fail "quedó alguien con el nombre" || pass "el nombre quedó libre"-echo "registro: $LOG"+grep -q "OpenSession dh-ietf1024-sha256-aes128-cbc-pkcs7" "$LOG" && pass "libsecret negotiated dh-ietf1024-sha256-aes128-cbc-pkcs7" || echo "note: libsecret did not use DH"+grep -q "OpenSession plain" "$LOG" && echo "note: there were plain sessions too"+grep -q "Unlock → aviso" "$LOG" && pass "Unlock went through a Prompt" || echo "note: there was no Prompt" # matches the "Unlock → aviso" debug line of src/vault/secretsvc.c+owner && fail "someone still owns the name" || pass "the name is free"+echo "log: $LOG"rm -f /tmp/ss-search.$$-echo "secretsvc con secret-tool: $ok bien, $bad fallas"+echo "secretsvc with secret-tool: $ok passed, $bad failed"[ $bad -eq 0 ]diff --git a/server/tests/secretsvc_demo.c b/server/tests/secretsvc_demo.cindex 169e728..12329bf 100644--- a/server/tests/secretsvc_demo.c+++ b/server/tests/secretsvc_demo.c@@ -1,8 +1,8 @@-/* secretsvc_demo.c — Secret Service propio con un llavero en memoria, sobre el bus de la sesión- * real (sin caja de arena). Para probar con secret-tool/libsecret: tests/secretsvc/run-pw-116.sh.+/* secretsvc_demo.c — our own Secret Service with an in-memory keyring, on the real session bus+ * (no sandbox). To test with secret-tool/libsecret: tests/secretsvc/run-pw-116.sh.* build/secretsvc-demo [--locked] [--seconds N]- * Con --locked arranca bloqueado: Unlock muestra un «aviso» que se acepta solo al segundo.- * Sale con 0 al terminar, 3 si org.freedesktop.secrets ya tenía dueño. */+ * With --locked it starts locked: Unlock shows a "prompt" that accepts itself after one second.+ * Exits with 0 when done, 3 if org.freedesktop.secrets already had an owner. */#include "vault/dbus.h"#include "vault/secretsvc.h"#include "ss_memback.h"@@ -29,19 +29,19 @@ int main(int argc, char **argv) {setenv("LORD_SS_DEBUG", "1", 0);memback_init(&mb, locked);int fd = dbus_connect_session();- if (fd < 0) { fprintf(stderr, "demo: no hay bus de la sesión\n"); return 1; }+ if (fd < 0) { fprintf(stderr, "demo: no session bus\n"); return 1; }int r = ss_start(fd, &memback_ops, &mb);- if (r == 1) { fprintf(stderr, "demo: org.freedesktop.secrets ya tiene dueño\n"); return 3; }- if (r) { fprintf(stderr, "demo: no se pudo arrancar\n"); return 1; }- fprintf(stderr, "demo: listo como %s (%s)\n", ss_unique_name(), locked ? "bloqueado" : "desbloqueado");+ if (r == 1) { fprintf(stderr, "demo: org.freedesktop.secrets already has an owner\n"); return 3; }+ if (r) { fprintf(stderr, "demo: could not start\n"); return 1; }+ fprintf(stderr, "demo: ready as %s (%s)\n", ss_unique_name(), locked ? "locked" : "unlocked");time_t end = time(NULL) + seconds;while (!stop && time(NULL) < end) {struct pollfd p = { ss_fd(), POLLIN | (ss_pending_out() ? POLLOUT : 0), 0 };poll(&p, 1, 100);- if (ss_dispatch() < 0) { fprintf(stderr, "demo: el bus se cerró\n"); return 1; }+ if (ss_dispatch() < 0) { fprintf(stderr, "demo: the bus closed\n"); return 1; }memback_tick(&mb);}ss_stop();- fprintf(stderr, "demo: fin\n");+ fprintf(stderr, "demo: done\n");return 0;}diff --git a/server/tests/ss_memback.c b/server/tests/ss_memback.cindex 847d315..6014c83 100644--- a/server/tests/ss_memback.c+++ b/server/tests/ss_memback.c@@ -1,4 +1,4 @@-/* ss_memback.c — llavero en memoria para las pruebas del Secret Service. */+/* ss_memback.c — in-memory keyring for the Secret Service tests. */#include "ss_memback.h"#include "vault/smem.h"@@ -45,12 +45,12 @@ static int mb_request_unlock(void *ud, unsigned id) {if (!b->locked) return 0;b->pending = id;b->pending_at = now_ms() + 1000;- fprintf(stderr, "memback: aviso de desbloqueo %u (se completa en 1 s)\n", id);+ fprintf(stderr, "memback: unlock prompt %u (completes in 1 s)\n", id);return 1;}static int mb_lock(void *ud) { ((MemBack *)ud)->locked = 1; return 0; }static int mb_search(void *ud, const SsAttr *a, int n, char (*ids)[40], int max) {- MemBack *b = ud; /* busca también bloqueado: los atributos son un índice aparte */+ MemBack *b = ud; /* also searches while locked: the attributes are a separate index */int k = 0;for (int i = 0; i < MB_MAX && k < max; i++) {MbItem *x = &b->it[i];@@ -148,7 +148,7 @@ void memback_tick(MemBack *b) {unsigned id = b->pending;b->pending = 0;b->locked = 0;- fprintf(stderr, "memback: aviso %u aceptado, desbloqueado\n", id);+ fprintf(stderr, "memback: prompt %u accepted, unlocked\n", id);ss_prompt_done(id, 1);}}diff --git a/server/tests/ss_memback.h b/server/tests/ss_memback.hindex 94211e9..be64afa 100644--- a/server/tests/ss_memback.h+++ b/server/tests/ss_memback.h@@ -1,4 +1,4 @@-/* ss_memback.h — llavero en memoria para probar secretsvc.c (dbus_test y secretsvc-demo). */+/* ss_memback.h — in-memory keyring for testing secretsvc.c (dbus_test and secretsvc-demo). */#ifndef SS_MEMBACK_H#define SS_MEMBACK_H#include "vault/secretsvc.h"@@ -19,14 +19,14 @@ typedef struct {typedef struct {MbItem it[MB_MAX];int locked, counter;- unsigned pending; /* aviso de desbloqueo en curso (0 = ninguno) */- double pending_at; /* ms monotónicos en que se completa */+ unsigned pending; /* unlock prompt in progress (0 = none) */+ double pending_at; /* monotonic ms at which it completes */char last_caller[256];unsigned last_pid;} MemBack;extern const SsBackend memback_ops;void memback_init(MemBack *b, int locked);-/* completa el aviso pendiente si pasó 1 s: desbloquea y llama a ss_prompt_done */+/* completes the pending prompt once 1 s has passed: unlocks and calls ss_prompt_done */void memback_tick(MemBack *b);#endifdiff --git a/server/tests/vault_demo.c b/server/tests/vault_demo.cindex c00169e..77df2c3 100644--- a/server/tests/vault_demo.c+++ b/server/tests/vault_demo.c@@ -1,9 +1,9 @@-/* vault_demo.c — arma una bóveda de demostración (para las capturas de docs/CONTRASENAS.md) con- * entradas de todas las plantillas, categorías del usuario en árbol, etiquetas, 2FA, adjuntos y- * contraseñas débiles, repetidas y viejas para el informe. Todo inventado.+/* vault_demo.c — builds a demo vault (for the screenshots in docs/PASSWORDS.md) with+ * entries from every template, a tree of user categories, tags, 2FA, attachments and+ * weak, reused and old passwords for the report. All invented.*- * build/vault-demo <contraseña> [imagen.jpg] (HOME = la del usuario; lanza su propio lord-vault)- * No pisa una bóveda existente. */+ * build/vault-demo <password> [image.jpg] (HOME = the user's; launches its own lord-vault)+ * It does not overwrite an existing vault. */#include "vault/vclient.h"#include "vault/vjson.h"@@ -53,14 +53,14 @@ static void save(const char *entry) {}int main(int argc, char **argv) {- if (argc < 2) { fprintf(stderr, "uso: vault-demo <contraseña> [imagen]\n"); return 2; }+ if (argc < 2) { fprintf(stderr, "usage: vault-demo <password> [image]\n"); return 2; }setenv("XDG_RUNTIME_DIR", "/nonexistent", 1);unsetenv("DBUS_SESSION_BUS_ADDRESS");- if (vc_start()) { fprintf(stderr, "no se pudo lanzar lord-vault\n"); return 1; }+ if (vc_start()) { fprintf(stderr, "could not launch lord-vault\n"); return 1; }char buf[4096];snprintf(buf, sizeof buf, "{\"op\":\"create\",\"method\":\"password\",\"password\":\"%s\"}", argv[1]);const char *r = req(buf, NULL, 0);- printf("crear: %s\n", r);+ printf("create: %s\n", r);if (!strstr(r, "\"ok\":true")) return 1;long now = (long)time(NULL), old = now - 400L * 86400, mid = now - 120L * 86400;req("{\"op\":\"set-cats\",\"cats\":[{\"id\":\"utrabajo\",\"name\":\"Trabajo\",\"icon\":\"💼\",\"color\":\"#5e5ce6\",\"template\":\"internet\"},"@@ -133,19 +133,19 @@ int main(int argc, char **argv) {"{\"k\":\"password\",\"t\":\"hidden\",\"v\":\"qwerty\"}]}");snprintf(buf, sizeof buf, "{\"op\":\"trash\",\"id\":\"%s\"}", lastid);req(buf, NULL, 0);- /* adjuntos: la licencia (texto) y la foto del documento (si se pasó una imagen) */+ /* attachments: the license (text) and the photo of the ID document (if an image was given) */FILE *f = fopen("/tmp/licencia-demo.txt", "w");if (f) { fputs("Editor de fotos Pro 12\nLicencia: EFP-7Q2K-9M4X-RT8B-1ZC6\nTitular: Ana Gómez\n", f); fclose(f); }int fd = open("/tmp/licencia-demo.txt", O_RDONLY | O_CLOEXEC);if (fd >= 0) {snprintf(buf, sizeof buf, "{\"op\":\"att-add\",\"id\":\"%s\",\"name\":\"licencia.txt\",\"mime\":\"text/plain\"}", lic);- printf("adjunto licencia: %s\n", req(buf, &fd, 1));+ printf("license attachment: %s\n", req(buf, &fd, 1));}unlink("/tmp/licencia-demo.txt");if (argc > 2 && (fd = open(argv[2], O_RDONLY | O_CLOEXEC)) >= 0) {snprintf(buf, sizeof buf, "{\"op\":\"att-add\",\"id\":\"%s\",\"name\":\"foto-documento.jpg\",\"mime\":\"image/jpeg\"}", dni);- printf("adjunto foto: %s\n", req(buf, &fd, 1));+ printf("photo attachment: %s\n", req(buf, &fd, 1));}- printf("listo: %s\n", req("{\"op\":\"status\"}", NULL, 0));+ printf("done: %s\n", req("{\"op\":\"status\"}", NULL, 0));return 0;}diff --git a/server/tests/vault_e2e.c b/server/tests/vault_e2e.cindex cecd472..e3c3204 100644--- a/server/tests/vault_e2e.c+++ b/server/tests/vault_e2e.c@@ -1,9 +1,9 @@-/* vault_e2e.c — lord-vault de punta a punta, por el mismo cliente que usa lord-server- * (src/vault/vclient.c): crear, abrir, contraseña incorrecta, entradas, búsqueda, informe, TOTP,- * QR, generador, importar/exportar, adjuntos, ranuras (archivo llave, recuperación), llavero,- * bloqueo automático, y que la memoria del proceso esté protegida (VmFlags "dd" = MADV_DONTDUMP,- * "lo" = mlock; Dumpable 0). Usa una HOME temporal; no toca el bus de D-Bus.- * Se corre con `make build/vault-e2e && build/vault-e2e` (necesita build/lord-vault al lado). */+/* vault_e2e.c — lord-vault end to end, through the same client lord-server uses+ * (src/vault/vclient.c): create, unlock, wrong password, entries, search, report, TOTP,+ * QR, generator, import/export, attachments, slots (key file, recovery), keyring,+ * auto-lock, and that the process memory is protected (VmFlags "dd" = MADV_DONTDUMP,+ * "lo" = mlock; Dumpable 0). Uses a temporary HOME; does not touch the D-Bus bus.+ * Run with `make build/vault-e2e && build/vault-e2e` (needs build/lord-vault next to it). */#include "vault/vclient.h"#include "vault/vjson.h"#include "vault/vwire.h"@@ -18,13 +18,13 @@#include <unistd.h>static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static double now_ms(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec * 1e3 + t.tv_nsec / 1e6; }-static char last[1 << 22]; /* última respuesta */+static char last[1 << 22]; /* last reply */static int events_locked;-/* manda y espera la respuesta (texto JSON en `last`) */+/* sends and waits for the reply (JSON text in `last`) */static const char *req(const char *json, int *fds, int nfds) {int id = vc_request(json, strlen(json), fds, nfds);if (id < 0) { snprintf(last, sizeof last, "{\"error\":\"send\"}"); return last; }@@ -77,55 +77,55 @@ int main(void) {setenv("HOME", home, 1);setenv("XDG_RUNTIME_DIR", "/nonexistent", 1);unsetenv("DBUS_SESSION_BUS_ADDRESS");- check(vc_available(), "lord-vault al lado del binario");- check(vc_start() == 0, "lanzar lord-vault");+ check(vc_available(), "lord-vault next to the binary");+ check(vc_start() == 0, "launch lord-vault");const char *r;char p[512], rec[64];r = req("{\"op\":\"status\"}", NULL, 0);- check(ok(r) && strstr(r, "\"exists\":false"), "estado inicial: sin bóveda");+ check(ok(r) && strstr(r, "\"exists\":false"), "initial state: no vault");double t0 = now_ms();r = req("{\"op\":\"create\",\"method\":\"password\",\"password\":\"Contraseña maestra 1\",\"targetMs\":600}", NULL, 0);double tcreate = now_ms() - t0;- check(ok(r), "crear bóveda con contraseña");+ check(ok(r), "create vault with password");jstr(r, "recovery", rec, sizeof rec);- check(strlen(rec) == 47, "clave de recuperación de 8 grupos");- printf("crear: %.0f ms (%s)\n", tcreate, r);+ check(strlen(rec) == 47, "8-group recovery key");+ printf("create: %.0f ms (%s)\n", tcreate, r);- /* entradas */+ /* entries */r = req("{\"op\":\"save\",\"entry\":{\"cat\":\"internet\",\"title\":\"Banco Ejemplo\",\"tags\":[\"finanzas\"],\"f\":[{\"k\":\"username\",\"t\":\"text\",\"v\":\"ana\"},""{\"k\":\"password\",\"t\":\"hidden\",\"v\":\"password\"},{\"k\":\"url\",\"t\":\"url\",\"v\":\"https://banco.example\"},""{\"k\":\"totp\",\"t\":\"totp\",\"v\":\"otpauth://totp/Banco:ana?secret=JBSWY3DPEHPK3PXP&issuer=Banco\"}]}}", NULL, 0);- check(ok(r), "guardar entrada");+ check(ok(r), "save entry");char id1[40];jstr(r, "id", id1, sizeof id1);r = req("{\"op\":\"save\",\"entry\":{\"cat\":\"wifi\",\"title\":\"Casa\",\"f\":[{\"k\":\"ssid\",\"t\":\"text\",\"v\":\"MiRed\"},{\"k\":\"security\",\"t\":\"text\",\"v\":\"WPA2\"},{\"k\":\"password\",\"t\":\"hidden\",\"v\":\"password\"}]}}", NULL, 0);- check(ok(r), "guardar Wi-Fi");+ check(ok(r), "save Wi-Fi");char id2[40];jstr(r, "id", id2, sizeof id2);r = req("{\"op\":\"list\"}", NULL, 0);- check(ok(r) && strstr(r, "Banco Ejemplo") && !strstr(r, "JBSWY3DP") && !strstr(r, "\"password\""), "lista sin secretos");+ check(ok(r) && strstr(r, "Banco Ejemplo") && !strstr(r, "JBSWY3DP") && !strstr(r, "\"password\""), "list without secrets");snprintf(p, sizeof p, "{\"op\":\"get\",\"id\":\"%s\"}", id1);r = req(p, NULL, 0);- check(ok(r) && strstr(r, "\"has\":true") && !strstr(r, "JBSWY3DP"), "get sin reveal");+ check(ok(r) && strstr(r, "\"has\":true") && !strstr(r, "JBSWY3DP"), "get without reveal");snprintf(p, sizeof p, "{\"op\":\"reveal\",\"id\":\"%s\",\"k\":\"password\"}", id1);r = req(p, NULL, 0);- check(ok(r) && strstr(r, "\"value\":\"password\""), "reveal de un campo");+ check(ok(r) && strstr(r, "\"value\":\"password\""), "reveal one field");r = req("{\"op\":\"search\",\"q\":\"banco finanzas\"}", NULL, 0);- check(ok(r) && strstr(r, id1), "búsqueda");+ check(ok(r) && strstr(r, id1), "search");r = req("{\"op\":\"totp\"}", NULL, 0);- check(ok(r) && strstr(r, "\"code\":\"") && strstr(r, "\"issuer\":\"Banco\"") && !strstr(r, "JBSWY3DP"), "códigos TOTP sin el secreto");+ check(ok(r) && strstr(r, "\"code\":\"") && strstr(r, "\"issuer\":\"Banco\"") && !strstr(r, "JBSWY3DP"), "TOTP codes without the secret");r = req("{\"op\":\"report\"}", NULL, 0);- check(ok(r) && strstr(r, "\"common\":true") && strstr(r, "\"reused\":[[\""), "informe: débil y repetida");+ check(ok(r) && strstr(r, "\"common\":true") && strstr(r, "\"reused\":[[\""), "report: weak and reused");snprintf(p, sizeof p, "{\"op\":\"qr\",\"id\":\"%s\"}", id2);r = req(p, NULL, 0);- check(ok(r) && strstr(r, "\"rows\":[\""), "QR del Wi-Fi");+ check(ok(r) && strstr(r, "\"rows\":[\""), "Wi-Fi QR");r = req("{\"op\":\"generate\",\"length\":32,\"symbols\":true}", NULL, 0);- check(ok(r) && strstr(r, "\"score\":4"), "generador");+ check(ok(r) && strstr(r, "\"score\":4"), "generator");r = req("{\"op\":\"generate\",\"words\":5,\"sep\":\" \"}", NULL, 0);- check(ok(r), "frase");+ check(ok(r), "passphrase");- /* adjuntos */+ /* attachments */char f[600];snprintf(f, sizeof f, "%s/lic.txt", home);FILE *fp = fopen(f, "w");@@ -134,7 +134,7 @@ int main(void) {int fd = openr(f);snprintf(p, sizeof p, "{\"op\":\"att-add\",\"id\":\"%s\",\"name\":\"lic.txt\",\"mime\":\"text/plain\"}", id1);r = req(p, &fd, 1);- check(ok(r) && strstr(r, "\"natt\":1"), "agregar adjunto");+ check(ok(r) && strstr(r, "\"natt\":1"), "add attachment");snprintf(p, sizeof p, "{\"op\":\"get\",\"id\":\"%s\"}", id1);r = req(p, NULL, 0);char *a = strstr(r, "\"att\":[{\"id\":\"");@@ -142,23 +142,23 @@ int main(void) {if (a) { memcpy(attid, a + 14, 32); attid[32] = 0; }snprintf(p, sizeof p, "{\"op\":\"att-text\",\"id\":\"%s\",\"att\":\"%s\"}", id1, attid);r = req(p, NULL, 0);- check(ok(r) && strstr(r, "CLAVE-DE-LICENCIA-1234"), "leer adjunto");+ check(ok(r) && strstr(r, "CLAVE-DE-LICENCIA-1234"), "read attachment");- /* bloquear, contraseña incorrecta, abrir */+ /* lock, wrong password, unlock */r = req("{\"op\":\"lock\"}", NULL, 0);- check(ok(r), "bloquear");+ check(ok(r), "lock");r = req("{\"op\":\"list\"}", NULL, 0);- check(err(r, "locked"), "bloqueada no lista");+ check(err(r, "locked"), "locked vault doesn't list");r = req("{\"op\":\"unlock\",\"method\":\"password\",\"password\":\"otra\"}", NULL, 0);- check(err(r, "bad-key"), "contraseña incorrecta");+ check(err(r, "bad-key"), "wrong password");t0 = now_ms();r = req("{\"op\":\"unlock\",\"method\":\"password\",\"password\":\"Contraseña maestra 1\"}", NULL, 0);double tun = now_ms() - t0;- check(ok(r), "abrir");- printf("abrir con contraseña: %.0f ms (%s)\n", tun, r);+ check(ok(r), "unlock");+ printf("unlock with password: %.0f ms (%s)\n", tun, r);snprintf(p, sizeof p, "{\"op\":\"att-text\",\"id\":\"%s\",\"att\":\"%s\"}", id1, attid);r = req(p, NULL, 0);- check(ok(r) && strstr(r, "CLAVE-DE-LICENCIA-1234"), "adjunto después de guardar y abrir");+ check(ok(r) && strstr(r, "CLAVE-DE-LICENCIA-1234"), "attachment after save and unlock");/* App channel (vc_attach_app): what the sandboxed Passwords process (lord-server --app) uses.* Same API on its own socket; a lock from the control channel reaches it as an event. */@@ -186,82 +186,82 @@ int main(void) {}}- /* archivo llave nuevo (como en un pendrive) + abrir con él */+ /* new key file (as on a USB stick) + unlock with it */snprintf(f, sizeof f, "%s/pendrive.key", home);fd = openw(f);r = req("{\"op\":\"slot-add\",\"method\":\"keyfile\",\"newkey\":true,\"label\":\"Pendrive\"}", &fd, 1);- check(ok(r), "ranura de archivo llave");+ check(ok(r), "key file slot");struct stat st;- check(stat(f, &st) == 0 && st.st_size == 64, "archivo llave de 64 bytes");+ check(stat(f, &st) == 0 && st.st_size == 64, "64-byte key file");req("{\"op\":\"lock\"}", NULL, 0);fd = openr(f);r = req("{\"op\":\"unlock\",\"method\":\"keyfile\"}", &fd, 1);- check(ok(r), "abrir con el archivo llave");+ check(ok(r), "unlock with the key file");req("{\"op\":\"lock\"}", NULL, 0);snprintf(p, sizeof p, "{\"op\":\"unlock\",\"method\":\"recovery\",\"recovery\":\"%s\"}", rec);r = req(p, NULL, 0);- check(ok(r), "abrir con la clave de recuperación");+ check(ok(r), "unlock with the recovery key");- /* contraseña + archivo llave (dos factores): reemplaza a la contraseña sola */+ /* password + key file (two factors): replaces the password alone */snprintf(f, sizeof f, "%s/segundo.key", home);fd = openw(f);r = req("{\"op\":\"slot-add\",\"method\":\"passkey\",\"newkey\":true,\"password\":\"Dos factores 2\"}", &fd, 1);- check(ok(r), "ranura contraseña + archivo llave");+ check(ok(r), "password + key file slot");req("{\"op\":\"lock\"}", NULL, 0);r = req("{\"op\":\"unlock\",\"method\":\"password\",\"password\":\"Contraseña maestra 1\"}", NULL, 0);- check(!ok(r), "la contraseña sola ya no abre");+ check(!ok(r), "the password alone no longer unlocks");fd = openr(f);r = req("{\"op\":\"unlock\",\"method\":\"passkey\",\"password\":\"Dos factores 2\"}", &fd, 1);- check(ok(r), "abrir con contraseña + archivo llave");+ check(ok(r), "unlock with password + key file");- /* importar Chrome CSV y exportar CSV */+ /* import Chrome CSV and export CSV */snprintf(f, sizeof f, "%s/chrome.csv", home);fp = fopen(f, "w");fputs("name,url,username,password,note\nEjemplo,https://ejemplo.com/,bob,Xy7#kd92!aQ,\n\"Con, coma\",https://otro.com/,ana,\"pa\"\"ss\",nota\n", fp);fclose(fp);fd = openr(f);r = req("{\"op\":\"import\",\"name\":\"chrome.csv\"}", &fd, 1);- check(ok(r) && strstr(r, "\"count\":2") && strstr(r, "chrome-csv"), "importar CSV de Chrome");+ check(ok(r) && strstr(r, "\"count\":2") && strstr(r, "chrome-csv"), "import Chrome CSV");snprintf(f, sizeof f, "%s/export.csv", home);fd = openw(f);r = req("{\"op\":\"export-csv\"}", &fd, 1);- check(ok(r) && strstr(r, "\"count\":4"), "exportar CSV");+ check(ok(r) && strstr(r, "\"count\":4"), "export CSV");snprintf(f, sizeof f, "%s/copia.lvault", home);fd = openw(f);r = req("{\"op\":\"export-vault\"}", &fd, 1);- check(ok(r), "exportar copia .lvault");+ check(ok(r), "export .lvault copy");- /* llavero: no existe sin la contraseña de la sesión; se crea con ella */+ /* keyring: it doesn't exist without the session password; it is created with it */r = req("{\"op\":\"kr-set\",\"owner\":\"mail\",\"service\":\"imap.example.com\",\"account\":\"ana\",\"secret\":\"s\"}", NULL, 0);- check(err(r, "no-keyring"), "sin llavero de sesión todavía");+ check(err(r, "no-keyring"), "no session keyring yet");vc_session_password("clave de la sesión");usleep(1500000);r = req("{\"op\":\"status\"}", NULL, 0);- check(strstr(r, "\"login\":{\"exists\":true,\"unreadable\":false,\"unlocked\":true") != NULL, "llavero creado y abierto con la sesión");+ check(strstr(r, "\"login\":{\"exists\":true,\"unreadable\":false,\"unlocked\":true") != NULL, "keyring created and unlocked with the session");r = req("{\"op\":\"kr-set\",\"owner\":\"mail\",\"service\":\"imap.example.com\",\"account\":\"ana\",\"secret\":\"secreto-imap\"}", NULL, 0);check(ok(r), "kr-set");r = req("{\"op\":\"kr-get\",\"owner\":\"mail\",\"service\":\"imap.example.com\",\"account\":\"ana\"}", NULL, 0);- check(ok(r) && strstr(r, "secreto-imap"), "kr-get de la misma app");+ check(ok(r) && strstr(r, "secreto-imap"), "kr-get from the same app");r = req("{\"op\":\"kr-get\",\"owner\":\"settings\",\"service\":\"imap.example.com\",\"account\":\"ana\"}", NULL, 0);- check(err(r, "not-shared"), "otra app no lo ve");+ check(err(r, "not-shared"), "another app can't see it");r = req("{\"op\":\"kr-list\",\"owner\":\"settings\"}", NULL, 0);- check(ok(r) && !strstr(r, "imap"), "kr-list de otra app vacío");+ check(ok(r) && !strstr(r, "imap"), "kr-list from another app is empty");char kid[40] = "";r = req("{\"op\":\"kr-list\",\"owner\":\"mail\"}", NULL, 0);char *ki = strstr(r, "\"id\":\"");if (ki) { memcpy(kid, ki + 6, 32); kid[32] = 0; }snprintf(p, sizeof p, "{\"op\":\"kr-share\",\"admin\":true,\"id\":\"%s\",\"app\":\"settings\"}", kid);r = req(p, NULL, 0);- check(ok(r), "compartir con permiso del usuario");+ check(ok(r), "share with the user's permission");r = req("{\"op\":\"kr-get\",\"owner\":\"settings\",\"service\":\"imap.example.com\",\"account\":\"ana\"}", NULL, 0);- check(ok(r) && strstr(r, "secreto-imap"), "ahora sí lo ve");+ check(ok(r) && strstr(r, "secreto-imap"), "now it can see it");vc_lock_all("screen");usleep(300000);r = req("{\"op\":\"status\"}", NULL, 0);check(strstr(r, "\"main\":{\"exists\":true,\"unreadable\":false,\"unlocked\":false") && strstr(r, "\"login\":{\"exists\":true,\"unreadable\":false,\"unlocked\":true"),- "bloquear la pantalla cierra Contraseñas y no el llavero");+ "locking the screen locks Passwords but not the keyring");- /* memoria protegida del proceso */+ /* protected process memory */{FILE *ps = popen("pgrep -n -x lord-vault", "r");int vpid = 0;@@ -272,18 +272,18 @@ int main(void) {int dd = 0, lo = 0;while (sm && fgets(line, sizeof line, sm)) if (!strncmp(line, "VmFlags:", 8)) { if (strstr(line, " dd")) dd++; if (strstr(line, " lo")) lo++; }if (sm) fclose(sm);- printf("lord-vault %d: %d regiones MADV_DONTDUMP, %d con mlock (smaps %s)\n", vpid, dd, lo, sm ? "legible" : "no legible: no dumpable");- check(vpid > 0, "lord-vault corre");- check(!sm || (dd > 0 && lo > 0), "memoria con DONTDUMP y mlock (o el proceso no es dumpable)");+ printf("lord-vault %d: %d MADV_DONTDUMP regions, %d mlocked (smaps %s)\n", vpid, dd, lo, sm ? "readable" : "unreadable: not dumpable");+ check(vpid > 0, "lord-vault is running");+ check(!sm || (dd > 0 && lo > 0), "memory with DONTDUMP and mlock (or the process isn't dumpable)");snprintf(path, sizeof path, "/proc/%d/status", vpid);FILE *ss = fopen(path, "r");int nnp = 0, secc = 0;while (ss && fgets(line, sizeof line, ss)) { if (!strncmp(line, "NoNewPrivs:\t1", 13)) nnp = 1; if (!strncmp(line, "Seccomp:\t2", 10)) secc = 1; }if (ss) fclose(ss);- check(nnp && secc, "encerrado: no_new_privs y seccomp");+ check(nnp && secc, "sandboxed: no_new_privs and seccomp");}- /* 10 000 entradas por importación y búsqueda medida dentro de lord-vault */+ /* 10,000 entries through import, and search measured inside lord-vault */{snprintf(f, sizeof f, "%s/grande.csv", home);fp = fopen(f, "w");@@ -296,23 +296,23 @@ int main(void) {fd = openr(f);t0 = now_ms();r = req("{\"op\":\"import\",\"name\":\"grande.csv\"}", &fd, 1);- printf("importar 10 000: %.0f ms (%s)\n", now_ms() - t0, r);- check(ok(r) && strstr(r, "\"count\":10000"), "importar 10 000");+ printf("import 10,000: %.0f ms (%s)\n", now_ms() - t0, r);+ check(ok(r) && strstr(r, "\"count\":10000"), "import 10,000");double worst = 0;for (int k = 0; k < 5; k++) {r = req(k % 2 ? "{\"op\":\"search\",\"q\":\"usuario9999\"}" : "{\"op\":\"search\",\"q\":\"sitio 42\"}", NULL, 0);Vj j;if (!vj_parse(&j, r, strlen(r))) { double ms = vj_getn(&j, 0, "ms", 99); if (ms > worst) worst = ms; vj_free(&j); }}- printf("búsqueda en lord-vault con 10 004 entradas: peor %.2f ms\n", worst);- check(worst < 10, "búsqueda < 10 ms en lord-vault");+ printf("search in lord-vault with 10,004 entries: worst %.2f ms\n", worst);+ check(worst < 10, "search < 10 ms in lord-vault");t0 = now_ms();r = req("{\"op\":\"list\"}", NULL, 0);- printf("lista de 10 004 entradas: %zu KB en %.0f ms (ida y vuelta)\n", strlen(r) / 1024, now_ms() - t0);+ printf("list of 10,004 entries: %zu KB in %.0f ms (round trip)\n", strlen(r) / 1024, now_ms() - t0);req("{\"op\":\"lock\"}", NULL, 0);t0 = now_ms();r = req(p, NULL, 0);- printf("abrir 10 004 entradas con la clave de recuperación: %.0f ms\n", now_ms() - t0);+ printf("unlock 10,004 entries with the recovery key: %.0f ms\n", now_ms() - t0);}char cmd[200];diff --git a/server/tests/vault_test.c b/server/tests/vault_test.cindex 225675e..e9318c3 100644--- a/server/tests/vault_test.c+++ b/server/tests/vault_test.c@@ -1,11 +1,11 @@-/* vault_test.c — la bóveda de Contraseñas (docs/CONTRASENAS.md):- * - formato .lvault: ida y vuelta, todas las formas de abrir, contraseña incorrecta, archivo- * alterado byte por byte (cabecera, ranuras, cuerpo, adjuntos, cola) y cortado en cada largo;- * - guardado atómico con copia .bak;- * - contenido (vmodel): crear/actualizar con "keep", historial, búsqueda en 10 000 entradas;- * - TOTP/HOTP contra RFC 6238/4226 y otpauth://;- * - generador y fuerza; JSON en la arena; protocolo (vwire) con mensajes grandes y fds;- * - tiempos: Argon2id calibrado para ~0,5–1 s. */+/* vault_test.c — the Passwords vault (docs/PASSWORDS.md):+ * - .lvault format: round trip, every way of opening, wrong password, file+ * altered byte by byte (header, slots, body, attachments, tail) and truncated at every length;+ * - atomic save with a .bak copy;+ * - content (vmodel): create/update with "keep", history, search across 10,000 entries;+ * - TOTP/HOTP against RFC 6238/4226 and otpauth://;+ * - generator and strength; JSON in the arena; protocol (vwire) with large messages and fds;+ * - timings: Argon2id calibrated for ~0.5–1 s. */#include "vault/vfile.h"#include "vault/vmodel.h"#include "vault/vjson.h"@@ -28,7 +28,7 @@ extern const char _binary_words_txt_start[], _binary_words_txt_end[];extern const char _binary_common_txt_start[], _binary_common_txt_end[];static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static double now_ms(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec * 1e3 + t.tv_nsec / 1e6; }static uint8_t *file_bytes(int fd, size_t *len) {@@ -44,7 +44,7 @@ static const char *PAYLOAD ="{\"id\":\"00112233445566778899aabbccddeeff\",\"cat\":\"internet\",\"title\":\"Correo de Ñandú\",\"fav\":true,""\"tags\":[\"trabajo\"],\"f\":[{\"k\":\"username\",\"t\":\"text\",\"v\":\"[email protected]\"},{\"k\":\"password\",\"t\":\"hidden\",\"v\":\"s3cr3t-\\\"q\\\"\"}]}]}";-/* arma una bóveda con varias ranuras en un archivo temporal; devuelve el fd */+/* builds a vault with several slots in a temporary file; returns the fd */static VKdf fast = { 8 * 1024, 1, 1 };static uint8_t kf_hash[32], fido_out[32];static char recovery[48];@@ -55,27 +55,27 @@ static int make_vault(VHeader *h, uint8_t vk[32], const char *path, int with_attVFactors f = { .password = "correcta horse" };VSlot s;memset(&s, 0, sizeof s);- check(vf_make_slot(h, &s, VS_PASSWORD, &f, vk, &fast, "principal") == VF_OK, "ranura de contraseña");+ check(vf_make_slot(h, &s, VS_PASSWORD, &f, vk, &fast, "principal") == VF_OK, "password slot");h->slots[h->nslots++] = s;vf_keyfile_hash((const uint8_t *)"llave-de-prueba-con-mas-de-treinta-y-dos-bytes!!", 48, kf_hash);VFactors fk = { .keyfile = kf_hash };memset(&s, 0, sizeof s);- check(vf_make_slot(h, &s, VS_KEYFILE, &fk, vk, &fast, "usb") == VF_OK, "ranura de archivo llave");+ check(vf_make_slot(h, &s, VS_KEYFILE, &fk, vk, &fast, "usb") == VF_OK, "key file slot");h->slots[h->nslots++] = s;VFactors fp = { .password = "otra", .keyfile = kf_hash };memset(&s, 0, sizeof s);- check(vf_make_slot(h, &s, VS_PASSKEY, &fp, vk, &fast, "2fa") == VF_OK, "ranura de contraseña + llave");+ check(vf_make_slot(h, &s, VS_PASSKEY, &fp, vk, &fast, "2fa") == VF_OK, "password + key slot");h->slots[h->nslots++] = s;memset(fido_out, 0x5a, 32);VFactors ff = { .fido = fido_out };memset(&s, 0, sizeof s);s.cred_len = 3; s.cred[0] = 1; s.cred[1] = 2; s.cred[2] = 3; s.fido_pin = 1;- check(vf_make_slot(h, &s, VS_FIDO2, &ff, vk, &fast, "YubiKey") == VF_OK, "ranura FIDO2");+ check(vf_make_slot(h, &s, VS_FIDO2, &ff, vk, &fast, "YubiKey") == VF_OK, "FIDO2 slot");h->slots[h->nslots++] = s;vf_recovery_new(recovery);VFactors fr = { .recovery = recovery };memset(&s, 0, sizeof s);- check(vf_make_slot(h, &s, VS_RECOVERY, &fr, vk, &fast, "") == VF_OK, "ranura de recuperación");+ check(vf_make_slot(h, &s, VS_RECOVERY, &fr, vk, &fast, "") == VF_OK, "recovery slot");h->slots[h->nslots++] = s;int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0600);VAttOut att;@@ -87,7 +87,7 @@ static int make_vault(VHeader *h, uint8_t vk[32], const char *path, int with_attatt.cipher = cipher;att.len = 21;}- check(vf_write_fd(fd, h, vk, (const uint8_t *)PAYLOAD, strlen(PAYLOAD), &att, with_att) == VF_OK, "escribir bóveda");+ check(vf_write_fd(fd, h, vk, (const uint8_t *)PAYLOAD, strlen(PAYLOAD), &att, with_att) == VF_OK, "write vault");return fd;}@@ -99,41 +99,41 @@ static void test_format(void) {uint8_t *d = file_bytes(fd, &len);close(fd);VHeader r;- check(vf_parse(d, len, &r) == VF_OK, "leer cabecera");- check(r.nslots == 5 && r.natts == 1, "ranuras y adjuntos leídos");- check(!strcmp(r.slots[3].label, "YubiKey") && r.slots[3].cred_len == 3 && r.slots[3].fido_pin == 1, "datos de la ranura FIDO2");+ check(vf_parse(d, len, &r) == VF_OK, "read header");+ check(r.nslots == 5 && r.natts == 1, "slots and attachments read");+ check(!strcmp(r.slots[3].label, "YubiKey") && r.slots[3].cred_len == 3 && r.slots[3].fido_pin == 1, "FIDO2 slot data");int slot = -1;VFactors good = { .password = "correcta horse" }, bad = { .password = "incorrecta" };- check(vf_open_slot(&r, 0, &bad, vk2, &slot) == VF_EBADKEY, "contraseña incorrecta → bad-key");- check(vf_open_slot(&r, 0, &good, vk2, &slot) == VF_OK && slot == 0 && !memcmp(vk, vk2, 32), "contraseña correcta");+ check(vf_open_slot(&r, 0, &bad, vk2, &slot) == VF_EBADKEY, "wrong password → bad-key");+ check(vf_open_slot(&r, 0, &good, vk2, &slot) == VF_OK && slot == 0 && !memcmp(vk, vk2, 32), "right password");VFactors fk = { .keyfile = kf_hash };- check(vf_open_slot(&r, VS_KEYFILE, &fk, vk2, &slot) == VF_OK && slot == 1, "archivo llave");+ check(vf_open_slot(&r, VS_KEYFILE, &fk, vk2, &slot) == VF_OK && slot == 1, "key file");uint8_t other[32];vf_keyfile_hash((const uint8_t *)"otra llave distinta de treinta y dos bytes o mas....", 52, other);VFactors fk2 = { .keyfile = other };- check(vf_open_slot(&r, VS_KEYFILE, &fk2, vk2, &slot) == VF_EBADKEY, "otro archivo llave → bad-key");+ check(vf_open_slot(&r, VS_KEYFILE, &fk2, vk2, &slot) == VF_EBADKEY, "another key file → bad-key");VFactors fp = { .password = "otra", .keyfile = kf_hash }, fpw = { .password = "otra" };- check(vf_open_slot(&r, VS_PASSKEY, &fp, vk2, &slot) == VF_OK && slot == 2, "contraseña + archivo llave");- check(vf_open_slot(&r, VS_PASSKEY, &fpw, vk2, &slot) == VF_ENOSLOT, "contraseña sin la llave no alcanza");+ check(vf_open_slot(&r, VS_PASSKEY, &fp, vk2, &slot) == VF_OK && slot == 2, "password + key file");+ check(vf_open_slot(&r, VS_PASSKEY, &fpw, vk2, &slot) == VF_ENOSLOT, "password without the key isn't enough");VFactors ff = { .fido = fido_out };- check(vf_open_slot(&r, VS_FIDO2, &ff, vk2, &slot) == VF_OK && slot == 3, "salida FIDO2");+ check(vf_open_slot(&r, VS_FIDO2, &ff, vk2, &slot) == VF_OK && slot == 3, "FIDO2 output");char rec[64];snprintf(rec, sizeof rec, "%s", recovery);- for (char *p = rec; *p; p++) if (*p >= 'A' && *p <= 'Z') *p += 32; /* minúsculas */+ for (char *p = rec; *p; p++) if (*p >= 'A' && *p <= 'Z') *p += 32; /* lowercase */char nodash[64];int k = 0;for (char *p = rec; *p; p++) if (*p != '-') nodash[k++] = *p;nodash[k] = 0;VFactors fr = { .recovery = nodash };- check(vf_open_slot(&r, VS_RECOVERY, &fr, vk2, &slot) == VF_OK && slot == 4, "clave de recuperación (minúsculas, sin guiones)");+ check(vf_open_slot(&r, VS_RECOVERY, &fr, vk2, &slot) == VF_OK && slot == 4, "recovery key (lowercase, no dashes)");uint8_t *plain;size_t plen;- check(vf_read_body(d, len, &r, vk2, &plain, &plen) == VF_OK && plen == strlen(PAYLOAD) && !memcmp(plain, PAYLOAD, plen), "cuerpo ida y vuelta");+ check(vf_read_body(d, len, &r, vk2, &plain, &plen) == VF_OK && plen == strlen(PAYLOAD) && !memcmp(plain, PAYLOAD, plen), "body round trip");sm_free(plain);uint8_t pt[64];- check(vf_att_open(vk2, r.vault_id, r.atts[0].id, d + r.atts[0].off, r.atts[0].len, r.atts[0].nonce, r.atts[0].mac, pt) == VF_OK && !memcmp(pt, "contenido del adjunto", 21), "adjunto ida y vuelta");+ check(vf_att_open(vk2, r.vault_id, r.atts[0].id, d + r.atts[0].off, r.atts[0].len, r.atts[0].nonce, r.atts[0].mac, pt) == VF_OK && !memcmp(pt, "contenido del adjunto", 21), "attachment round trip");- /* alterar cada byte: nunca puede abrir con contenido cambiado */+ /* alter every byte: it must never open with changed content */int opened_altered = 0, detected = 0;for (size_t i = 0; i < len; i++) {uint8_t *t = malloc(len);@@ -149,7 +149,7 @@ static void test_format(void) {size_t pll;if (vf_read_body(t, len, &th, k2, &pl, &pll) == VF_OK) {ok = 1;- /* abrir el cuerpo pudo solo si el byte era de un adjunto: ese no tiene que abrir */+ /* the body could only open if the byte belonged to an attachment: that one must not open */if (th.natts == 1 && i >= th.atts[0].off - 48 && i < th.atts[0].off + th.atts[0].len + 16) {uint8_t p2[64];if (vf_att_open(k2, th.vault_id, th.atts[0].id, t + th.atts[0].off, th.atts[0].len, th.atts[0].nonce, th.atts[0].mac, p2) == VF_OK@@ -157,7 +157,7 @@ static void test_format(void) {ok = 0;} else if (pll != plen || memcmp(pl, PAYLOAD, pll)) opened_altered++;else {- /* bytes de otras ranuras (no la usada) cambian la cabecera → el cuerpo no autentica */+ /* bytes of other slots (not the one used) change the header → the body doesn't authenticate */opened_altered++;}sm_free(pl);@@ -168,24 +168,24 @@ static void test_format(void) {if (!ok) detected++;free(t);}- check(opened_altered == 0, "ningún byte alterado pasa");- printf("alterar: %zu bytes probados, %d detectados\n", len, detected);- /* cortado en cada largo */+ check(opened_altered == 0, "no altered byte gets through");+ printf("alter: %zu bytes tried, %d detected\n", len, detected);+ /* truncated at every length */int trunc_ok = 1;for (size_t n = 0; n < len; n++) {VHeader th;int pr = vf_parse(d, n, &th);if (pr == VF_OK) { trunc_ok = 0; vf_header_free(&th); }}- check(trunc_ok, "cortado en cualquier largo → error");+ check(trunc_ok, "truncated at any length → error");VHeader th;- check(vf_parse(d, len - 1, &th) == VF_ETRUNC || vf_parse(d, len - 1, &th) == VF_EFORMAT, "cortado al final se reconoce");- check(vf_parse((const uint8_t *)"PK\x03\x04 no es una boveda", 24, &th) == VF_EFORMAT, "otro archivo → not-a-vault");+ check(vf_parse(d, len - 1, &th) == VF_ETRUNC || vf_parse(d, len - 1, &th) == VF_EFORMAT, "truncation at the end is recognized");+ check(vf_parse((const uint8_t *)"PK\x03\x04 no es una boveda", 24, &th) == VF_EFORMAT, "another file → not-a-vault");{uint8_t *t = malloc(len);memcpy(t, d, len);t[8] = 9;- check(vf_parse(t, len, &th) == VF_EVERSION, "versión desconocida");+ check(vf_parse(t, len, &th) == VF_EVERSION, "unknown version");free(t);}vf_header_free(&r);@@ -195,7 +195,7 @@ static void test_format(void) {static void test_save(void) {char dir[] = "/tmp/vault-test-pw-116-XXXXXX";- check(mkdtemp(dir) != NULL, "carpeta temporal");+ check(mkdtemp(dir) != NULL, "temporary folder");int dfd = open(dir, O_RDONLY | O_DIRECTORY);VHeader h;uint8_t vk[32];@@ -207,29 +207,29 @@ static void test_save(void) {vf_make_slot(&h, &s, VS_PASSWORD, &f, vk, &fast, "");h.slots[h.nslots++] = s;const char *v1 = "{\"v\":1,\"entries\":[]}", *v2 = "{\"v\":1,\"meta\":{\"x\":2},\"entries\":[]}";- check(vf_save(dfd, "b.lvault", &h, vk, (const uint8_t *)v1, strlen(v1), NULL, 0) == VF_OK, "guardar 1");+ check(vf_save(dfd, "b.lvault", &h, vk, (const uint8_t *)v1, strlen(v1), NULL, 0) == VF_OK, "save 1");struct stat st;- check(fstatat(dfd, "b.lvault.bak", &st, 0) != 0, "sin .bak la primera vez");- check(vf_save(dfd, "b.lvault", &h, vk, (const uint8_t *)v2, strlen(v2), NULL, 0) == VF_OK, "guardar 2");+ check(fstatat(dfd, "b.lvault.bak", &st, 0) != 0, "no .bak the first time");+ check(vf_save(dfd, "b.lvault", &h, vk, (const uint8_t *)v2, strlen(v2), NULL, 0) == VF_OK, "save 2");int bf = openat(dfd, "b.lvault.bak", O_RDONLY), cf = openat(dfd, "b.lvault", O_RDONLY);- check(bf >= 0 && cf >= 0, ".bak y actual existen");+ check(bf >= 0 && cf >= 0, ".bak and current exist");size_t bl, cl;uint8_t *bd = file_bytes(bf, &bl), *cd = file_bytes(cf, &cl);VHeader bh, ch;uint8_t *pt;size_t pl;int ok = vf_parse(bd, bl, &bh) == VF_OK && vf_read_body(bd, bl, &bh, vk, &pt, &pl) == VF_OK && pl == strlen(v1) && !memcmp(pt, v1, pl);- check(ok, ".bak es la versión anterior");+ check(ok, ".bak is the previous version");if (ok) sm_free(pt);ok = vf_parse(cd, cl, &ch) == VF_OK && vf_read_body(cd, cl, &ch, vk, &pt, &pl) == VF_OK && pl == strlen(v2) && !memcmp(pt, v2, pl);- check(ok, "el archivo es la versión nueva");+ check(ok, "the file is the new version");if (ok) sm_free(pt);- check(ch.counter == bh.counter + 1, "contador de guardados");+ check(ch.counter == bh.counter + 1, "save counter");close(bf); close(cf); free(bd); free(cd);- /* no quedan temporales */+ /* no temporary files are left */char cmd[200];snprintf(cmd, sizeof cmd, "test $(ls -A %s | wc -l) -eq 2", dir);- check(system(cmd) == 0, "sin archivos temporales");+ check(system(cmd) == 0, "no temporary files");snprintf(cmd, sizeof cmd, "rm -rf %s", dir);if (system(cmd)) { /* */ }close(dfd);@@ -237,46 +237,46 @@ static void test_save(void) {static void test_model(void) {VModel m;- check(vm_load(&m, PAYLOAD, strlen(PAYLOAD)) == 0 && m.n == 1, "cargar contenido");+ check(vm_load(&m, PAYLOAD, strlen(PAYLOAD)) == 0 && m.n == 1, "load content");VEntry *e = m.e[0];- check(!strcmp(vm_field(e, "password"), "s3cr3t-\"q\"") && e->fav && e->ntags == 1, "campos y escapes");- /* buscar sin tildes ni mayúsculas */+ check(!strcmp(vm_field(e, "password"), "s3cr3t-\"q\"") && e->fav && e->ntags == 1, "fields and escapes");+ /* search ignoring accents and case */VjB b;vb_init(&b);vm_search_json(&b, &m, "ÑANDU correo", 10);- check(b.p && strstr(b.p, "00112233"), "búsqueda sin tildes");+ check(b.p && strstr(b.p, "00112233"), "accent-insensitive search");vb_free(&b);vb_init(&b);vm_search_json(&b, &m, "s3cr3t", 10);- check(b.p && !strcmp(b.p, "[]"), "la contraseña no se busca");+ check(b.p && !strcmp(b.p, "[]"), "the password is not searched");vb_free(&b);- /* actualizar con keep: el valor oculto queda; cambia el usuario → historial */+ /* update with keep: the hidden value stays; the user changes → history */const char *upd = "{\"id\":\"00112233445566778899aabbccddeeff\",\"cat\":\"internet\",\"title\":\"Correo de Ñandú\",\"tags\":[\"trabajo\"],""\"f\":[{\"k\":\"username\",\"t\":\"text\",\"v\":\"[email protected]\"},{\"k\":\"password\",\"t\":\"hidden\",\"keep\":true}]}";Vj j;vj_parse(&j, upd, strlen(upd));char err[64];VEntry *ne = NULL;- check(vm_upsert(&m, &j, 0, &ne, err, sizeof err) == 0 && ne, "actualizar");+ check(vm_upsert(&m, &j, 0, &ne, err, sizeof err) == 0 && ne, "update");vj_free(&j);- check(ne && !strcmp(vm_field(ne, "password"), "s3cr3t-\"q\"") && !strcmp(vm_field(ne, "username"), "[email protected]"), "keep conserva el oculto");- check(ne && ne->hist && strstr(ne->hist, "[email protected]"), "historial con la versión anterior");+ check(ne && !strcmp(vm_field(ne, "password"), "s3cr3t-\"q\"") && !strcmp(vm_field(ne, "username"), "[email protected]"), "keep preserves the hidden value");+ check(ne && ne->hist && strstr(ne->hist, "[email protected]"), "history holds the previous version");vb_init(&b);vm_entry_json(&b, ne, 0, 1);- check(b.p && !strstr(b.p, "s3cr3t") && strstr(b.p, "\"has\":true"), "sin reveal no salen secretos (tampoco del historial)");+ check(b.p && !strstr(b.p, "s3cr3t") && strstr(b.p, "\"has\":true"), "without reveal no secrets come out (not from history either)");vb_free(&b);vb_init(&b);vm_entry_json(&b, ne, 1, 0);- check(b.p && strstr(b.p, "s3cr3t"), "con reveal sí");+ check(b.p && strstr(b.p, "s3cr3t"), "with reveal they do");vb_free(&b);- /* ida y vuelta del contenido */+ /* content round trip */size_t dl;char *dump = vm_dump(&m, &dl);VModel m2;- check(dump && vm_load(&m2, dump, dl) == 0 && m2.n == 1 && !strcmp(vm_field(m2.e[0], "username"), "[email protected]"), "contenido ida y vuelta");+ check(dump && vm_load(&m2, dump, dl) == 0 && m2.n == 1 && !strcmp(vm_field(m2.e[0], "username"), "[email protected]"), "content round trip");vm_free(&m2);sm_free(dump);- /* 10 000 entradas: búsqueda < 10 ms */+ /* 10,000 entries: search < 10 ms */for (int i = 0; i < 10000; i++) {char js[512];snprintf(js, sizeof js, "{\"cat\":\"internet\",\"title\":\"Sitio número %d %s\",\"tags\":[\"t%d\"],\"f\":[{\"k\":\"username\",\"t\":\"text\",\"v\":\"usuario%d@correo%d.com\"},"@@ -286,7 +286,7 @@ static void test_model(void) {vm_upsert(&m, &j, 0, NULL, err, sizeof err);vj_free(&j);}- check(m.n == 10001, "10 000 entradas");+ check(m.n == 10001, "10,000 entries");double best = 1e9, worst = 0;const char *qs[] = { "tienda", "usuario9999", "sitio número 42", "zzz-no-existe", "correo5 banco", NULL };for (int q = 0; qs[q]; q++) {@@ -300,26 +300,26 @@ static void test_model(void) {if (t > worst) worst = t;}}- printf("búsqueda en 10 001 entradas: %.2f–%.2f ms\n", best, worst);- check(worst < 10, "búsqueda < 10 ms");+ printf("search across 10,001 entries: %.2f–%.2f ms\n", best, worst);+ check(worst < 10, "search < 10 ms");vb_init(&b);double t0 = now_ms();vm_list_json(&b, &m);- printf("lista liviana: %zu KB en %.1f ms\n", b.n / 1024, now_ms() - t0);+ printf("light list: %zu KB in %.1f ms\n", b.n / 1024, now_ms() - t0);vb_free(&b);t0 = now_ms();dump = vm_dump(&m, &dl);double td = now_ms() - t0;t0 = now_ms();- check(vm_load(&m2, dump, dl) == 0 && m2.n == 10001, "cargar 10 000");- printf("contenido de 10 001 entradas: %zu KB, volcar %.1f ms, cargar %.1f ms\n", dl / 1024, td, now_ms() - t0);+ check(vm_load(&m2, dump, dl) == 0 && m2.n == 10001, "load 10,000");+ printf("content of 10,001 entries: %zu KB, dump %.1f ms, load %.1f ms\n", dl / 1024, td, now_ms() - t0);vm_free(&m2);sm_free(dump);vm_free(&m);}static void test_totp(void) {- /* RFC 6238 apéndice B (8 dígitos) */+ /* RFC 6238 appendix B (8 digits) */struct { uint64_t t; const char *s1, *s256, *s512; } v[] = {{ 59, "94287082", "46119246", "90693936" }, { 1111111109, "07081804", "68084774", "25091201" },{ 1111111111, "14050471", "67062674", "99943326" }, { 1234567890, "89005924", "91819424", "93441116" },@@ -337,7 +337,7 @@ static void test_totp(void) {totp_format(&c, totp_code(&c, v[i].t, NULL), o); if (strcmp(o, v[i].s512)) ok = 0;}check(ok, "TOTP RFC 6238 (SHA-1, SHA-256, SHA-512)");- /* RFC 4226 apéndice D */+ /* RFC 4226 appendix D */static const char *hotp[] = { "755224", "287082", "359152", "969429", "338314", "254676", "287922", "162583", "399871", "520489" };a.digits = 6;ok = 1;@@ -346,19 +346,19 @@ static void test_totp(void) {Totp t;check(totp_parse("otpauth://totp/ACME%20Co:[email protected]?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&issuer=ACME%20Co&algorithm=SHA1&digits=6&period=30", &t) == 0&& !strcmp(t.issuer, "ACME Co") && !strcmp(t.account, "[email protected]") && t.keylen == 20 && t.digits == 6, "otpauth:// (Google Authenticator)");- check(totp_parse("JBSW Y3DP EHPK 3PXP", &t) == 0 && t.keylen == 10 && !memcmp(t.key, "Hello!\xde\xad\xbe\xef", 10), "secreto base32 suelto");- check(totp_parse("otpauth://totp/x?secret=JBSWY3DPEHPK3PXP&digits=11", &t) != 0, "dígitos fuera de rango");- check(totp_parse("otpauth://totp/x?issuer=sin-secreto", &t) != 0, "sin secreto");- check(totp_parse("no es base32 !!", &t) != 0, "texto inválido");+ check(totp_parse("JBSW Y3DP EHPK 3PXP", &t) == 0 && t.keylen == 10 && !memcmp(t.key, "Hello!\xde\xad\xbe\xef", 10), "bare base32 secret");+ check(totp_parse("otpauth://totp/x?secret=JBSWY3DPEHPK3PXP&digits=11", &t) != 0, "digits out of range");+ check(totp_parse("otpauth://totp/x?issuer=sin-secreto", &t) != 0, "no secret");+ check(totp_parse("no es base32 !!", &t) != 0, "invalid text");char enc[64];base32_encode((const uint8_t *)"Hello!\xde\xad\xbe\xef", 10, enc, sizeof enc);- check(!strcmp(enc, "JBSWY3DPEHPK3PXP"), "base32 codificar");+ check(!strcmp(enc, "JBSWY3DPEHPK3PXP"), "base32 encode");}static void test_gen(void) {vg_set_lists(_binary_words_txt_start, (size_t)(_binary_words_txt_end - _binary_words_txt_start),_binary_common_txt_start, (size_t)(_binary_common_txt_end - _binary_common_txt_start));- check(vg_word_count() == 7776, "7776 palabras de la EFF");+ check(vg_word_count() == 7776, "7776 EFF words");VGenOpts o = { .length = 24, .upper = 1, .lower = 1, .digits = 1, .symbols = 1, .no_ambiguous = 1 };char pw[256];double bits;@@ -367,45 +367,45 @@ static void test_gen(void) {vg_generate(&o, pw, sizeof pw, &bits);if (strlen(pw) != 24 || !strpbrk(pw, "ABCDEFGHJKLMNPQRSTUVWXYZ") || !strpbrk(pw, "abcdefghijkmnpqrstuvwxyz") || !strpbrk(pw, "23456789") || strpbrk(pw, "Il1O0o|")) ok = 0;}- check(ok, "contraseña: largo, clases y sin ambiguos");- check(vg_strength(pw, &bits) >= 3, "la generada es fuerte");+ check(ok, "password: length, classes and no ambiguous characters");+ check(vg_strength(pw, &bits) >= 3, "the generated one is strong");VGenOpts p = { .words = 6, .capitalize = 1, .add_digit = 1 };snprintf(p.sep, sizeof p.sep, "-");vg_generate(&p, pw, sizeof pw, &bits);int dashes = 0;for (char *q = pw; *q; q++) dashes += *q == '-';- check(dashes == 5 && bits > 77, "frase de 6 palabras (> 77 bits)");- printf("frase de ejemplo: %d palabras, %.0f bits\n", dashes + 1, bits);- check(vg_strength("password", &bits) == 0 && vg_common_rank("password") > 0, "«password» es común");- check(vg_common_rank("P4ssw0rd!") > 0, "variantes leet también");- check(vg_strength("qwerty123", &bits) == 0, "qwerty123 débil");- check(vg_strength("aaaaaaaaaaaa", &bits) <= 1, "repetida débil");- check(vg_strength("Tr0ub4dour&3-kangaroo-Zebra", &bits) >= 3, "larga y variada fuerte");+ check(dashes == 5 && bits > 77, "6-word passphrase (> 77 bits)");+ printf("sample passphrase: %d words, %.0f bits\n", dashes + 1, bits);+ check(vg_strength("password", &bits) == 0 && vg_common_rank("password") > 0, "«password» is common");+ check(vg_common_rank("P4ssw0rd!") > 0, "leet variants too");+ check(vg_strength("qwerty123", &bits) == 0, "qwerty123 weak");+ check(vg_strength("aaaaaaaaaaaa", &bits) <= 1, "repeated is weak");+ check(vg_strength("Tr0ub4dour&3-kangaroo-Zebra", &bits) >= 3, "long and varied is strong");}static void test_json(void) {Vj j;const char *s = "{\"a\":[1,2,{\"b\":\"x\\u00e9\\ud83d\\ude00\\n\"}],\"c\":true,\"d\":null,\"e\":-1.5e2}";- check(vj_parse(&j, s, strlen(s)) == 0, "JSON válido");+ check(vj_parse(&j, s, strlen(s)) == 0, "valid JSON");int a = vj_get(&j, 0, "a");- check(vj_type(&j, a) == VJ_ARR && j.t[a].count == 3, "arreglo");+ check(vj_type(&j, a) == VJ_ARR && j.t[a].count == 3, "array");char *b = vj_gets(&j, vj_at(&j, a, 2), "b");- check(b && !strcmp(b, "x\xc3\xa9\xf0\x9f\x98\x80\n"), "escapes y pares sustitutos");+ check(b && !strcmp(b, "x\xc3\xa9\xf0\x9f\x98\x80\n"), "escapes and surrogate pairs");sm_free(b);- check(vj_getb(&j, 0, "c", 0) == 1 && vj_getn(&j, 0, "e", 0) == -150, "bool y número");+ check(vj_getb(&j, 0, "c", 0) == 1 && vj_getn(&j, 0, "e", 0) == -150, "bool and number");vj_free(&j);const char *bad[] = { "{", "{\"a\":}", "[1,]", "{\"a\" 1}", "\"\\x\"", "01", "[1] 2", "{\"a\":\"\x01\"}", "nul", "[\"\\ud800\"", NULL };int ok = 1;- for (int i = 0; bad[i]; i++) if (vj_parse(&j, bad[i], strlen(bad[i])) == 0) { ok = 0; printf("aceptó: %s\n", bad[i]); vj_free(&j); }- check(ok, "JSON inválido se rechaza");+ for (int i = 0; bad[i]; i++) if (vj_parse(&j, bad[i], strlen(bad[i])) == 0) { ok = 0; printf("accepted: %s\n", bad[i]); vj_free(&j); }+ check(ok, "invalid JSON is rejected");char deep[200];memset(deep, '[', 100);memset(deep + 100, ']', 100);- check(vj_parse(&j, deep, 200) != 0, "profundidad máxima");+ check(vj_parse(&j, deep, 200) != 0, "maximum depth");VjB w;vb_init(&w);vb_open(&w, '{'); vb_ks(&w, "t", "a\"b\\c\x01\xff"); vb_ki(&w, "n", 3); vb_close(&w, '}');- check(w.p && !strcmp(w.p, "{\"t\":\"a\\\"b\\\\c\\u0001\xef\xbf\xbd\",\"n\":3}"), "escritor con escapes y UTF-8 inválido");+ check(w.p && !strcmp(w.p, "{\"t\":\"a\\\"b\\\\c\\u0001\xef\xbf\xbd\",\"n\":3}"), "writer with escapes and invalid UTF-8");vb_free(&w);size_t n;uint8_t *dec = b64_decode("aGVsbG8gd29ybGQ=", 16, &n);@@ -424,8 +424,8 @@ static void test_wire(void) {if (pipe(p)) return;if (fork() == 0) { vw_send(sv[0], VW_REQ, 77, msg, big, &p[1], 1); _exit(0); }VMsg m;- check(vw_recv(sv[1], &m, &vw_malloc) == 0 && m.id == 77 && m.len == big && !memcmp(m.json, msg, big) && m.nfds == 1, "mensaje de 300 KB en pedazos + fd");- if (m.nfds == 1) { check(write(m.fds[0], "x", 1) == 1, "el fd recibido sirve"); }+ check(vw_recv(sv[1], &m, &vw_malloc) == 0 && m.id == 77 && m.len == big && !memcmp(m.json, msg, big) && m.nfds == 1, "300 KB message in chunks + fd");+ if (m.nfds == 1) { check(write(m.fds[0], "x", 1) == 1, "the received fd works"); }vw_msg_free(&m, &vw_malloc);free(msg);close(sv[0]); close(sv[1]); close(p[0]); close(p[1]);@@ -441,8 +441,8 @@ static void test_timing(void) {t0 = now_ms();vf_argon2id((const uint8_t *)"contraseña", 11, salt, &k, out);double t = now_ms() - t0;- printf("Argon2id calibrado: m=%u MiB t=%u (calibrar %.0f ms) → desbloquear %.0f ms (estimado %d)\n", k.m_kib / 1024, k.t_cost, tc, t, est);- check(t > 250 && t < 2000, "desbloqueo en el rango (0,25–2 s)");+ printf("Argon2id calibrated: m=%u MiB t=%u (calibration %.0f ms) → unlock %.0f ms (estimated %d)\n", k.m_kib / 1024, k.t_cost, tc, t, est);+ check(t > 250 && t < 2000, "unlock within range (0.25–2 s)");}int main(void) {diff --git a/server/tests/vcrypto_test.c b/server/tests/vcrypto_test.cindex b237c19..65f98bc 100644--- a/server/tests/vcrypto_test.c+++ b/server/tests/vcrypto_test.c@@ -1,6 +1,6 @@-/* vcrypto_test.c — primitivas propias de la bóveda contra los vectores oficiales:- * AES (FIPS-197 apéndice C, SP 800-38A F.2 CBC), SHA-1 (FIPS 180), HMAC-SHA1 (RFC 2202),- * HMAC-SHA256/512 (RFC 4231), HKDF-SHA256 (RFC 5869) y la arena de secretos (smem). */+/* vcrypto_test.c — the vault's own primitives against the official vectors:+ * AES (FIPS-197 appendix C, SP 800-38A F.2 CBC), SHA-1 (FIPS 180), HMAC-SHA1 (RFC 2202),+ * HMAC-SHA256/512 (RFC 4231), HKDF-SHA256 (RFC 5869) and the secrets arena (smem). */#include "vault/vcrypto.h"#include "vault/smem.h"#include "pkg/crypto.h"@@ -10,7 +10,7 @@#include <string.h>static int fails, total;-static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FALLA: %s\n", what); } }+static void check(int ok, const char *what) { total++; if (!ok) { fails++; printf("FAIL: %s\n", what); } }static void unhex(const char *h, uint8_t *out, size_t *n) {size_t k = 0;@@ -36,9 +36,9 @@ int main(void) {unhex(pt, in, &il);aes_init(&a, key, fv[i].bits);aes_encrypt(&a, in, out);- check(eqhex(out, 16, fv[i].ct), "AES cifrar (FIPS-197)");+ check(eqhex(out, 16, fv[i].ct), "AES encrypt (FIPS-197)");aes_decrypt(&a, out, out);- check(!memcmp(out, in, 16), "AES descifrar (FIPS-197)");+ check(!memcmp(out, in, 16), "AES decrypt (FIPS-197)");}/* SP 800-38A F.2.5 CBC-AES256 */{@@ -51,14 +51,14 @@ int main(void) {check(eqhex(out, il, "f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b"), "AES-256-CBC (SP 800-38A)");unhex("000102030405060708090a0b0c0d0e0f", iv, NULL);aes_cbc_decrypt(&a, iv, out, out, il);- check(!memcmp(out, in, il), "AES-256-CBC descifrar");+ check(!memcmp(out, in, il), "AES-256-CBC decrypt");}{uint8_t p[32] = { 0 };memset(p + 20, 12, 12);- check(pkcs7_unpad(p, 32) == 20, "PKCS#7 válido");+ check(pkcs7_unpad(p, 32) == 20, "PKCS#7 valid");p[25] = 11;- check(pkcs7_unpad(p, 32) == -1, "PKCS#7 inválido");+ check(pkcs7_unpad(p, 32) == -1, "PKCS#7 invalid");}/* SHA-1 */@@ -74,29 +74,29 @@ int main(void) {memset(a, 'a', sizeof a);for (int i = 0; i < 1000; i++) sha1_update(&s, a, sizeof a);sha1_final(&s, h);- check(eqhex(h, 20, "34aa973cd4c4daa4f61eeb2bdbad27316534016f"), "SHA-1 millón de a");+ check(eqhex(h, 20, "34aa973cd4c4daa4f61eeb2bdbad27316534016f"), "SHA-1 million a's");}- /* RFC 2202 HMAC-SHA1 casos 1, 2, 6 */+ /* RFC 2202 HMAC-SHA1 cases 1, 2, 6 */memset(key, 0x0b, 20);hmac_sha1(key, 20, (const uint8_t *)"Hi There", 8, h);- check(eqhex(h, 20, "b617318655057264e28bc0b6fb378c8ef146be00"), "HMAC-SHA1 caso 1");+ check(eqhex(h, 20, "b617318655057264e28bc0b6fb378c8ef146be00"), "HMAC-SHA1 case 1");hmac_sha1((const uint8_t *)"Jefe", 4, (const uint8_t *)"what do ya want for nothing?", 28, h);- check(eqhex(h, 20, "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79"), "HMAC-SHA1 caso 2");+ check(eqhex(h, 20, "effcdf6ae5eb2fa2d27416d5f184df9c259a7c79"), "HMAC-SHA1 case 2");{uint8_t k80[80];memset(k80, 0xaa, 80);hmac_sha1(k80, 80, (const uint8_t *)"Test Using Larger Than Block-Size Key - Hash Key First", 54, h);- check(eqhex(h, 20, "aa4ae5e15272d00e95705637ce8a3b55ed402112"), "HMAC-SHA1 caso 6");+ check(eqhex(h, 20, "aa4ae5e15272d00e95705637ce8a3b55ed402112"), "HMAC-SHA1 case 6");}- /* RFC 4231 casos 1 y 2 */+ /* RFC 4231 cases 1 and 2 */memset(key, 0x0b, 20);hmac_sha256(key, 20, (const uint8_t *)"Hi There", 8, h);- check(eqhex(h, 32, "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7"), "HMAC-SHA256 caso 1");+ check(eqhex(h, 32, "b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7"), "HMAC-SHA256 case 1");hmac_sha256((const uint8_t *)"Jefe", 4, (const uint8_t *)"what do ya want for nothing?", 28, h);- check(eqhex(h, 32, "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843"), "HMAC-SHA256 caso 2");+ check(eqhex(h, 32, "5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843"), "HMAC-SHA256 case 2");hmac_sha512(key, 20, (const uint8_t *)"Hi There", 8, h);- check(eqhex(h, 64, "87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854"), "HMAC-SHA512 caso 1");+ check(eqhex(h, 64, "87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854"), "HMAC-SHA512 case 1");/* RFC 5869 A.1 */{uint8_t ikm[22], salt[13], info[10], okm[42];@@ -105,36 +105,36 @@ int main(void) {unhex("f0f1f2f3f4f5f6f7f8f9", info, NULL);hkdf_sha256(salt, 13, ikm, 22, info, 10, okm, 42);check(eqhex(okm, 42, "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865"), "HKDF-SHA256 A.1");- /* A.3: sin salt ni info */+ /* A.3: no salt or info */hkdf_sha256(NULL, 0, ikm, 22, NULL, 0, okm, 42);check(eqhex(okm, 42, "8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8"), "HKDF-SHA256 A.3");}- /* arena de secretos */+ /* secrets arena */{sm_harden_process();char *p[2000];for (int i = 0; i < 2000; i++) { p[i] = sm_alloc((size_t)(i % 300) + 1); if (p[i]) memset(p[i], 'x', (size_t)(i % 300) + 1); }int ok = 1;for (int i = 0; i < 2000; i++) if (!p[i]) ok = 0;- check(ok, "smem: 2000 bloques");+ check(ok, "smem: 2000 blocks");for (int i = 0; i < 2000; i += 2) sm_free(p[i]);char *q = sm_alloc(40);int zero = 1;for (int i = 0; i < 40; i++) if (q[i]) zero = 0;- check(zero, "smem: reusado y en cero");+ check(zero, "smem: reused and zeroed");char *big = sm_alloc(3 << 20);- check(big && sm_size(big) >= (3u << 20), "smem: bloque grande");+ check(big && sm_size(big) >= (3u << 20), "smem: large block");big = sm_realloc(big, 5 << 20);- check(big != NULL, "smem: realloc grande");+ check(big != NULL, "smem: large realloc");SmStats st;sm_stats(&st);- printf("smem: en uso %zu KB, mapeado %zu KB, con mlock %zu KB (%s)\n", st.in_use / 1024, st.mapped / 1024, st.locked / 1024, st.all_locked ? "todo" : "parcial");+ printf("smem: in use %zu KB, mapped %zu KB, mlocked %zu KB (%s)\n", st.in_use / 1024, st.mapped / 1024, st.locked / 1024, st.all_locked ? "all" : "partial");sm_wipe_all();sm_stats(&st);- check(st.in_use == 0 && st.mapped == 0, "smem: borrar todo");+ check(st.in_use == 0 && st.mapped == 0, "smem: wipe all");char *r = sm_strdup("después de borrar");- check(r && !strcmp(r, "después de borrar"), "smem: sigue andando");+ check(r && !strcmp(r, "después de borrar"), "smem: still works");sm_free(r);}diff --git a/third_party/monocypher/README b/third_party/monocypher/READMEindex 576c626..1715f23 100644--- a/third_party/monocypher/README+++ b/third_party/monocypher/README@@ -2,7 +2,7 @@ Monocypher 4.0.2 — https://monocypher.orgFuente: https://monocypher.org/download/monocypher-4.0.2.tar.gzSHA-256 del tar.gz: 38d07179738c0c90677dba3ceb7a7b8496bcfea758ba1a53e803fed30ae0879cLicencia: CC0-1.0 o BSD-2-Clause, a elección (LICENCE.md). Aprobado por el usuario para la bóveda-de Contraseñas (docs/CONTRASENAS.md).+de Contraseñas (docs/PASSWORDS.md).Archivos copiados sin cambios:src/monocypher.c, src/monocypher.h -> monocypher.c, monocypher.hdiff --git a/third_party/wordlists/README b/third_party/wordlists/READMEindex 02c4cc9..57b0206 100644--- a/third_party/wordlists/README+++ b/third_party/wordlists/README@@ -1,4 +1,4 @@-Listas de palabras para Contraseñas (docs/CONTRASENAS.md). Van embebidas en lord-vault.+Listas de palabras para Contraseñas (docs/PASSWORDS.md). Van embebidas en lord-vault.eff_large_wordlist.txtEFF Large Wordlist for Passphrases (7776 palabras, solo la columna de palabras).