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

Add regression test for PGPUtil.getDecoderStream mistaking plaintext for base64 encoded data

This commit is contained in:
Paul Schaub 2021-10-01 15:21:42 +02:00
parent 8fccc73370
commit 7bc35dcba3
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 45 additions and 6 deletions

View file

@ -153,7 +153,7 @@ public final class DecryptionStreamFactory {
bufferedIn.reset();
inputStream = wrapInVerifySignatureStream(bufferedIn);
} catch (IOException e) {
if (e.getMessage().contains("invalid armor")) {
if (e.getMessage().contains("invalid armor") || e.getMessage().contains("invalid header encountered")) {
// We falsely assumed the data to be armored.
LOGGER.debug("The message is apparently not armored.");
bufferedIn.reset();