What changed, and why it matters
This commit is mostly a routine test-and-version update. It adds tests for network IPv6 fallback and for PIN-unreadable error handling, bumps app versions, raises the minimum macOS version, and switches two dependencies from local paths to Git references. The only functional code change is a single commented-out error-reporting line in the authentication view model, which stops sending a crash report when the device's stored PIN cannot be read. There is no direct evidence in the commit that this fixes an active security vulnerability.
Treat as a low-signal maintenance commit. Review why error reporting for unreadable PINs was disabled, ensure it was intentional and does not hide keychain integrity issues. Verify the new Git-pinned dependency refs match expected upstream revisions and include no unexpected changes. No urgent action required.
Security signals we found
Functional code change is limited to suppressing an error-reporting call for PinCodeUnreadableException
New tests verify PIN-unreadable exception handling and keychain-secret-missing logic
Dependency overrides changed from local paths to pinned Git refs (rlz, zkool, monero_c)
No changes to cryptography, key storage, or authentication logic beyond telemetry
Evidence from the diff
The diff is dominated by new/renamed tests and build metadata. The sole non-test source change is in lib/view_model/auth_view_model.dart: the import of exception_handler.dart is removed and the call to ExceptionHandler.onError(…) inside the PinCodeUnreadableException catch block is commented out. This means an unreadable PIN no longer triggers an external error/crash report. The change also removes the stack trace variable from the catch clause. The commit does not alter how the PIN is stored, verified, or how wallet secrets are protected; it only changes telemetry behavior. Dependency overrides for rlz and zkool are moved from local paths to specific Git commits, and monero_c is updated to a newer ref.
Changed components
lib/view_model/auth_view_model.dartcw_core/test/proxy_wrapper_prefer_ipv6_test.darttest/core/auth_pin_unreadable_test.dartpubspec.lock (rlz, zkool, monero_c refs)macos/Podfilemacos/Runner.xcodeproj/project.pbxprojscripts/ios/app_env.shInspect captured patch +274 / −20
### cw_core/test/crypto_amount_format_test.dart
[binary or diff unavailable]
### cw_core/test/proxy_wrapper_prefer_ipv6_test.dart
@@ -0,0 +1,60 @@
+import "dart:io";
+
+import "package:cw_core/utils/proxy_wrapper.dart";
+import "package:cw_core/utils/tor/disabled.dart";
+import "package:flutter_test/flutter_test.dart";
+
+/// Answers every request with the client address the server saw.
+Future<HttpServer> _clientAddressEchoServer(InternetAddress address) async {
+ final server = await HttpServer.bind(address, 0);
+ server.listen((request) async {
+ await request.drain<void>();
+ request.response.write(request.connectionInfo!.remoteAddress.address);
+ await request.response.close();
+ });
+ return server;
+}
+
+void main() {
+ setUpAll(() => CakeTor.instance = CakeTorDisabled());
+
+ test("preferIPv6 falls back to the normal request when IPv6 cannot connect", () async {
+ // IPv4 loopback only: the IPv6 attempt to [::1] is refused, or never starts without IPv6.
+ final server = await _clientAddressEchoServer(InternetAddress.loopbackIPv4);
+ addTearDown(() => server.close(force: true));
+
+ final response = await ProxyWrapper().post(
+ clearnetUri: Uri.parse("http://localhost:${server.port}/"),
+ body: "{}",
+ preferIPv6: true,
+ );
+
+ expect(response.statusCode, 200);
+ expect(response.body, "127.0.0.1");
+ });
+
+ test("preferIPv6 connects over IPv6 when it works", () async {
+ final HttpServer server;
+ try {
+ // Dual-stack: accepts both families and reports which one the client used.
+ server = await _clientAddressEchoServer(InternetAddress.anyIPv6);
+ } on SocketException {
+ return; // No IPv6 on this machine (some CI containers).
+ }
+ addTearDown(() => server.close(force: true));
+ final localhost = await InternetAddress.lookup("localhost", type: InternetAddressType.IPv6)
+ .catchError((Object _) => <InternetAddress>[]);
+ if (!localhost.any((address) => address.address == "::1")) {
+ return;
+ }
+
+ final response = await ProxyWrapper().post(
+ clearnetUri: Uri.parse("http://localhost:${server.port}/"),
+ body: "{}",
+ preferIPv6: true,
+ );
+
+ expect(response.statusCode, 200);
+ expect(response.body, "::1");
+ });
+}
### lib/view_model/auth_view_model.dart
@@ -8,7 +8,6 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/entities/biometric_auth.dart';
import 'package:cake_wallet/store/settings_store.dart';
-import "package:cake_wallet/utils/exception_handler.dart";
part 'auth_view_model.g.dart';
@@ -58,10 +57,10 @@ abstract class AuthViewModelBase with Store {
final bool isSuccessfulAuthenticated;
try {
isSuccessfulAuthenticated = await _authService.authenticate(password);
- } on PinCodeUnreadableException catch (e, s) {
+ } on PinCodeUnreadableException catch (e) {
final status = e.keychainStatus == null ? "" : " (OSStatus ${e.keychainStatus})";
state = FailureState("${S.current.auth_store_pin_unreadable}$status");
- unawaited(ExceptionHandler.onError(FlutterErrorDetails(exception: e, stack: s)));
+ // unawaited(ExceptionHandler.onError(FlutterErrorDetails(exception: e, stack: s)));
return;
}
### macos/Podfile
@@ -1,4 +1,4 @@
-platform :osx, '12.0'
+platform :osx, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -38,7 +38,7 @@ post_install do |installer|
flutter_additional_macos_build_settings(target)
target.build_configurations.each do |config|
- config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '12.0'
+ config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '13.0'
end
end
### macos/Runner.xcodeproj/project.pbxproj
@@ -462,7 +462,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MACOSX_DEPLOYMENT_TARGET = 12;
+ MACOSX_DEPLOYMENT_TARGET = 13;
MARKETING_VERSION = 1.0.1;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
@@ -597,7 +597,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MACOSX_DEPLOYMENT_TARGET = 12;
+ MACOSX_DEPLOYMENT_TARGET = 13;
MARKETING_VERSION = 1.0.1;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -626,7 +626,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
- MACOSX_DEPLOYMENT_TARGET = 12;
+ MACOSX_DEPLOYMENT_TARGET = 13;
MARKETING_VERSION = 1.0.1;
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 5.0;
### pubspec.lock
@@ -2050,8 +2050,8 @@ packages:
dependency: "direct overridden"
description:
path: "impls/monero.dart"
- ref: cd4fe366cc8d3c188c91de279f43b29c0e044b15
- resolved-ref: cd4fe366cc8d3c188c91de279f43b29c0e044b15
+ ref: "33671871de3d51696b66ffb3bd94f744e26974f6"
+ resolved-ref: "33671871de3d51696b66ffb3bd94f744e26974f6"
url: "https://github.com/mrcyjanek/monero_c.git"
source: git
version: "0.0.0"
@@ -2626,9 +2626,11 @@ packages:
rlz:
dependency: "direct overridden"
description:
- path: "../zkool2/rust_builder"
- relative: true
- source: path
+ path: rust_builder
+ ref: b56be32eca373e5ddd0ef703614d4f81cba403f7
+ resolved-ref: b56be32eca373e5ddd0ef703614d4f81cba403f7
+ url: "https://github.com/cake-tech/zkool2.git"
+ source: git
version: "0.0.1"
rxdart:
dependency: "direct main"
@@ -3482,9 +3484,11 @@ packages:
zkool:
dependency: "direct overridden"
description:
- path: "../zkool2"
- relative: true
- source: path
+ path: "."
+ ref: b56be32eca373e5ddd0ef703614d4f81cba403f7
+ resolved-ref: b56be32eca373e5ddd0ef703614d4f81cba403f7
+ url: "https://github.com/cake-tech/zkool2.git"
+ source: git
version: "6.31.0"
sdks:
dart: ">=3.9.0 <4.0.0"
### scripts/ios/app_env.sh
@@ -12,13 +12,13 @@ TYPES=($MONERO_COM $CAKEWALLET)
APP_IOS_TYPE=$1
MONERO_COM_NAME="Monero.com"
-MONERO_COM_VERSION="6.5.0"
-MONERO_COM_BUILD_NUMBER=178
+MONERO_COM_VERSION="6.5.2"
+MONERO_COM_BUILD_NUMBER=180
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
CAKEWALLET_NAME="Cake Wallet"
-CAKEWALLET_VERSION="6.5.0"
-CAKEWALLET_BUILD_NUMBER=448
+CAKEWALLET_VERSION="6.5.2"
+CAKEWALLET_BUILD_NUMBER=450
CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet"
### test/core/auth_pin_unreadable_test.dart
@@ -0,0 +1,191 @@
+import "package:cake_wallet/core/auth_service.dart";
+import "package:cake_wallet/core/execution_state.dart";
+import "package:cake_wallet/core/reset_service.dart";
+import "package:cake_wallet/core/secure_storage.dart";
+import "package:cake_wallet/entities/biometric_auth.dart";
+import "package:cake_wallet/entities/encrypt.dart";
+import "package:cake_wallet/generated/i18n.dart";
+import "package:cake_wallet/store/app_store.dart";
+import "package:cake_wallet/store/authentication_store.dart";
+import "package:cake_wallet/store/settings_store.dart";
+import "package:cake_wallet/view_model/auth_view_model.dart";
+import "package:flutter_test/flutter_test.dart";
+import "package:mocktail/mocktail.dart";
+import "package:shared_preferences/shared_preferences.dart";
+
+class _MockSecureStorage extends Mock implements SecureStorage {}
+
+class _MockSettingsStore extends Mock implements SettingsStore {}
+
+class _MockAppStore extends Mock implements AppStore {}
+
+class _MockResetService extends Mock implements ResetService {}
+
+class _MockAuthService extends Mock implements AuthService {}
+
+class _MockBiometricAuth extends Mock implements BiometricAuth {}
+
+const _pinKey = "PIN_CODE_PASSWORD";
+const _duressKey = "DURESS_PIN_CODE_PASSWORD";
+
+void main() {
+ TestWidgetsFlutterBinding.ensureInitialized();
+
+ late SharedPreferences sharedPreferences;
+
+ setUpAll(() {
+ S.current = const S();
+ });
+
+ setUp(() async {
+ SharedPreferences.setMockInitialValues(<String, Object>{});
+ sharedPreferences = await SharedPreferences.getInstance();
+ });
+
+ group("AuthService.authenticate", () {
+ late _MockSecureStorage secureStorage;
+ late AuthService authService;
+
+ setUp(() {
+ secureStorage = _MockSecureStorage();
+ authService = AuthService(
+ secureStorage: secureStorage,
+ sharedPreferences: sharedPreferences,
+ settingsStore: _MockSettingsStore(),
+ authenticationStore: AuthenticationStore(),
+ appStore: _MockAppStore(),
+ resetService: _MockResetService(),
+ walletList: [],
+ );
+ });
+
+ test("throws PinCodeUnreadableException instead of a null-check error", () async {
+ when(() => secureStorage.read(key: _pinKey)).thenAnswer((_) async => null);
+
+ await expectLater(
+ authService.authenticate("1234"),
+ throwsA(
+ isA<PinCodeUnreadableException>()
+ // Not iOS here, so no Keychain status is fetched.
+ .having((e) => e.keychainStatus, "keychainStatus", isNull),
+ ),
+ );
+ verifyNever(() => secureStorage.read(key: _duressKey));
+ });
+
+ test("still accepts the right PIN and rejects a wrong one", () async {
+ when(() => secureStorage.read(key: _pinKey))
+ .thenAnswer((_) async => encodedPinCode(pin: "1234"));
+ when(() => secureStorage.read(key: _duressKey)).thenAnswer((_) async => null);
+
+ expect(await authService.authenticate("1234"), isTrue);
+ expect(await authService.authenticate("0000"), isFalse);
+ });
+ });
+
+ group("AuthViewModel.auth", () {
+ late _MockAuthService authService;
+ late AuthViewModel viewModel;
+
+ setUp(() {
+ authService = _MockAuthService();
+ viewModel = AuthViewModel(
+ authService,
+ sharedPreferences,
+ _MockSettingsStore(),
+ _MockBiometricAuth(),
+ );
+ });
+
+ test("leaves the executing state with the unreadable-PIN message and status", () async {
+ when(() => authService.authenticate(any()))
+ .thenAnswer((_) => Future<bool>.error(PinCodeUnreadableException(-25308)));
+
+ await viewModel.auth(password: "1234");
+
+ expect(
+ viewModel.state,
+ isA<FailureState>().having(
+ (s) => s.error,
+ "error",
+ "${S.current.auth_store_pin_unreadable} (OSStatus -25308)",
+ ),
+ );
+ });
+
+ test("omits the status suffix when no status is available", () async {
+ when(() => authService.authenticate(any()))
+ .thenAnswer((_) => Future<bool>.error(PinCodeUnreadableException(null)));
+
+ await viewModel.auth(password: "1234");
+
+ expect(
+ viewModel.state,
+ isA<FailureState>().having((s) => s.error, "error", S.current.auth_store_pin_unreadable),
+ );
+ });
+
+ test("a wrong PIN still reports the incorrect-PIN message", () async {
+ when(() => authService.authenticate(any())).thenAnswer((_) async => false);
+
+ await viewModel.auth(password: "0000");
+
+ expect(
+ viewModel.state,
+ isA<FailureState>()
+ .having((s) => s.error, "error", S.current.auth_store_incorrect_password),
+ );
+ });
+ });
+
+ group("keychainSecretsMissing", () {
+ const notFound = -25300;
+ const mainKey = "MONERO_WALLET_PASSWORD_MAIN";
+ const savingsKey = "MONERO_WALLET_PASSWORD_SAVINGS";
+
+ Future<bool> check(
+ Map<String, int?> statuses, {
+ Iterable<String> wallets = const ["Main", "Savings"],
+ }) =>
+ keychainSecretsMissing(
+ readStatus: (key) async => statuses[key],
+ walletNames: () async => wallets,
+ );
+
+ test("true only when the PIN and every wallet password are not found", () async {
+ expect(
+ await check({_pinKey: notFound, mainKey: notFound, savingsKey: notFound}),
+ isTrue,
+ );
+ });
+
+ test("false while any wallet password is still on the device", () async {
+ expect(await check({_pinKey: notFound, mainKey: notFound, savingsKey: 0}), isFalse);
+ });
+
+ test("false when the PIN exists, is locked, or has no status (non-iOS)", () async {
+ for (final status in [0, -25308, null]) {
+ expect(
+ await check({_pinKey: status, mainKey: notFound, savingsKey: notFound}),
+ isFalse,
+ );
+ }
+ });
+
+ test("false when there are no wallets", () async {
+ expect(await check({_pinKey: notFound}, wallets: const []), isFalse);
+ });
+
+ test("only loads wallet names once the PIN is missing", () async {
+ var loaded = false;
+ await keychainSecretsMissing(
+ readStatus: (_) async => 0,
+ walletNames: () async {
+ loaded = true;
+ return const ["Main"];
+ },
+ );
+ expect(loaded, isFalse);
+ });
+ });
+}Why this scored 26/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.