Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyen Van Nguyen <[email protected]>
  • Loading branch information
nguyennv committed Dec 11, 2024
1 parent ba8fb76 commit 7bf872a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions lib/src/message/literal_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand All @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions test/message/literal_data_test.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -169,7 +168,6 @@ void main() {
});

test('with aead protect', () {
Config.presetRfc = PresetRfc.rfc9580;
Config.aeadProtect = true;

final encryptedMessage = OpenPGP.encryptBinaryData(
Expand All @@ -187,7 +185,6 @@ void main() {
expect(literalMessage.literalData.binary, equals(literalData));

Config.aeadProtect = false;
Config.presetRfc = PresetRfc.rfc4880;
});

test('to Alice', () {
Expand Down
2 changes: 1 addition & 1 deletion test/packet/encryption_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void main() {
key,
SymmetricAlgorithm.aes128,
),
throwsStateError,
throwsA(isA<Error>()),
);
});

Expand Down

0 comments on commit 7bf872a

Please sign in to comment.