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 ArrayIndexOutOfBoundsException when no space needed #369

Closed SalusaSecondus closed 8 months ago

SalusaSecondus commented 8 months ago

ACCP incorrectly rejects GCM decryption when no output space is needed and is not provided. ACCP does correctly handle the case when the output buffer is an empty array but fails if the array is not empty. This change fixes this behavior and brings it into agreement with the default GCM implementation provided by the JDK.

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

SalusaSecondus commented 8 months ago

Rebased the changes.