From 042b84005a52e004d22799a517517d9a34f2a687 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Fri, 4 Aug 2023 01:00:23 -0400 Subject: [PATCH] fix bug --- veilid-flutter/lib/veilid_crypto.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/veilid-flutter/lib/veilid_crypto.dart b/veilid-flutter/lib/veilid_crypto.dart index 21050517..6b258c11 100644 --- a/veilid-flutter/lib/veilid_crypto.dart +++ b/veilid-flutter/lib/veilid_crypto.dart @@ -199,7 +199,7 @@ abstract class VeilidCryptoSystem { Future decryptNoAuthWithNonce( Uint8List body, SharedSecret secret) async { - if (body.length <= Nonce.decodedLength()) { + if (body.length < Nonce.decodedLength()) { throw const FormatException('not enough data to decrypt'); } final nonce = @@ -220,7 +220,7 @@ abstract class VeilidCryptoSystem { Future decryptNoAuthWithPassword( Uint8List body, String password) async { - if (body.length <= Nonce.decodedLength()) { + if (body.length < Nonce.decodedLength()) { throw const FormatException('not enough data to decrypt'); } final ekbytes = Uint8List.fromList(utf8.encode(password));