1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-10 14:21:09 +01:00

Fix partial length encoding of some messages

Fixes #160

I'm not yet sure, why this issue only happened with some keys and not others,
but this fix works for now.
This commit is contained in:
Paul Schaub 2021-08-04 16:02:35 +02:00
parent 16c3116518
commit 2d76cb5c82
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 141 additions and 1 deletions

View file

@ -52,7 +52,10 @@ public final class EncryptionStream extends OutputStream {
private final EncryptionResult.Builder resultBuilder = EncryptionResult.builder();
private boolean closed = false;
private static final int BUFFER_SIZE = 1 << 8;
// 1 << 8 causes wrong partial body length encoding
// 1 << 9 fixes this.
// see https://github.com/pgpainless/pgpainless/issues/160
private static final int BUFFER_SIZE = 1 << 9;
OutputStream outermostStream;
private ArmoredOutputStream armorOutputStream = null;