Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ jobs:
restore-keys: |
${{ runner.os }}-pub-
- name: Install Melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Install Workspace Dependencies
run: flutter pub get

- name: Bootstrap Workspace with Melos
run: melos bootstrap
run: dart run melos bootstrap

- name: Lint Code
run: melos analyze
run: dart run melos exec -- flutter analyze

formatting:
name: Formatting
Expand Down Expand Up @@ -78,16 +76,14 @@ jobs:
restore-keys: |
${{ runner.os }}-pub-
- name: Install Melos
run: |
flutter pub global activate melos
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Install Workspace Dependencies
run: flutter pub get

- name: Bootstrap Workspace with Melos
run: melos bootstrap
run: dart run melos bootstrap

- name: Check Code Formatting
run: melos format --output none --set-exit-if-changed
run: dart run melos format --output none --set-exit-if-changed

unit_tests:
name: Unit Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_secure_storage_platform_interface: ^2.0.0
flutter_secure_storage_platform_interface: ^2.0.1

flutter:
plugin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
8 changes: 4 additions & 4 deletions flutter_secure_storage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ dependencies:
flutter_secure_storage_linux: ^3.0.0
flutter_secure_storage_platform_interface: ^2.0.1
flutter_secure_storage_web: ^2.1.0
flutter_secure_storage_windows: ^4.1.0
meta: ^1.3.0
flutter_secure_storage_windows: ^4.2.0
meta: ^1.17.0

dev_dependencies:
flutter_test:
sdk: flutter
mocktail: ^1.0.0
plugin_platform_interface: ^2.0.0
mocktail: ^1.0.5
plugin_platform_interface: ^2.1.8
very_good_analysis: '>=6.0.0 <10.1.0'

# We need to manually declare supported platforms, because pub.dev won't find them.
Expand Down
2 changes: 1 addition & 1 deletion flutter_secure_storage_darwin/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.0.2
plugin_platform_interface: ^2.1.8

dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion flutter_secure_storage_linux/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_secure_storage_platform_interface: ^2.0.0
flutter_secure_storage_platform_interface: ^2.0.1

flutter:
plugin:
Expand Down
6 changes: 3 additions & 3 deletions flutter_secure_storage_platform_interface/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ environment:
dependencies:
flutter:
sdk: flutter
plugin_platform_interface: ^2.0.1
plugin_platform_interface: ^2.1.8

dev_dependencies:
flutter_test:
sdk: flutter
mockito: ^5.0.12
very_good_analysis: ^7.0.0
mockito: ^5.6.4
very_good_analysis: ^10.2.0
2 changes: 1 addition & 1 deletion flutter_secure_storage_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## NEXT
## 2.1.1
- Fix potential key skipping in `readAll` when storage is modified concurrently during async decryption by collecting keys synchronously before awaiting.

## 2.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ class FlutterSecureStorageWeb extends FlutterSecureStoragePlatform {
keys.add(key);
}

for (final key in keys) {
storage.removeItem(key);
}
keys.forEach(storage.removeItem);
}

/// Reads and decrypts the value for the given [key].
Expand Down
6 changes: 3 additions & 3 deletions flutter_secure_storage_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_secure_storage_web
description: Web implementation of flutter_secure_storage. Use flutter_secure_storage for the full flutter package.
repository: https://github.com/mogol/flutter_secure_storage
version: 2.1.0
version: 2.1.1

environment:
sdk: ">=3.3.0 <4.0.0"
Expand All @@ -10,15 +10,15 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_secure_storage_platform_interface: ^2.0.0
flutter_secure_storage_platform_interface: ^2.0.1
flutter_web_plugins:
sdk: flutter
web: ">=0.5.0 <2.0.0"

dev_dependencies:
flutter_test:
sdk: flutter
very_good_analysis: ^7.0.0
very_good_analysis: ^10.2.0
flutter:
plugin:
platforms:
Expand Down
3 changes: 3 additions & 0 deletions flutter_secure_storage_windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 4.2.0
Fix DPAPI FFI calls for compatibility with `win32` 6.0.0.

## 4.1.0
Upgrades deprecated member usage of win32.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
jni
)

set(PLUGIN_BUNDLED_LIBRARIES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,25 +297,25 @@ class DpapiJsonFileMapStorage extends MapStorage {
// Specify size of the struct explicitly.
final plainTextBlob =
alloc.allocate<CRYPT_INTEGER_BLOB>(sizeOf<CRYPT_INTEGER_BLOB>());
if (CryptUnprotectData(
encryptedTextBlob,
nullptr,
nullptr,
nullptr,
nullptr,
0,
plainTextBlob,
) ==
0) {
final Win32Result(value: isUnprotected, error: unprotectError) =
CryptUnprotectData(
encryptedTextBlob,
null,
null,
null,
0,
plainTextBlob,
);
if (!isUnprotected) {
throw WindowsException(
GetLastError(),
unprotectError.toHRESULT(),
message: 'Failure on CryptUnprotectData()',
);
}

if (plainTextBlob.ref.pbData.address == NULL) {
throw WindowsException(
ERROR_OUTOFMEMORY,
ERROR_OUTOFMEMORY.toHRESULT(),
message: 'Failure on CryptUnprotectData()',
);
}
Expand All @@ -326,10 +326,12 @@ class DpapiJsonFileMapStorage extends MapStorage {
);
} finally {
if (plainTextBlob.ref.pbData.address != NULL) {
if (LocalFree(plainTextBlob.ref.pbData).address != NULL) {
final Win32Result(value: localFreeResult, error: localFreeError) =
LocalFree(HLOCAL(plainTextBlob.ref.pbData.cast()));
if (!localFreeResult.isNull) {
debugPrint(
'load: Failed to LocalFree with: '
'0x${GetLastError().toHexString(32)}',
'${localFreeError.toHRESULT().toHexString()}',
);
}
}
Expand Down Expand Up @@ -401,25 +403,25 @@ class DpapiJsonFileMapStorage extends MapStorage {
// Specify size of the struct explicitly.
final encryptedTextBlob =
alloc.allocate<CRYPT_INTEGER_BLOB>(sizeOf<CRYPT_INTEGER_BLOB>());
if (CryptProtectData(
plainTextBlob,
nullptr,
nullptr,
nullptr,
nullptr,
0,
encryptedTextBlob,
) ==
0) {
final Win32Result(value: isProtected, error: protectError) =
CryptProtectData(
plainTextBlob,
null,
null,
null,
0,
encryptedTextBlob,
);
if (!isProtected) {
throw WindowsException(
GetLastError(),
protectError.toHRESULT(),
message: 'Failure on CryptProtectData()',
);
}

if (encryptedTextBlob.ref.pbData.address == NULL) {
throw WindowsException(
ERROR_OUTOFMEMORY,
ERROR_OUTOFMEMORY.toHRESULT(),
message: 'Failure on CryptProtectData()',
);
}
Expand All @@ -446,10 +448,12 @@ class DpapiJsonFileMapStorage extends MapStorage {
}
} finally {
if (encryptedTextBlob.ref.pbData.address != NULL) {
if (LocalFree(encryptedTextBlob.ref.pbData).address != NULL) {
final Win32Result(value: localFreeResult, error: localFreeError) =
LocalFree(HLOCAL(encryptedTextBlob.ref.pbData.cast()));
if (!localFreeResult.isNull) {
debugPrint(
'save: Failed to LocalFree with: '
'0x${GetLastError().toHexString(32)}',
'${localFreeError.toHRESULT().toHexString()}',
);
}
}
Expand Down
14 changes: 7 additions & 7 deletions flutter_secure_storage_windows/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: flutter_secure_storage_windows
description: Windows implementation of flutter_secure_storage. Please use flutter_secure_storage instead of this package.
repository: https://github.com/mogol/flutter_secure_storage
version: 4.1.0
version: 4.2.0

environment:
sdk: '>=3.3.0 <4.0.0'
flutter: '>=3.19.0'

dependencies:
ffi: ^2.0.0
ffi: ^2.2.0
flutter:
sdk: flutter
flutter_secure_storage_platform_interface: ^2.0.0
path: ^1.8.0
path_provider: ^2.0.0
win32: ^5.5.4
flutter_secure_storage_platform_interface: ^2.0.1
path: ^1.9.1
path_provider: ^2.1.5
win32: ^6.0.1

dev_dependencies:
flutter_test:
sdk: flutter
very_good_analysis: ^7.0.0
very_good_analysis: ^10.2.0

flutter:
plugin:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ environment:
sdk: '>=2.15.0 <4.0.0'

dev_dependencies:
flutter_lints: ^3.0.2
melos: ^6.0.0
flutter_lints: ^6.0.0
melos: ^7.5.1
Loading