Skip to content

tw-pack: read_strict refuses a plain pack when a key is given; scrypt cap 18 - #354

Merged
fylorn merged 1 commit into
feat/sync-backupfrom
feat/pack-strict-read
Oct 19, 2026
Merged

fylorn merged 1 commit into
feat/sync-backupfrom
feat/pack-strict-read

Conversation

@fylorn

@fylorn fylorn commented Oct 19, 2026

Copy link
Copy Markdown
Contributor
  • tw_pack::read_strict(bytes, unseal): the same as read, except that with Unseal::Passphrase or Unseal::Identity a pack that is not encrypted is refused with PackError::NotEncrypted (pack.not_encrypted). read keeps accepting either, which is what importing a file the user picked needs. Sync should read versions with read_strict when the location is encrypted.
  • The largest scrypt work factor a pack may ask for drops from 22 (about 4 GiB of memory) to 18, the factor packs are written with and the sync keyring's cap.

Local runs: cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, cargo test -p tw-pack, cargo test -p tw-sync, message code manifest.

🤖 Generated with Claude Code

… cap 18

- read_strict(bytes, unseal): with a passphrase or an identity, a pack
  that is not encrypted is refused (pack.not_encrypted). For a sync
  location with encryption on, where accepting a plain version would let
  anyone who can write there change this device's configuration.
- The largest scrypt work factor a pack may ask for is now the one packs
  are written with (18), like the sync keyring; 22 meant about 4 GiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit db4af14 into feat/sync-backup Oct 19, 2026
6 checks passed
@fylorn
fylorn deleted the feat/pack-strict-read branch October 19, 2026 06:50
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant