corretto / amazon-corretto-crypto-provider

The Amazon Corretto Crypto Provider is a collection of high-performance cryptographic implementations exposed via standard JCA/JCE interfaces.
Apache License 2.0
238 stars 56 forks source link

Fix bug in output buffer size check #297

Closed geedo0 closed 1 year ago

geedo0 commented 1 year ago

Issue #, if available: N/A

Description of changes: This is calling the wrong function and getting the wrong size. Note how the exception's error message used a different function than the one used in the error checking logic. For encryptions, this causes our safety check to be off by the tag length. Currently unused for decryptions, but this would return 0 when it should be the size of the plaintext.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.