1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-26 22:32:07 +01:00

Change default compression algorithm from UNCOMPRESSED to ZIP

This commit is contained in:
Paul Schaub 2021-09-06 15:13:41 +02:00
parent f68779d8a5
commit e5ae09b79c
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 7 additions and 1 deletions

View file

@ -379,7 +379,7 @@ public final class Policy {
}
public static CompressionAlgorithmPolicy defaultCompressionAlgorithmPolicy() {
return new CompressionAlgorithmPolicy(CompressionAlgorithm.UNCOMPRESSED, Arrays.asList(
return new CompressionAlgorithmPolicy(CompressionAlgorithm.ZIP, Arrays.asList(
CompressionAlgorithm.UNCOMPRESSED,
CompressionAlgorithm.ZIP,
CompressionAlgorithm.BZIP2,

View file

@ -26,6 +26,7 @@ import java.nio.charset.StandardCharsets;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import org.bouncycastle.openpgp.PGPCompressedData;
import org.bouncycastle.openpgp.PGPEncryptedData;
import org.bouncycastle.openpgp.PGPEncryptedDataList;
import org.bouncycastle.openpgp.PGPException;
@ -115,6 +116,11 @@ public class OnePassSignatureBracketingTest {
} else if (next instanceof PGPOnePassSignatureList) {
onePassSignatures = (PGPOnePassSignatureList) next;
continue outerloop;
} else if (next instanceof PGPCompressedData) {
PGPCompressedData compressed = (PGPCompressedData) next;
InputStream decompressor = compressed.getDataStream();
objectFactory = new PGPObjectFactory(decompressor, ImplementationFactory.getInstance().getKeyFingerprintCalculator());
continue outerloop;
} else if (next instanceof PGPLiteralData) {
continue outerloop;
} else if (next instanceof PGPSignatureList) {