diff --git a/flutter_secure_storage/CHANGELOG.md b/flutter_secure_storage/CHANGELOG.md index 1c18024e..d5e2c9e2 100644 --- a/flutter_secure_storage/CHANGELOG.md +++ b/flutter_secure_storage/CHANGELOG.md @@ -1,3 +1,6 @@ +## 9.2.2 +[iOS, macOS] Fixed an issue which caused the readAll and deleteAll to not work properly. + ## 9.2.1 * Fix async race condition bug in storage operations. * [macOS] Return nil on macOS if key is not found diff --git a/flutter_secure_storage/ios/Classes/FlutterSecureStorage.swift b/flutter_secure_storage/ios/Classes/FlutterSecureStorage.swift index c2310388..14c7bf0e 100644 --- a/flutter_secure_storage/ios/Classes/FlutterSecureStorage.swift +++ b/flutter_secure_storage/ios/Classes/FlutterSecureStorage.swift @@ -78,9 +78,9 @@ class FlutterSecureStorage{ return .failure(OSSecError(status: status)) } } - - internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse { - var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: true, accessControl: nil) + + internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse { + var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: true, accessControl: nil) keychainQuery[kSecMatchLimit] = kSecMatchLimitAll keychainQuery[kSecReturnAttributes] = true @@ -131,9 +131,9 @@ class FlutterSecureStorage{ return FlutterSecureStorageResponse(status: status, value: value) } - - internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse { - let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: nil, accessControl: nil) + + internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse { + let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: nil, accessControl: nil) let status = SecItemDelete(keychainQuery as CFDictionary) if (status == errSecItemNotFound) { diff --git a/flutter_secure_storage/ios/Classes/SwiftFlutterSecureStoragePlugin.swift b/flutter_secure_storage/ios/Classes/SwiftFlutterSecureStoragePlugin.swift index 848e2740..cc4c15ad 100644 --- a/flutter_secure_storage/ios/Classes/SwiftFlutterSecureStoragePlugin.swift +++ b/flutter_secure_storage/ios/Classes/SwiftFlutterSecureStoragePlugin.swift @@ -128,14 +128,14 @@ public class SwiftFlutterSecureStoragePlugin: NSObject, FlutterPlugin, FlutterSt private func deleteAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { let values = parseCall(call) - let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable) + let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility) handleResponse(values.key, response, result) } private func readAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { let values = parseCall(call) - let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable) + let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility) handleResponse(values.key, response, result) } diff --git a/flutter_secure_storage/pubspec.yaml b/flutter_secure_storage/pubspec.yaml index 04f2dbb0..99d161b4 100644 --- a/flutter_secure_storage/pubspec.yaml +++ b/flutter_secure_storage/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_secure_storage description: Flutter Secure Storage provides API to store data in secure storage. Keychain is used in iOS, KeyStore based solution is used in Android. -version: 9.2.1 +version: 9.2.2 repository: https://github.com/mogol/flutter_secure_storage/tree/develop/flutter_secure_storage environment: @@ -32,7 +32,7 @@ dependencies: # validation, so we set a ^ constraint. # https://github.com/flutter/flutter/issues/46264 flutter_secure_storage_linux: ^1.2.1 - flutter_secure_storage_macos: ^3.1.1 + flutter_secure_storage_macos: ^3.1.2 flutter_secure_storage_platform_interface: ^1.1.2 flutter_secure_storage_web: ^1.2.1 flutter_secure_storage_windows: ^3.1.2 diff --git a/flutter_secure_storage_macos/CHANGELOG.md b/flutter_secure_storage_macos/CHANGELOG.md index 3130bb7c..1e96c43b 100644 --- a/flutter_secure_storage_macos/CHANGELOG.md +++ b/flutter_secure_storage_macos/CHANGELOG.md @@ -1,3 +1,6 @@ +## 3.1.2 +Fixed an issue which caused the readAll and deleteAll to not work properly. + ## 3.1.1 Fixed an issue which caused a platform exception when the key does not exists in the keychain. diff --git a/flutter_secure_storage_macos/macos/Classes/FlutterSecureStorage.swift b/flutter_secure_storage_macos/macos/Classes/FlutterSecureStorage.swift index 6f2943d5..e4e429c7 100644 --- a/flutter_secure_storage_macos/macos/Classes/FlutterSecureStorage.swift +++ b/flutter_secure_storage_macos/macos/Classes/FlutterSecureStorage.swift @@ -74,8 +74,8 @@ class FlutterSecureStorage{ } } - internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse { - var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: true) + internal func readAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse { + var keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: true) keychainQuery[kSecMatchLimit] = kSecMatchLimitAll keychainQuery[kSecReturnAttributes] = true @@ -127,8 +127,8 @@ class FlutterSecureStorage{ return FlutterSecureStorageResponse(status: status, value: value) } - internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?) -> FlutterSecureStorageResponse { - let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: nil, returnData: nil) + internal func deleteAll(groupId: String?, accountName: String?, synchronizable: Bool?, accessibility: String?) -> FlutterSecureStorageResponse { + let keychainQuery = baseQuery(key: nil, groupId: groupId, accountName: accountName, synchronizable: synchronizable, accessibility: accessibility, returnData: nil) let status = SecItemDelete(keychainQuery as CFDictionary) if (status == errSecItemNotFound) { diff --git a/flutter_secure_storage_macos/macos/Classes/FlutterSecureStoragePlugin.swift b/flutter_secure_storage_macos/macos/Classes/FlutterSecureStoragePlugin.swift index a9a2e512..1740e9d2 100644 --- a/flutter_secure_storage_macos/macos/Classes/FlutterSecureStoragePlugin.swift +++ b/flutter_secure_storage_macos/macos/Classes/FlutterSecureStoragePlugin.swift @@ -92,14 +92,14 @@ public class FlutterSecureStoragePlugin: NSObject, FlutterPlugin { private func deleteAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { let values = parseCall(call) - let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable) + let response = flutterSecureStorageManager.deleteAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility) handleResponse(response, result) } private func readAll(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { let values = parseCall(call) - let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable) + let response = flutterSecureStorageManager.readAll(groupId: values.groupId, accountName: values.accountName, synchronizable: values.synchronizable, accessibility: values.accessibility) handleResponse(response, result) } diff --git a/flutter_secure_storage_macos/pubspec.yaml b/flutter_secure_storage_macos/pubspec.yaml index 3c690378..6118cbdd 100644 --- a/flutter_secure_storage_macos/pubspec.yaml +++ b/flutter_secure_storage_macos/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_secure_storage_macos description: macOS implementation of flutter_secure_storage repository: https://github.com/mogol/flutter_secure_storage -version: 3.1.1 +version: 3.1.2 environment: sdk: ">=2.12.0 <4.0.0" @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - flutter_secure_storage_platform_interface: ^1.1.1 + flutter_secure_storage_platform_interface: ^1.1.2 flutter: plugin: