You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Exception thrown ('Error while validating MDC') if MDC validation occurs twice, caused by nested InputStreams.
To Reproduce
Wrap the decryptAndVerifyStream in an additional InputStream, reading to the end of that stream can cause MDCValidatingInputStream#read to be called twice. PGPEncryptedData#verify doesn't like being called twice, possibly due to the reuse of the integrityCalculator OutputStream (a guess).
Expected behavior
Exception should not be thrown if MDC is valid, even if nested streams cause the validator to trigger twice.
** System (please complete the following information):**
Version 2.3.0
Additional context
I've got an example trivial fix, will raise a PR for consideration shortly. Thanks!