Build the Rust watchOS core and secure TOTP storage #56

Closed
opened 2026-08-09 20:00:46 +00:00 by hugo · 1 comment
Owner

Goal

Run the Rust OTP/snapshot subset on watchOS and store transferred secrets securely on the Watch.

Scope

  • Extend the Apple build and UniFFI generation for supported ARM64 watchOS device and simulator Rust targets.
  • Feature-gate a minimal crates/storage surface for Watch snapshot validation, secure-store orchestration, TOTP calculation, code timing, and view-ready records; do not clone or open a password-store repository on the Watch.
  • Persist accepted selected-TOTP material through the watchOS Keychain/data-protection adapter using the most restrictive device-only, passcode/unlocked accessibility compatible with offline foreground display.
  • Clear in-memory secrets and mask output when the Watch locks, the app backgrounds/exits as required, the snapshot is revoked, or protected storage becomes unavailable.
  • Keep Apple Security/Keychain FFI isolated and documented; project Rust remains free of unsafe and Swift contains no OTP algorithm or snapshot parser.
  • Add deterministic RFC OTP tests for the watch-enabled Rust build and simulator/device bridge smoke tests.

Acceptance criteria

  • The watchOS target links the Rust core and calculates TOTP codes from an accepted local snapshot while offline.
  • Only the selected subset is stored, and it is inaccessible after device lock according to the chosen Keychain policy.
  • Revocation/replacement removes obsolete secrets and no plaintext secret appears in logs or Swift persistence.
  • The Watch does not contain a Git clone, GPG key, application token, or password-entry implementation.
## Goal Run the Rust OTP/snapshot subset on watchOS and store transferred secrets securely on the Watch. ## Scope - Extend the Apple build and UniFFI generation for supported ARM64 watchOS device and simulator Rust targets. - Feature-gate a minimal `crates/storage` surface for Watch snapshot validation, secure-store orchestration, TOTP calculation, code timing, and view-ready records; do not clone or open a password-store repository on the Watch. - Persist accepted selected-TOTP material through the watchOS Keychain/data-protection adapter using the most restrictive device-only, passcode/unlocked accessibility compatible with offline foreground display. - Clear in-memory secrets and mask output when the Watch locks, the app backgrounds/exits as required, the snapshot is revoked, or protected storage becomes unavailable. - Keep Apple Security/Keychain FFI isolated and documented; project Rust remains free of `unsafe` and Swift contains no OTP algorithm or snapshot parser. - Add deterministic RFC OTP tests for the watch-enabled Rust build and simulator/device bridge smoke tests. ## Acceptance criteria - The watchOS target links the Rust core and calculates TOTP codes from an accepted local snapshot while offline. - Only the selected subset is stored, and it is inaccessible after device lock according to the chosen Keychain policy. - Revocation/replacement removes obsolete secrets and no plaintext secret appears in logs or Swift persistence. - The Watch does not contain a Git clone, GPG key, application token, or password-entry implementation.
hugo added this to the 04 - iPhone and Apple Watch apps milestone 2026-08-09 20:00:46 +00:00
hugo added the enhancement label 2026-08-09 20:00:46 +00:00
hugo added the untested label 2026-08-16 12:27:41 +00:00
Author
Owner

Implemented in df1d493. Added the feature-gated Rust watchOS snapshot/TOTP runtime, a Watch-only UniFFI bridge, strict device-only passcode-protected Keychain persistence, lifecycle secret clearing, and ARM64 watchOS simulator/device build integration. Verified with the required formatting/check/Clippy/workspace-test gates, focused RFC 6238 and snapshot lifecycle tests, and successful ARM64 Debug watchsimulator plus Release watchos target builds. The produced binaries are ARM64. Marked untested because Apple Watch deployment and interactive Watch testing were explicitly skipped.

Implemented in df1d493. Added the feature-gated Rust watchOS snapshot/TOTP runtime, a Watch-only UniFFI bridge, strict device-only passcode-protected Keychain persistence, lifecycle secret clearing, and ARM64 watchOS simulator/device build integration. Verified with the required formatting/check/Clippy/workspace-test gates, focused RFC 6238 and snapshot lifecycle tests, and successful ARM64 Debug watchsimulator plus Release watchos target builds. The produced binaries are ARM64. Marked untested because Apple Watch deployment and interactive Watch testing were explicitly skipped.
hugo closed this issue 2026-08-16 12:27:54 +00:00
Sign in to join this conversation.