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

Allow ChaCha20 cipher reuse with same key/IV or without init after decryption #661

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

KostasTsiounis
Copy link
Contributor

@KostasTsiounis KostasTsiounis commented Sep 13, 2023

The expected behaviour for reuse of NativeChaCha20Cipher for decryption is altered to match the existing Sun implementation in ChaCha20Cipher, as updated in OpenJDK21.

The following scenarios are now allowed for decryption:

  • Reinitialize with same key + nonce
  • Update AAD after a successful doFinal() without reinitializing
  • Update AAD after an AEADBadTagException

Those scenarios are not allowed (i.e., an exception is thrown) in OpenJDK20 and earlier.

This fix addresses the failures mentioned in issue eclipse-openj9/openj9#17632

Signed-off by: Kostas Tsiounis kostas.tsiounis@ibm.com

The expected behaviour for reuse of NativeChaCha20Cipher for decryption
is altered to match the existing Sun implementation in ChaCha20Cipher,
as updated in OpenJDK21.

The following scenarios are now allowed for decryption:

- Reinitialize with same key + nonce
- Update AAD after a successful doFinal() without reinitializing
- Update AAD after an AEADBadTagException

Those scenarios are not allowed (i.e., an exception is thrown) in
OpenJDK20 and earlier.

Signed-off by: Kostas Tsiounis <kostas.tsiounis@ibm.com>
@keithc-ca
Copy link
Member

Jenkins compile amac jdknext

@keithc-ca
Copy link
Member

Testing underway in https://openj9-jenkins.osuosl.org/job/Grinder/2945/.

Copy link
Member

@keithc-ca keithc-ca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing passed.

@keithc-ca keithc-ca merged commit 4d1e1ca into ibmruntimes:openj9 Sep 29, 2023
4 checks passed
babsingh added a commit to babsingh/aqa-tests that referenced this pull request Oct 17, 2023
JDK-next (JDK22) fix: ibmruntimes/openj9-openjdk-jdk#661
JDK21 fix: ibmruntimes/openj9-openjdk-jdk21#50

Closes: eclipse-openj9/openj9#17632

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
babsingh added a commit to babsingh/aqa-tests that referenced this pull request Oct 17, 2023
JDK-next (JDK22) fix: ibmruntimes/openj9-openjdk-jdk#661
JDK21 fix: ibmruntimes/openj9-openjdk-jdk21#50

Closes: eclipse-openj9/openj9#17632

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
smlambert pushed a commit to adoptium/aqa-tests that referenced this pull request Oct 17, 2023
JDK-next (JDK22) fix: ibmruntimes/openj9-openjdk-jdk#661
JDK21 fix: ibmruntimes/openj9-openjdk-jdk21#50

Closes: eclipse-openj9/openj9#17632

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
llxia pushed a commit to llxia/openjdk-tests that referenced this pull request Nov 22, 2023
JDK-next (JDK22) fix: ibmruntimes/openj9-openjdk-jdk#661
JDK21 fix: ibmruntimes/openj9-openjdk-jdk21#50

Closes: eclipse-openj9/openj9#17632

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
llxia pushed a commit to llxia/openjdk-tests that referenced this pull request Nov 22, 2023
JDK-next (JDK22) fix: ibmruntimes/openj9-openjdk-jdk#661
JDK21 fix: ibmruntimes/openj9-openjdk-jdk21#50

Closes: eclipse-openj9/openj9#17632

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
pshipton pushed a commit to adoptium/aqa-tests that referenced this pull request Nov 22, 2023
JDK-next (JDK22) fix: ibmruntimes/openj9-openjdk-jdk#661
JDK21 fix: ibmruntimes/openj9-openjdk-jdk21#50

Closes: eclipse-openj9/openj9#17632

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
tajila pushed a commit to tajila/openj9-openjdk-jdk that referenced this pull request Mar 27, 2024
@KostasTsiounis KostasTsiounis deleted the chacha20_reuse branch April 24, 2024 15:14
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.

None yet

2 participants