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

Additional test cases for s2n_constant_time_equals() #4559

Merged
merged 5 commits into from
May 21, 2024

Conversation

rod-chapman
Copy link
Contributor

Additional test cases for s2n_constant_time_equals() where one parameter is NULL and the other is an array of N 0x00 bytes.

These cases are important owing to the implementation, where an 0x00 byte is substituted to avoid dereferencing NULL. In that case, we have to be careful to make sure this function returns FALSE, not TRUE.

Description of changes:

See above.

Call-outs:

There is potential to improve this code via more explicint pre-conditions that exclude the offending special cases.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…s NULL and the other is an array of N 0x00 bytes
tests/unit/s2n_safety_test.c Outdated Show resolved Hide resolved
@jmayclin jmayclin requested a review from maddeleine May 16, 2024 17:58
@maddeleine maddeleine merged commit 5f29e4c into aws:main May 21, 2024
33 checks passed
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

4 participants