Problem
The SecureStorage trait (keep-mobile/src/storage.rs) is #[uniffi::export(with_foreign)], so mobile platforms provide the implementation. The Rust core trusts that implementation to preserve integrity: there is no Rust-side integrity check (MAC/HMAC) over stored blobs. A buggy or compromised foreign implementation could return different data than was stored, silently corrupt FROST share material, or fail to protect it, and the Rust core would not detect it.
Mitigating context
The Android implementation is Keystore-backed AES-GCM (AEAD), so stored data already has authenticated-encryption integrity at the platform layer. This is therefore defense-in-depth against a broken/compromised foreign impl, not a plaintext-integrity gap today.
Design decision needed
- Where the integrity key lives — it must be in a separate keystore slot; if it lives in the same
SecureStorage, a compromised store compromises it too.
- Format + migration — adding a Rust-side MAC changes the stored blob format and requires migrating existing FROST share blobs. This is highly security-critical (a bug risks bricking access to shares), so it needs a versioned, backward-compatible migration.
- Whether it is worth it over the platform AEAD already present.
Acceptance criteria
- Rust core verifies an integrity tag over stored share material on load, keyed independently of the foreign store.
- Backward-compatible with existing blobs (no data loss on upgrade).
Problem
The
SecureStoragetrait (keep-mobile/src/storage.rs) is#[uniffi::export(with_foreign)], so mobile platforms provide the implementation. The Rust core trusts that implementation to preserve integrity: there is no Rust-side integrity check (MAC/HMAC) over stored blobs. A buggy or compromised foreign implementation could return different data than was stored, silently corrupt FROST share material, or fail to protect it, and the Rust core would not detect it.Mitigating context
The Android implementation is Keystore-backed AES-GCM (AEAD), so stored data already has authenticated-encryption integrity at the platform layer. This is therefore defense-in-depth against a broken/compromised foreign impl, not a plaintext-integrity gap today.
Design decision needed
SecureStorage, a compromised store compromises it too.Acceptance criteria