FXCM-2279/2280/2282: Secure-fields blob for card numbers, v6 migration, store-owned string crypto - #7576
Open
theidkamp wants to merge 4 commits into
Open
FXCM-2279/2280/2282: Secure-fields blob for card numbers, v6 migration, store-owned string crypto#7576theidkamp wants to merge 4 commits into
theidkamp wants to merge 4 commits into
Conversation
5 tasks
theidkamp
force-pushed
the
fxcm-2280-migration
branch
3 times, most recently
from
September 14, 2026 13:46
00784a9 to
3c5b714
Compare
theidkamp
force-pushed
the
fxcm-2280-migration
branch
10 times, most recently
from
September 18, 2026 13:08
2d1e2e5 to
afc4fce
Compare
Move autofill's credit-card encryption onto the shared db-crypto crate and let AutofillDb own the encryptor, as logins' LoginDb does. The consumer supplies it when building the store, so no key is passed into individual calls or down through the sync layers.
Move encrypting and decrypting a card number into a single struct, so the knowledge of what the stored value looks like lives in one place instead of being spread across the db and sync code. The stored value becomes the serialized struct - a JSON blob with room for a CVV - so a second encrypted field can be added without another format change. New writes use the blob from here on; a bare number written before it still decrypts, and existing rows are rewritten in FXCM-2280.
…v6 schema upgrade
…ned methods The store owns the key, so string crypto becomes a method on it: store.encrypt_string(cleartext) / store.decrypt_string(ciphertext), same stored format as the record paths. The namespace functions that took the key as a parameter are gone - they cannot be served once the key lives in NSS. create_autofill_key() stays for consumers that manage a static key.
theidkamp
force-pushed
the
fxcm-2280-migration
branch
from
September 22, 2026 13:54
afc4fce to
88e764d
Compare
theidkamp
marked this pull request as ready for review
September 22, 2026 13:59
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked on #7542
Stacked on #7573
Description
What
This PR combines three related changes:
FXCM-2279: Centralize card encryption in
SecureCreditCardFieldsSimilar to
SecureLoginFields,SecureCreditCardFieldsnow handles its own serialization and encryption/decryption. Cards are stored as a serialized blob ({"cc_number":"…"}), with optionalcc_cvv.Decryption supports both the new blob and the legacy plain card-number format.
FXCM-2280: Migrate existing card data from v5 → v6
On first DB open, existing card numbers are rewritten to the new blob format on all platforms. The schema version also serves as the format version, so no additional migration flag or metrics are needed.
Scrubbed or unreadable rows are left unchanged, and Sync metadata is untouched, so the migration itself does not trigger uploads.
FXCM-2282: Remove decrypt_string / encrypt_string APIs
Breaking API changes
encrypt_string(key, …)/decrypt_string(key, …)removed. usestore.encrypt_string(…)/store.decrypt_string(…). Old ciphertext stays readable; for canaries usedb_crypto.create_canarycheck_canary(format-compatible). (Android & iOS; Desktop never used these)scrub_undecryptable_credit_card_data_for_remote_replacement()no longer takes the key. (iOS)set_local_encryption_keyis removed from the sync engine. Stop passing the creditcards key in local_encryption_keys before updating. Passing one now panics. (Android & iOS; consumer patches: (WorkManagerSyncManager.kt / RustSyncManager.swift)Important
autofill.db. This intentionally prevents them from interpreting the new blob as a card number and uploading it to Sync. The data remains intact and can be opened again with a v6-capable build.db-crypto.Pull Request checklist
[ci full]to the PR title.