mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-10-01 01:26:08 -04:00
fix bug
This commit is contained in:
parent
7ba795132b
commit
042b84005a
@ -199,7 +199,7 @@ abstract class VeilidCryptoSystem {
|
|||||||
|
|
||||||
Future<Uint8List> decryptNoAuthWithNonce(
|
Future<Uint8List> decryptNoAuthWithNonce(
|
||||||
Uint8List body, SharedSecret secret) async {
|
Uint8List body, SharedSecret secret) async {
|
||||||
if (body.length <= Nonce.decodedLength()) {
|
if (body.length < Nonce.decodedLength()) {
|
||||||
throw const FormatException('not enough data to decrypt');
|
throw const FormatException('not enough data to decrypt');
|
||||||
}
|
}
|
||||||
final nonce =
|
final nonce =
|
||||||
@ -220,7 +220,7 @@ abstract class VeilidCryptoSystem {
|
|||||||
|
|
||||||
Future<Uint8List> decryptNoAuthWithPassword(
|
Future<Uint8List> decryptNoAuthWithPassword(
|
||||||
Uint8List body, String password) async {
|
Uint8List body, String password) async {
|
||||||
if (body.length <= Nonce.decodedLength()) {
|
if (body.length < Nonce.decodedLength()) {
|
||||||
throw const FormatException('not enough data to decrypt');
|
throw const FormatException('not enough data to decrypt');
|
||||||
}
|
}
|
||||||
final ekbytes = Uint8List.fromList(utf8.encode(password));
|
final ekbytes = Uint8List.fromList(utf8.encode(password));
|
||||||
|
Loading…
Reference in New Issue
Block a user