Bitwarden passkeys on import, --totp asks for its secret, padded attachments #17

Merged
backmeupplz merged 9 commits from board/978-e0cd2d into main 2026-11-27 20:20:35 +00:00
Owner

Three small changes from the board ticket #978:

  • Bitwarden passkeys come along on import. The Bitwarden JSON importer now reads login.fido2Credentials into the item's passkeys. It handles credential ids in both of Bitwarden's forms (a UUID, or b64. plus base64url), base64url keys and user handles, and counters given as strings or numbers. Creation dates come along, and so does every other field, in a new Passkey.extra map: rp_name, user_display_name, discoverable and the rest. A credential that can't be read is kept as it was in the item's extra.bitwarden_passkeys, which share links leave out, and plaintext show mentions it. Bitwarden items also keep their creation and revision dates. The test uses a real Bitwarden export with two passkeys (client/tests/fixtures/bitwarden-passkeys.json, from SpecterOps/pass-the-passkey, MIT).
  • --totp asks for the secret. Like --password, it no longer takes a value. You're asked for it, or, when stdin is piped, it reads the line after --password's. An empty or unreadable secret is refused, and --totp SECRET is now a usage error.
  • Attachments are padded. Sealed files are zero-padded: to at least 256 bytes, then with Padmé, which adds at most 12% and never takes a file past the server's 64 MiB. Opening a file cuts it back to FileRef.size, so files uploaded before this change open unchanged, and a size larger than the file is refused. DESIGN.md gives the exact formula and drops the old known limit. docs/s is rebuilt, because the share-link viewer reads Passkey.

The ticket's HSTS item is in server/src/lib.rs, which #12 is rewriting, so it's a separate board ticket (#980) that starts once #12 has merged.

Tests: cargo clippy --locked --all-targets -- -D warnings and cargo test --locked pass locally. New tests: bitwarden_passkeys, totp_is_never_an_argument and attachments_are_padded.

🤖 Generated with Claude Code

Three small changes from the board ticket #978: - **Bitwarden passkeys come along on import.** The Bitwarden JSON importer now reads `login.fido2Credentials` into the item's passkeys. It handles credential ids in both of Bitwarden's forms (a UUID, or `b64.` plus base64url), base64url keys and user handles, and counters given as strings or numbers. Creation dates come along, and so does every other field, in a new `Passkey.extra` map: `rp_name`, `user_display_name`, `discoverable` and the rest. A credential that can't be read is kept as it was in the item's `extra.bitwarden_passkeys`, which share links leave out, and `plaintext show` mentions it. Bitwarden items also keep their creation and revision dates. The test uses a real Bitwarden export with two passkeys (`client/tests/fixtures/bitwarden-passkeys.json`, from SpecterOps/pass-the-passkey, MIT). - **`--totp` asks for the secret.** Like `--password`, it no longer takes a value. You're asked for it, or, when stdin is piped, it reads the line after `--password`'s. An empty or unreadable secret is refused, and `--totp SECRET` is now a usage error. - **Attachments are padded.** Sealed files are zero-padded: to at least 256 bytes, then with Padmé, which adds at most 12% and never takes a file past the server's 64 MiB. Opening a file cuts it back to `FileRef.size`, so files uploaded before this change open unchanged, and a size larger than the file is refused. DESIGN.md gives the exact formula and drops the old known limit. `docs/s` is rebuilt, because the share-link viewer reads `Passkey`. The ticket's HSTS item is in `server/src/lib.rs`, which #12 is rewriting, so it's a separate board ticket (#980) that starts once #12 has merged. Tests: `cargo clippy --locked --all-targets -- -D warnings` and `cargo test --locked` pass locally. New tests: `bitwarden_passkeys`, `totp_is_never_an_argument` and `attachments_are_padded`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Bitwarden passkeys import, --totp asks for its secret, attachments are padded
All checks were successful
CI / wasm (pull_request) Successful in 1m21s
CI / check (pull_request) Successful in 1m29s
111c71e2a3
- The Bitwarden JSON importer reads login.fido2Credentials into the item's
  passkeys (UUID or b64. credential ids, base64url keys and user handles).
  A credential it can't read stays on the item as a concealed field.
- --totp takes no value: it asks, or reads a line from stdin when piped,
  like --password.
- Attachments are zero-padded with Padmé (at least 256 bytes, at most 12%
  bigger, capped at the server's 64 MiB) and cut back to FileRef.size when
  opened, so files uploaded before this still open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep every passkey field, reject an empty --totp, check file sizes strictly
Some checks failed
CI / check (pull_request) Successful in 1m14s
CI / wasm (pull_request) Failing after 1m17s
cf832f21d0
- Passkeys keep their creation date, relying party name, display name and
  discoverable flag; Bitwarden items keep their creation and revision dates.
- A UUID credential id must decode to 16 bytes.
- --totp refuses an empty or unreadable secret instead of clearing the code.
- open_file accepts only a size that matches the file or pads to it, and a
  huge size can't overflow padded_file_len.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuild the viewer, keep all passkey fields, stricter dates
All checks were successful
CI / check (pull_request) Successful in 1m22s
CI / wasm (pull_request) Successful in 1m28s
f6d6559039
- docs/s: rebuilt for the Passkey extra map.
- Passkeys keep every Bitwarden field we don't map (snake_case, discoverable
  as a boolean).
- iso_ms checks ranges and digits, and reads 1-3 digit fractions.
- open_file accepts any size up to the file's length again, so other clients
  may pad differently; a test checks the padding is zeros.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Passkey extras can't shadow named fields; unreadable ones go in extra
Some checks failed
CI / check (pull_request) Has been cancelled
CI / wasm (pull_request) Has been cancelled
912bdce454
- Keys that map to a Passkey field (created, private_key, rp_id, ...) never
  land in extra, so an odd import file can't make an item unreadable.
- Only discoverable becomes a boolean.
- Credentials the importer can't read are kept in the item's
  extra.bitwarden_passkeys, which share links leave out.
- DESIGN and PARITY describe passkey extras and the import.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
show mentions passkeys kept from Bitwarden; link note covers them
All checks were successful
CI / check (pull_request) Successful in 2m38s
CI / wasm (pull_request) Successful in 1m7s
0c010e1a9e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
show says where kept Bitwarden passkeys are
All checks were successful
CI / check (pull_request) Successful in 2m23s
CI / wasm (pull_request) Successful in 2m32s
d540273dc6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An empty --totp answer removes the code; Padmé bound and fixture notice
All checks were successful
CI / check (pull_request) Successful in 1m10s
CI / wasm (pull_request) Successful in 1m15s
d6cd4e6c57
A closed stdin is now an error for every asked secret instead of an
empty value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DESIGN: the Padmé bound is beyond the 256-byte minimum
All checks were successful
CI / wasm (pull_request) Successful in 1m44s
CI / check (pull_request) Successful in 1m44s
89471ac7af
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into board/978-b3a76b
All checks were successful
CI / wasm (pull_request) Successful in 1m37s
CI / check (pull_request) Successful in 2m9s
fb7dc9b9b0
# Conflicts:
#	DESIGN.md
#	docs/s/plaintext_wasm_bg.wasm
backmeupplz deleted branch board/978-e0cd2d 2026-11-27 20:20:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
backmeupplz/plaintext!17
No description provided.