1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-10 06:11:08 +01:00

Yet another patch for ASCII armor detection -.-

This commit is contained in:
Paul Schaub 2022-02-15 14:21:28 +01:00
parent f3cf3456ab
commit e8da3b30d8
2 changed files with 80 additions and 3 deletions

View file

@ -172,8 +172,7 @@ public final class DecryptionStreamFactory {
LOGGER.debug("The message is apparently not armored.");
bufferedIn.reset();
decoderStream = bufferedIn;
objectFactory = ImplementationFactory.getInstance().getPGPObjectFactory(decoderStream);
inputStream = wrapInVerifySignatureStream(bufferedIn, objectFactory);
inputStream = wrapInVerifySignatureStream(bufferedIn, null);
} else {
throw new FinalIOException(e);
}
@ -214,6 +213,9 @@ public final class DecryptionStreamFactory {
} catch (FinalIOException e) {
throw e;
} catch (IOException e) {
if (depth == 1 && e.getMessage().contains("invalid armor")) {
throw e;
}
if (depth == 1 && e.getMessage().contains("unknown object in stream:")) {
throw new MissingLiteralDataException("No Literal Data Packet found.");
} else {