From 746f06d83439b0b0f0a08d6b2c151ba24b9e3225 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 19 Nov 2021 09:50:04 +0100 Subject: [PATCH] fix: Pass hive cipher --- .../matrix_sdk_extensions.dart/fluffybox_database.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart b/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart index d76040c1..69529e3c 100644 --- a/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart +++ b/lib/utils/matrix_sdk_extensions.dart/fluffybox_database.dart @@ -16,7 +16,7 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase { FlutterFluffyBoxDatabase( String name, String path, { - List? key, + HiveCipher? key, }) : super( name, path, @@ -27,7 +27,7 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase { static Future databaseBuilder(Client client) async { Logs().d('Open FluffyBox...'); - List? hiverCipher; + HiveAesCipher? hiverCipher; try { // Workaround for secure storage is calling Platform.operatingSystem on web if (kIsWeb) throw MissingPluginException(); @@ -47,7 +47,7 @@ class FlutterFluffyBoxDatabase extends FluffyBoxDatabase { final rawEncryptionKey = await secureStorage.read(key: _cipherStorageKey); if (rawEncryptionKey == null) throw MissingPluginException(); - hiverCipher = base64Url.decode(rawEncryptionKey); + hiverCipher = HiveAesCipher(base64Url.decode(rawEncryptionKey)); } on MissingPluginException catch (_) { Logs().i('FluffyBox encryption is not supported on this platform'); }