Skip to content

Fix ssl3_do_write() to correctly handle retries - #21434

Closed
mattcaswell wants to merge 2 commits into
openssl:masterfrom
mattcaswell:fix-handshake-retry
Closed

mattcaswell wants to merge 2 commits into
openssl:masterfrom
mattcaswell:fix-handshake-retry

Conversation

@mattcaswell

Copy link
Copy Markdown
Member

A BIO is documented to return -1 on write retry - but sometimes they return
0. ssl3_do_write() was incorrectly handling a 0 response.

Fixes #21422

Test various scenarios for a write retry occuring during a handshake.
A BIO is documented to return -1 on write retry - but sometimes they return
0. ssl3_do_write() was incorrectly handling a 0 response.

Fixes openssl#21422
@mattcaswell

Copy link
Copy Markdown
Member Author

Actually this is only really a problem in the 3.1/3.0 branches. By accident of the record layer refactor this doesn't actually impact the master branch. But the code is still wrong so I think we should apply the fix here anyway.

@paulidale paulidale added tests: present The PR has suitable tests present and removed approval: otc review pending labels Jul 13, 2023
@mattcaswell

Copy link
Copy Markdown
Member Author

Ping for second review?

@beldmit beldmit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@beldmit beldmit 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 Jul 14, 2023
@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 Jul 15, 2023
@openssl-machine

Copy link
Copy Markdown
Collaborator

This pull request is ready to merge

@paulidale

Copy link
Copy Markdown
Contributor

and merged.

@paulidale paulidale closed this Jul 16, 2023
openssl-machine pushed a commit that referenced this pull request Jul 16, 2023
Test various scenarios for a write retry occuring during a handshake.

Reviewed-by: Dmitry Belyavskiy <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
(Merged from #21434)
openssl-machine pushed a commit that referenced this pull request Jul 16, 2023
A BIO is documented to return -1 on write retry - but sometimes they return
0. ssl3_do_write() was incorrectly handling a 0 response.

Fixes #21422

Reviewed-by: Dmitry Belyavskiy <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
(Merged from #21434)
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 Applies to master branch tests: present The PR has suitable tests present

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenSSL 3.0.8 "SSL routines internal error (s3_enc.c:354)"

4 participants