neuhalje / bouncy-gpg

Make using Bouncy Castle with OpenPGP fun again!
https://neuhalje.github.io/bouncy-gpg/
Other
207 stars 54 forks source link

Fix double verification error #66 #67

Open homps opened 2 years ago

homps commented 2 years ago

Fixes #66

Nesting inputstreams can result in a child stream reaching its end twice. For the MDCValidatingInputStream this results in verifying the MDC twice. PGPEncryptedData#verify doesn't handle being called twice.

decryptNoSignatureValidation_withWrapperStream_works fails without the fix in MDCValidatingInputStream.

Fix with a simple boolean flag to prevent double verification. Another alternative option would be making a change to PGPEncryptedData#verify.