[share] Share links and the browser build (v0.3.0) #5
Reference in New Issue
Block a user
Delete Branch "feature/share-wasm"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Day 2 core: private share links and the browser build of the core (v0.3.0).
What
docs/SHARE.md(written first): the link,https://host/s/<id>#k=<key>[&p=1], and the blob format.CSH1, flags, then for password shares Argon2id parameters and a salt, then the nonce and the XChaCha20-Poly1305 ciphertext. The AAD is everything before the ciphertext.custos-share:seal/open.Payload::from_itemleaves out empty fields, the TOTP seed and auto-type settings.Sealedprints its fragment as[redacted]and zeroes it on drop.custos-wasm: the web vault's and the share page's crypto, compiled towasm32-unknown-unknown.callexport plusalloc/dealloc;dealloczeroes memory.random_fill, backed bycrypto.getRandomValuesthrough getrandom's custom backend (.cargo/config.toml).js/custos.mjs(about 50 lines) is the whole JS side.Self-review / tests
cargo test --workspace --release: 54 passed (gen 16, share 11, vault 11, totp 5, qr 5, wasm 4, doctests 2).DecryptFailed,MalformedorPasswordRequired, never garbage. The message holds no secret.p=1removed) and the password alone (with another link key) both fail.env.random_fill.js/test.mjsagainst a real vault with the default KDF:'wasm-unsafe-eval'added.