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 Equality Check in XChaCha20EncryptionResult #46

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

ReneeVandervelde
Copy link
Contributor

The XChaCha20EncryptionResult data class currently implements its own equality check due to the class's byte array members. However, this is using a standard equality check, ==, rather than checking the array's contents. This will cause two results with the same contained values to return false on an equals check.

Confirmed this issue with a unit test, and fixed by changing the implemented method to use contentEquals instead.

The `XChaCha20EncryptionResult` data class currently implements
its own equality check due to the class's byte array members.
However, this is using a standard equality check, `==`, rather
than checking the array's contents. This will cause two results
with the same contained values to return `false` on an equals check.

Confirmed this issue with a unit test, and fixed by changing the
implemented method to use `contentEquals` instead.
@CLAassistant
Copy link

CLAassistant commented Jun 15, 2024

CLA assistant check
All committers have signed the CLA.

@ionspin ionspin merged commit b919de5 into ionspin:main Jun 15, 2024
4 checks passed
@ionspin
Copy link
Owner

ionspin commented Jun 15, 2024

Nice catch, thanks for the contribution!

@ionspin
Copy link
Owner

ionspin commented Jun 15, 2024

Usually the CI would publish the snapshot automatically, but there was a change in Maven Central authentication system and I'll have to update build scripts, and I can do that only in a couple of weeks when I'm back, sorry for the unexpected delay.

@ionspin
Copy link
Owner

ionspin commented Jun 15, 2024

Actually I managed to set it up just in time, your changes should be in snapshot version soon.

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