Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IllegalArgumentException on Cipher.getParameters #368

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

SalusaSecondus
Copy link
Contributor

Cipher.getParameters() is documented as returning “a combination of default and random parameter values used by the underlying cipher implementation if this cipher requires algorithm parameters but was not initialized with any.” However, if called on an AES/GCM/NoPadding cipher in ACCP, we get an exception because it expects the iv to be non-null.

This change detects an uninitialized cipher and generates a random 12 byte (96 bit) IV for use in the returned parameters when this happens. It also has a corresponding unit test.

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

@SalusaSecondus SalusaSecondus requested a review from a team as a code owner March 7, 2024 15:53
@geedo0 geedo0 merged commit 9d1f26d into corretto:main Mar 8, 2024
10 checks passed
@SalusaSecondus SalusaSecondus deleted the iae_parameters branch March 13, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants