From 8a104b34ffbe6e25482b5f00a905344c547dea40 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Mon, 7 Sep 2020 16:19:19 +0200 Subject: [PATCH] fix: potentially fix SSSS passphrase not working for some accounts --- lib/encryption/ssss.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/encryption/ssss.dart b/lib/encryption/ssss.dart index d646397..8386f03 100644 --- a/lib/encryption/ssss.dart +++ b/lib/encryption/ssss.dart @@ -16,6 +16,7 @@ * along with this program. If not, see . */ +import 'dart:core'; import 'dart:convert'; import 'dart:typed_data'; @@ -133,7 +134,7 @@ class SSSS { } final generator = PBKDF2(hashAlgorithm: sha512); return Uint8List.fromList(generator.generateKey(passphrase, info.salt, - info.iterations, info.bits != null ? info.bits / 8 : 32)); + info.iterations, info.bits != null ? (info.bits / 8).ceil() : 32)); } void setValidator(String type, Future Function(String) validator) {