Repository navigation
Conversation
expo-local-authentication cannot pass a CryptoObject, so its generic prompt never authorized the auth-per-use Keystore key: on Android every seal and open failed behind the scenes and the wallet could neither finish onboarding nor unlock. The prompt now lives inside the module: MojitoCore seals and opens through BiometricPrompt with the cipher's own CryptoObject (BIOMETRIC_STRONG, current activity), cancellation and failure map to MOJITO_AUTH_REQUIRED, a biometric re-enrolment kill maps to a distinct MOJITO_KEY_INVALIDATED with restore-from-phrase guidance, and the JS-side generic step-up retry around vault operations is gone. The gate now follows the persisted Secure-screen choice: seal carries a gated flag to key creation (a PIN-only wallet never prompts for vault ops), key creation fails when the activity context is missing instead of silently creating an ungated key, and an existing alias with an unreadable key fails instead of silently regenerating. A new keyGated query exposes the real gate state without prompting.
The Swift facade passed CryptoKit Nonce/Ciphertext/Tag structs where hex() expects Data, so the podspec build broke; wrap them in Data(). keyExists drops kSecReturnData, making the cold-start existence probe an attribute-level query that never fires the Keychain ACL prompt, and the App probe degrades to the locked state on failure instead of wedging the splash. Key creation now keys on the persisted biometrics choice carried by seal, fails closed when SecAccessControlCreateWithFlags returns nil instead of silently creating an ungated key, and open no longer creates a missing key. A cancelled ACL prompt and a failed biometric check now map to separate codes (retryable vs restore-from-phrase).
Every Face ID prompt (enrolment scan, unlock scan and the Keychain ACL prompt that guards the vault key) crashed on FaceID devices because the usage string was absent everywhere. The expo-local-authentication plugin now carries a user-facing sentence, so prebuild writes NSFaceIDUsageDescription into the Info.plist.
The backup reveal effect depended on [backup, ctx], but ctx is a fresh object literal on every Onboarding render: openWords succeeded, set state, re-rendered with a new ctx, and decrypted again, forever. With a gated key every iteration re-ran the OS biometric prompt over the lock screen. The effect now waits for the lock layer to clear, early-returns once the words sit in onboarding state, and depends on stable inputs only; the phrase also leaves onboarding state exactly when the backup layer closes, and the session docstrings say so.
Gating used to key on hardware detection at key creation, so wallets from those builds hold an ungated key while the persisted choice says biometrics. At unlock, when the persisted choice is a real true and the native keyGated query reports no gate, the session seed is re-sealed under a fresh gated key (wipe and save). A failed re-seal surfaces the restore-from-phrase guidance, since the wipe-save window is the cost of upgrading a single key slot. The session keeps the persisted choice distinct from the unlock-UI flag, which folds in hardware detection.
The Storage section described hardware-detection gating and a JS step-up retry, both gone. It now describes the persisted-choice gate, the prompt inside the native module, the two typed failure classes, the upgrade re-seal, and the prompt-free keyExists probe; a new manual-check list covers the gated-vault paths a Node test run cannot reach, including the biometric-change recovery via phrase restore.
Disabling auto-lock or biometrics wrote straight through, so anyone holding the unlocked phone could switch a security control off with one tap. Toggling either control off now opens an in-app PIN confirm against the persisted verifier, using the same verdict and lockout bookkeeping as the unlock screen (extracted into a shared pinEntryCheck). Turning auto-lock off also re-locks the session immediately instead of letting the unlocked session ride on. Enabling a control still needs no step-up.
The unlock screen opened in bio mode whenever biometrics were enabled and its scan never consulted pinStore, so five wrong PINs armed a lockout that the default unlock path simply ignored (only the PIN-to-bio switch was hidden). Bio mode now polls the armed deadline, refuses scan starts while it runs, and shows the same countdown copy as the PIN path.
parseAccountPath dropped the first path token with slice(1) instead of asserting it, so a bare /84'/0'/0' or a typo like n/84'/0'/0' derived as if the master token said m/. Uppercase M passed too. The master token is now asserted before slicing, and the BtcKeyring suite pins the rejections.
The stored wallet meta claimed mainnet while discovery derives testnet addresses, so the meta now names what the derivation actually used, and the fixture probe drops its unreachable mainnet entry. Discovery copy no longer promises a selection UI that does not exist and no longer claims Account 1 has history on the empty branch. The dash-gate script records why vendor/ sits outside the scan (checksum-pinned third-party artifacts), the README says the same, and the dead MlBlobs test-helper export is gone.
The upgrade path alerted and then re-alerted through the unlock catch with the same copy stacked on top. The inner layer now only escalates the typed error; the single alert with the erase option comes from the unlock handler.
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.
Summary
Milestone M1 (keys): real key management under the M0 UI.
Known follow-ups (tracked)