Skip to content

[WAL-1183] feat(mobile): Add biometric key-use authorization#1936

Draft
szijpeter wants to merge 4 commits into
mainfrom
feature/wal-1183-biometric-key-authorization
Draft

[WAL-1183] feat(mobile): Add biometric key-use authorization#1936
szijpeter wants to merge 4 commits into
mainfrom
feature/wal-1183-biometric-key-authorization

Conversation

@szijpeter

@szijpeter szijpeter commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Intent

Add opt-in, immutable key-use authorization for newly created mobile wallet signing keys. BiometricCurrentSet requires OS-enforced biometric authorization for every private-key signing operation, binds the key to the current biometric enrollment set, and fails closed when the requested combination cannot be enforced.

This is key-use authorization, not wallet/app unlock. It does not rotate or reclassify existing keys.

What changed

  • Added algorithm-neutral None and BiometricCurrentSet policy contracts, localized prompt configuration, stable protected-key failures, and capability/backing metadata.
  • Wired the policy through the existing Signum-backed AndroidKey and IosKey implementations using biometric-only, auth-per-use protection with a zero timeout and current-set enrollment binding.
  • Extended platform key generation and preflight inputs so unsupported protected requests are rejected before any software or unprotected fallback can be created.
  • Persisted requested/effective per-key policy and effective hardware backing, including a migration that classifies existing rows as None without inventing backing metadata.
  • Revalidated protected keys on reload, made custom stores opt into policy-metadata persistence, and resolved Android prompt hosts without retaining stale activities.
  • Added Kotlin and Swift configuration, capability, key metadata, and failure surfaces while retaining legacy generator behavior for None only.
  • Updated Kotlin/Swift documentation and added focused migration, persistence, capability, failure-mapping, bridge, and operator-driven mobile coverage.

Supported combinations

Platform None BiometricCurrentSet
Android Existing mobile provider behavior: P-256/P-384/P-521/RSA in Android Keystore; Ed25519/secp256k1 software fallback P-256 only, with an interactive FragmentActivity and enrolled BIOMETRIC_STRONG; Android Keystore auth-per-use and current-set invalidation
iOS Existing mobile provider behavior: P-256/P-384/P-521/RSA in Keychain/Secure Enclave where configured; Ed25519/secp256k1 software fallback P-256 only on a qualifying physical device, backed by Secure Enclave with biometric-current-set private-key use

Other protected key-type combinations return an explicit unsupported result and never fall back to software storage. RSA3072 and RSA4096 remain outside the current mobile provider's existing algorithm support.

Compatibility and caveats

  • None remains the default. Existing configuration and legacy (KeyType) -> Key generators retain their unprotected behavior; legacy generators are not interpreted as supporting protected requests.
  • Existing database rows migrate to None, and changing a wallet default affects future keys only. Existing keys are neither replaced nor reclassified.
  • The operating system owns the biometric UI. Prompt reason and cancellation text are host-configurable and passed through Signum.
  • The pinned Signum version may collapse cancellation, lockout, and related prompt failures into one structured AuthorizationFailed outcome; exception messages and numeric codes are not parsed.
  • Android hardware backing is reported only from effective platform key information; no StrongBox preference is presented as proof of StrongBox use.
  • Physical iOS Secure Enclave/Face ID/Touch ID signing could not be exercised in the available environment. The Android operator-driven success/cancel prompt cases were exercised on an enrolled API 37 emulator; a physical-iOS device run remains required before removing this draft caveat.

Explicit non-goals

Wallet launch/PIN handling, app unlock, action-scoped or batch authorization, existing-key rotation/migration (WAL-749/WAL-999), remote/HSM signing (WAL-998), wallet/key attestation (WAL-1060), and the broader typed-error redesign (WAL-1066) remain out of scope.

The use of platform biometrics, Keystore, Keychain, or Secure Enclave does not establish WSCD, LoA High, ISO 18045, EUDI, or HAIP certification.

Breaking changes

Existing None source call sites remain compatible through defaults and overloads. The KMP binary ABI changes through expanded configuration, metadata, and store-capability surfaces, so precompiled consumers must rebuild against the updated artifacts. Swift callers with exhaustive switches over WalletError must handle the new .keyUseAuthorization case.

@linear-code

linear-code Bot commented Jul 20, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ea8f4d4-d5e0-493d-a636-0d44d075fb5e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@szijpeter szijpeter self-assigned this Jul 20, 2026
@szijpeter szijpeter added the ci:mobile Run mobile related CI workflows for this PR label Jul 20, 2026
@szijpeter
szijpeter force-pushed the feature/wal-1183-biometric-key-authorization branch from bf90035 to 8b3b7bc Compare July 21, 2026 10:12
@sonarqubecloud

Copy link
Copy Markdown

@szijpeter
szijpeter changed the base branch from main to chore/credentials-reproducible-install July 21, 2026 10:34
@szijpeter szijpeter changed the title WAL-1183: Add biometric key-use authorization [WAL-1183] feat(mobile): Add biometric key-use authorization Jul 21, 2026
Base automatically changed from chore/credentials-reproducible-install to main July 21, 2026 13:01
@szijpeter
szijpeter force-pushed the feature/wal-1183-biometric-key-authorization branch from 8b3b7bc to afbaa48 Compare July 21, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:mobile Run mobile related CI workflows for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant