From bb075182949a197936b6d6fa3464f8d136fbaeae Mon Sep 17 00:00:00 2001 From: Herbert Poul Date: Wed, 15 Jul 2020 12:50:03 +0200 Subject: [PATCH] fix test loading of dynamic libraries. --- .github/workflows/dart.yml | 5 +++++ bin/kdbx.dart | 1 + libargon2_ffi.dylib | Bin 58948 -> 58876 bytes test/internal/test_utils.dart | 19 +++++++++++++++++-- test/kdbx4_test.dart | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 1cdc282..f9265b5 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -9,6 +9,7 @@ jobs: os: ['ubuntu-latest', 'windows-2019', 'macos-latest'] dart_channel: ['stable'] + fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -16,6 +17,10 @@ jobs: - uses: cedx/setup-dart@v2 with: release-channel: ${{ matrix.dart_channel }} + - run: | + which dart + codesign --remove-signature $(which dart) + if: startsWith(matrix.os, 'macos') - name: Install dependencies run: pub get - name: Run tests diff --git a/bin/kdbx.dart b/bin/kdbx.dart index aa6a2e3..45a3277 100644 --- a/bin/kdbx.dart +++ b/bin/kdbx.dart @@ -94,6 +94,7 @@ abstract class KdbxFileCommand extends Command { final keyFileData = keyFile == null ? null : await File(keyFile).readAsBytes(); + Argon2FfiFlutter.resolveLibraryForceDynamic = true; final file = await KdbxFormat(Argon2FfiFlutter()).read( bytes, Credentials.composite(ProtectedValue.fromString(password), keyFileData), diff --git a/libargon2_ffi.dylib b/libargon2_ffi.dylib index 7256edae314ef81b6c83532fc116a26d5abfdba7..a0d23bd827aeb8ac67e306baef29fe1db0ef2753 100755 GIT binary patch delta 6685 zcmai(3s_Xu_Q21c0UV%YP*4n&!3TmGV3uh>qB1rq=oq4=5g=etAR~`1K4|cw#&|*p z7vw8#H1wL@?>gS;cK!QmLjPUOZjR=I>#I>KhnwFOyZ-wyyYgS_?0qu%`o6nA&f4p@ z*4mG=&pvzaGaUOu`}0Yy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=Vu7t8g$E;k6jAD!dBtT8LL6UPX9m cUVN1&{`#Gu?sNqG>2T}m`{maLT!< readKdbxFile( String filePath, { String password = 'asdf', }) async { - final kdbxFormat = KdbxFormat(Argon2FfiFlutter()); + final kdbxFormat = TestUtil.kdbxFormat(); final data = await File(filePath).readAsBytes(); final file = await kdbxFormat.read( data, Credentials(ProtectedValue.fromString(password))); @@ -21,7 +36,7 @@ class TestUtil { static Future readKdbxFileBytes(Uint8List data, {String password = 'asdf'}) async { - final kdbxFormat = KdbxFormat(Argon2FfiFlutter()); + final kdbxFormat = TestUtil.kdbxFormat(); final file = await kdbxFormat.read( data, Credentials(ProtectedValue.fromString(password))); return file; diff --git a/test/kdbx4_test.dart b/test/kdbx4_test.dart index 472ef64..dfa24f1 100644 --- a/test/kdbx4_test.dart +++ b/test/kdbx4_test.dart @@ -16,7 +16,7 @@ final _logger = Logger('kdbx4_test'); void main() { Logger.root.level = Level.ALL; PrintAppender().attachToLogger(Logger.root); - final kdbxFormat = KdbxFormat(Argon2FfiFlutter()); + final kdbxFormat = TestUtil.kdbxFormat(); group('Reading', () { test('bubb', () async { final data = await File('test/keepassxcpasswords.kdbx').readAsBytes();