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 BIO_get_ktls_send/recv to return 0 or 1 only #18178

Closed
wants to merge 3 commits into from

Conversation

t8m
Copy link
Member

@t8m t8m commented Apr 26, 2022

We use it as a boolean everywhere in the code and there is no reason to distinguish between the 0 and -1 return.

Fixes #18176

Checklist
  • documentation is added or updated

@t8m t8m added branch: master Merge to master branch approval: review pending This pull request needs review by a committer approval: otc review pending This pull request needs review by an OTC member triaged: bug The issue/pr is/fixes a bug branch: 3.0 Merge to openssl-3.0 branch labels Apr 26, 2022
@github-actions github-actions bot added the severity: fips change The pull request changes FIPS provider sources label Apr 26, 2022
@t8m t8m requested a review from mattcaswell April 27, 2022 08:28
# define BIO_get_ktls_recv(b) \
BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL)
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) > 0)
Copy link
Member

Choose a reason for hiding this comment

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

This is actually slightly problematic. This changes the meaning of a public macro. Applications compiled against old headers may behave incorrectly even if they are linked against an up-to-date and fully patched library.

I'm not sure how we should handle that.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO we can add documentation of that. The change is backwards compatible itself. I.e., if the app handles -1 return it won't be broken by this change.

@mattcaswell mattcaswell removed the approval: otc review pending This pull request needs review by an OTC member label Apr 28, 2022
@@ -167,7 +167,7 @@ the case of BIO_seek() on a file BIO for a successful operation.
=head1 HISTORY

The BIO_get_ktls_send() and BIO_get_ktls_recv() macros were added in
OpenSSL 3.0.
OpenSSL 3.0. They were modified to never return -1 in OpenSSL 3.0.3.
Copy link

Choose a reason for hiding this comment

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

3.0.3 in already out without this, so I think it will be 3.0.4

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! Thanks for the heads up. I'll update the PR.

@t8m
Copy link
Member Author

t8m commented May 9, 2022

@mattcaswell assuming still OK.

Ping for the second review.

@bernd-edlinger bernd-edlinger added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels May 13, 2022
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels May 14, 2022
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

@t8m
Copy link
Member Author

t8m commented May 16, 2022

Merged to master and openssl-3.0 branches. Thank you for the reviews.

@t8m t8m closed this May 16, 2022
openssl-machine pushed a commit that referenced this pull request May 16, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from #18178)
openssl-machine pushed a commit that referenced this pull request May 16, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from #18178)

(cherry picked from commit 524bac5)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 17, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 17, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 17, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 17, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 18, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
JeffroMF pushed a commit to JeffroMF/openssl555555555555 that referenced this pull request May 19, 2022
Fixes #18176

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from openssl/openssl#18178)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch severity: fips change The pull request changes FIPS provider sources triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenSSL 3.0 requires impementation of BIO_CTRL_GET_KTLS_SEND in custom BIO
5 participants