From 3a0ce799bad4f69b35cd46910d0a21e978657541 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Thu, 31 Dec 2020 11:36:01 +0100 Subject: [PATCH] fix: Don't allow an empty ssss passphrase in key verification --- lib/components/dialogs/key_verification_dialog.dart | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/components/dialogs/key_verification_dialog.dart b/lib/components/dialogs/key_verification_dialog.dart index b7eca9ed..256fcb20 100644 --- a/lib/components/dialogs/key_verification_dialog.dart +++ b/lib/components/dialogs/key_verification_dialog.dart @@ -67,7 +67,7 @@ class _KeyVerificationPageState extends State { final textEditingController = TextEditingController(); String input; final checkInput = () async { - if (input == null) { + if (input == null || input.isEmpty) { return; } final valid = await showFutureLoadingDialog( @@ -77,15 +77,10 @@ class _KeyVerificationPageState extends State { await Future.delayed(Duration(milliseconds: 100)); var valid = false; try { - await widget.request.openSSSS(recoveryKey: input); + await widget.request.openSSSS(keyOrPassphrase: input); valid = true; } catch (_) { - try { - await widget.request.openSSSS(passphrase: input); - valid = true; - } catch (_) { - valid = false; - } + valid = false; } return valid; });