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: don't fail for 0 blinding delay #4671

Merged
merged 3 commits into from
Aug 2, 2024
Merged

fix: don't fail for 0 blinding delay #4671

merged 3 commits into from
Aug 2, 2024

Conversation

lrstewart
Copy link
Contributor

@lrstewart lrstewart commented Jul 29, 2024

Description of changes:

While working on another PR, I got annoyed that s2nc and s2nd delay before reporting errors. It makes testing things take longer, and doesn't really provide any security value since s2nc and s2nd aren't intended for production use. But when I set their max blinding delay to 0, I got an error:

Failed to negotiate: 'a safety check failed'. Error encountered in s2n_random.c:468

The problem was that we were trying to generate a random number between 0 and 0, which obviously wasn't going to work. I've fixed that bug.

Call-outs:

If we're worried about customers using s2nc and s2nd in production, I can leave the blinding enabled, or at least add an argument to disable it instead of disabling it by default.

Testing:

Added a unit test. Also, running s2nc localhost 8000 against s2nd localhost 8000 now produces a "Certificate untrusted" error instead of the s2n_random safety error.

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

@github-actions github-actions bot added the s2n-core team label Jul 29, 2024
@lrstewart lrstewart marked this pull request as ready for review July 29, 2024 17:06
bin/common.c Show resolved Hide resolved
bin/common.c Show resolved Hide resolved
@lrstewart lrstewart enabled auto-merge (squash) August 2, 2024 04:03
@lrstewart lrstewart merged commit 0685abc into aws:main Aug 2, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants