diff --git a/lib/src/message/literal_message.dart b/lib/src/message/literal_message.dart index 73861b1f..8a1b055c 100644 --- a/lib/src/message/literal_message.dart +++ b/lib/src/message/literal_message.dart @@ -12,7 +12,6 @@ import '../common/helpers.dart'; import '../enum/aead_algorithm.dart'; import '../enum/armor_type.dart'; import '../enum/compression_algorithm.dart'; -import '../enum/preset_rfc.dart'; import '../enum/symmetric_algorithm.dart'; import '../message/base_message.dart'; import '../packet/base_packet.dart'; @@ -166,7 +165,7 @@ final class LiteralMessage extends BaseMessage implements LiteralMessageInterfac 'No encryption keys or passwords provided.', ); } - var addPadding = Config.presetRfc == PresetRfc.rfc9580; + var addPadding = true; for (final key in encryptionKeys) { if (!key.keyPacket.isV6Key) { addPadding = false; @@ -179,7 +178,7 @@ final class LiteralMessage extends BaseMessage implements LiteralMessageInterfac final packetList = addPadding ? PacketList([ - ...this.packetList.packets, + ...this.packetList, PaddingPacket.createPadding( Helper.randomInt( PaddingPacket.paddingMin, diff --git a/test/message/literal_data_test.dart b/test/message/literal_data_test.dart index 71cec36b..0cb80084 100644 --- a/test/message/literal_data_test.dart +++ b/test/message/literal_data_test.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:dart_pg/src/enum/compression_algorithm.dart'; -import 'package:dart_pg/src/enum/preset_rfc.dart'; import 'package:dart_pg/src/openpgp.dart'; import 'package:test/test.dart'; @@ -169,7 +168,6 @@ void main() { }); test('with aead protect', () { - Config.presetRfc = PresetRfc.rfc9580; Config.aeadProtect = true; final encryptedMessage = OpenPGP.encryptBinaryData( @@ -187,7 +185,6 @@ void main() { expect(literalMessage.literalData.binary, equals(literalData)); Config.aeadProtect = false; - Config.presetRfc = PresetRfc.rfc4880; }); test('to Alice', () { diff --git a/test/packet/encryption_test.dart b/test/packet/encryption_test.dart index 0977adb4..f08d1d35 100644 --- a/test/packet/encryption_test.dart +++ b/test/packet/encryption_test.dart @@ -210,7 +210,7 @@ void main() { key, SymmetricAlgorithm.aes128, ), - throwsStateError, + throwsA(isA()), ); });