What changed, and why it matters
This commit is a small cleanup in a Dart utility file that decides how the wallet handles passwords on different platforms. Previously, the app hard-coded that Linux and Windows require the user to type the wallet password, while Android, iOS, and macOS stored a generated password in the device's secure keystore. The change makes these decisions dynamic by reading a single flag from the shared wallet infrastructure package instead. This reduces the chance that the user interface and the wallet core disagree about how the password is managed. There is no direct evidence in the commit of a security vulnerability being fixed; it reads as a consistency and maintainability improvement.
Treat as a maintainability and defense-in-depth change rather than an urgent security patch. Reviewers should verify that WalletSecrets.holdsWalletPassword returns the expected values on Linux, Windows, macOS, Android, and iOS, and that no other callers still rely on the old hard-coded Platform.isLinux || Platform.isWindows semantics. If a security issue motivated this change, the project should publish an advisory or issue reference.
Security signals we found
Centralizes platform password-storage policy in a single source of truth
Removes hard-coded platform list for password behavior
Potential for logic inversion risk if WalletSecrets.holdsWalletPassword semantics differ from the old Platform.isLinux || Platform.isWindows check
Evidence from the diff
In lib/util/platform.dart, two compile-time constants (typesWalletPassword and usesDeviceLock) are converted to getters that delegate to WalletSecrets.holdsWalletPassword from package:wallet_infra. The logic is inverted: typesWalletPassword is now true when the platform does NOT hold the wallet password in the keystore, and usesDeviceLock is true when it does. The change centralizes platform-specific password-handling policy in one place, preventing skew between the UI layer and wallet-core. The diff does not show any new validation, input handling, cryptographic operation, or access-control change.
Changed components
lib/util/platform.dartpackage:wallet_infra WalletSecrets.holdsWalletPasswordWallet password entry flowDevice lock / biometrics gating flowInspect captured patch +6 / −4
### lib/util/platform.dart
@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:wallet_ui/wallet_ui.dart' show isDesktopLayout;
+import 'package:wallet_infra/wallet_infra.dart' show WalletSecrets;
/// True when the app shows its desktop layout: on Linux/Windows/macOS, and for
/// the iOS build running on a Mac (see [isDesktopLayout]). Layout only.
@@ -15,14 +16,15 @@ bool get isDesktop => isDesktopLayout;
final bool isDesktopOS = Platform.isLinux || Platform.isWindows || Platform.isMacOS;
/// True where the user types the wallet password at every launch: Linux and
-/// Windows. Elsewhere it is generated at onboarding and kept in the keystore
-/// (wallet_infra's `WalletSecrets.holdsWalletPassword`).
-final bool typesWalletPassword = Platform.isLinux || Platform.isWindows;
+/// Windows. Elsewhere it is generated at onboarding and kept in the keystore.
+/// Read from wallet_infra's [WalletSecrets.holdsWalletPassword], the one
+/// platform switch, so the app and wallet-core cannot disagree.
+bool get typesWalletPassword => !WalletSecrets.holdsWalletPassword;
/// True where App Lock (the device's own prompt: biometrics or the device
/// passcode, Touch ID or the Mac's password on macOS) guards that generated
/// password: Android, iOS and macOS.
-final bool usesDeviceLock = !typesWalletPassword;
+bool get usesDeviceLock => WalletSecrets.holdsWalletPassword;
/// True on the mobile platforms (Android/iOS), the iOS build on a Mac included.
final bool isMobile = Platform.isAndroid || Platform.isIOS;Why this scored 27/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.