[share] Share links and the browser build: custos-share (blob v1, key in the fragment, optional password), custos-wasm (JSON ABI, no wasm-bindgen), docs/SHARE.md, threat model (v0.3.0)

This commit is contained in:
2026-10-31 18:20:51 +01:00
parent 4aac99fb47
commit 5ee1c0da6b
16 changed files with 1153 additions and 5 deletions
+8
View File
@@ -10,7 +10,10 @@ crates/custos-vault file format, Argon2id + XChaCha20-Poly1305, atomic save, i
crates/custos-gen memorable password, nickname, random, PIN, strict-site generators + wordlists
crates/custos-totp TOTP / HOTP (RFC 6238 / 4226 vectors are tests), otpauth:// parsing
crates/custos-qr QR payload strings (Wi-Fi escaping); rendering is the app's job
crates/custos-share private share links: XChaCha20-Poly1305 blob, key in the URL fragment, optional password
crates/custos-wasm the browser build (web vault + share page): JSON `call` ABI, no wasm-bindgen; js/custos.mjs
docs/FORMAT.md the vault file format (versioned; change it before the code)
docs/SHARE.md the share blob and link format (versioned like FORMAT.md)
docs/THREAT_MODEL.md what is and is not protected
```
@@ -18,7 +21,12 @@ docs/THREAT_MODEL.md what is and is not protected
```
cargo test --workspace # all mandatory tests
cargo test --workspace --release # same, faster Argon2
# the browser build, with the server's toolchain (WSL + Nix here; nixpkgs rev as in the Custos flake):
nix shell nixpkgs#cargo nixpkgs#rustc nixpkgs#stdenv.cc nixpkgs#lld -c \n cargo build --release --target wasm32-unknown-unknown -p custos-wasm
node crates/custos-wasm/js/test.mjs <custos_wasm.wasm> [<vault> <password>] # the JS loader against it
```
- `.cargo/config.toml` selects getrandom's custom backend for wasm32: `random_fill` → `crypto.getRandomValues`.
- WSL: run commands with `wsl -d Debian --exec bash -lc '…'`; plain `wsl -- …` expands `$VARS` too early.
On the dev machine set `CARGO_HOME=F:\C-Drive-Migration\future-caches\cargo` (C: is off limits).
## Rules