Cache for Totp on iPhone must survive installs #78

Closed
opened 2026-08-11 21:59:08 +00:00 by hugo · 1 comment
Owner

The cache must residents a place that survives installs, because otherwise users have to go through the rebuild with every release.

The cache must residents a place that survives installs, because otherwise users have to go through the rebuild with every release.
hugo added this to the 04 - iPhone and Apple Watch apps milestone 2026-08-11 21:59:08 +00:00
hugo added the bugcritical labels 2026-08-11 21:59:23 +00:00
hugo changed title from Cache for Toto on iPhone must survive installs to Cache for Totp on iPhone must survive installs 2026-08-12 16:19:10 +00:00
Author
Owner

Implemented in e45ad07.

Root cause and implementation:

  • The TOTP cache already lived in iPhone Application Support and survived installs, but its store identity hashed the absolute app-container vault path. iOS relocates that container during installation, so Rust rejected the surviving cache as belonging to another store.
  • Storage now derives the catalog identity from the canonical vault path relative to the cache directory, preserving store isolation while remaining stable when the complete application container moves. Swift remains presentation-only.
  • Added a regression that creates a real cache, relocates the complete application container, opens the cached page without decryption, and verifies a subsequent discovery is 100% cache hits with zero secret requests.

Verification passed:

  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • cargo test -p ironstorage --test mobile_totp
  • git diff --check
  • Read-only paired-iPhone inspection confirmed config.toml, the vault, and the 76 KB totp-catalog.toml are all in Library/Application Support/ironstorage.
Implemented in e45ad07. Root cause and implementation: - The TOTP cache already lived in iPhone Application Support and survived installs, but its store identity hashed the absolute app-container vault path. iOS relocates that container during installation, so Rust rejected the surviving cache as belonging to another store. - Storage now derives the catalog identity from the canonical vault path relative to the cache directory, preserving store isolation while remaining stable when the complete application container moves. Swift remains presentation-only. - Added a regression that creates a real cache, relocates the complete application container, opens the cached page without decryption, and verifies a subsequent discovery is 100% cache hits with zero secret requests. Verification passed: - cargo fmt --all -- --check - RUSTFLAGS="-D warnings" cargo check --workspace --all-targets - cargo clippy --workspace --all-targets -- -D warnings - cargo test --workspace - cargo test -p ironstorage --test mobile_totp - git diff --check - Read-only paired-iPhone inspection confirmed config.toml, the vault, and the 76 KB totp-catalog.toml are all in Library/Application Support/ironstorage.
hugo closed this issue 2026-08-12 16:42:07 +00:00
Sign in to join this conversation.