Hey!
The ArmoredInputStream does a checksum verification in its read() method.
Unfortunately, a mismatching CRC checksum results in an IOException being thrown.
This is unfortunate, because the default implementation of InputStream.read(bytes, offset, length) silently swallows IOExceptions. Therefore the CRC checksum error goes unnoticed.
I see two ways of fixing this:
- Throw a custom exception not derived from
IOException. This will likely break existing implementations, as a new runtime exception type needs to be introduced.
- Override
ArmoredInputStream.read(bytes, offset, length) to not swallow IOExceptions. This is probably the preferred way to solve the issue.
See pgpainless/pgpainless#159 (comment)
Hey!
The ArmoredInputStream does a checksum verification in its
read()method.Unfortunately, a mismatching CRC checksum results in an
IOExceptionbeing thrown.This is unfortunate, because the default implementation of
InputStream.read(bytes, offset, length)silently swallowsIOExceptions. Therefore the CRC checksum error goes unnoticed.I see two ways of fixing this:
IOException. This will likely break existing implementations, as a new runtime exception type needs to be introduced.ArmoredInputStream.read(bytes, offset, length)to not swallow IOExceptions. This is probably the preferred way to solve the issue.See pgpainless/pgpainless#159 (comment)