Skip to content

fix(ios): preserve query scope and validate credential replacement - #807

Open
OskarEichler wants to merge 1 commit into
oblador:masterfrom
OskarEichler:codex/keychain-ios-storage
Open

OskarEichler wants to merge 1 commit into
oblador:masterfrom
OskarEichler:codex/keychain-ios-storage

Conversation

@OskarEichler

@OskarEichler OskarEichler commented Aug 28, 2026 •

Copy link
Copy Markdown

Fixes and observable changes

  • Deletion failures now propagate: if Keystore key deletion fails, reset must reject before discarding the stored ciphertext instead of reporting success and silently dropping the preferences entry.
  • Publish the lazily cached Keystore safely with @Volatile for its existing double-checked initialization.
  • Remove the global monitor around an already-thread-local Cipher cache. Cipher instances remain isolated per thread.
  • Decode the decrypted byte array directly, removing the intermediate plaintext output stream and copies.
  • Collect aliases in one pass without an intermediate list.

Verification

  • Fifteen actual-method JVM checks pass: failing/successful key deletion, alias values, AES-GCM/AES-CBC round trips (empty, Unicode, and 64 KiB), and GCM tampered-tag rejection. Deletion-error propagation failed on the baseline.
  • Thread checks verify same-thread reuse, cross-thread isolation, clear/recreation, and lookup while another thread holds the cache object's monitor.
  • Cipher method checks pass with this patch alone over 6be201b.
  • Combined Android Debug builds pass for both architectures; whitespace checks pass. Real cryptographic primitives were used, with a controlled Keystore implementation for error injection. This is not Android hardware-backed-key certification or an app-wide speed benchmark.

No algorithm, IV/tag encoding, key generation, authentication policy, or public JS API change. Checked-in tests are unchanged.

Consumer integration

  • The combined runtime fixes are backported onto released 10.0.0 at immutable artifact dbd32b5, preserving its bridge/error-code and StrongBox policies. Example/tooling-only changes are not shipped in that runtime artifact.
  • On RN 0.87.1, immutable install, lint, both Android Debug products, both unsigned iOS Simulator Debug products, all four production Metro bundles, 13 web targets and four browser extensions pass. All installed package files were verified against the artifact. These are combined-backport integration results, not independent device validation of this PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant