Skip to content

Comments

Fix SSL_pending() and SSL_has_pending() with DTLS (3.0)#18975

Closed
mattcaswell wants to merge 2 commits intoopenssl:openssl-3.0from
mattcaswell:fix-dtls-pending-3.0
Closed

Fix SSL_pending() and SSL_has_pending() with DTLS (3.0)#18975
mattcaswell wants to merge 2 commits intoopenssl:openssl-3.0from
mattcaswell:fix-dtls-pending-3.0

Conversation

@mattcaswell
Copy link
Member

This is a backport of #18868 to the 3.0 branch.

If app data is received before a Finished message in DTLS then we buffer
it to return later. The function SSL_pending() is supposed to tell you
how much processed app data we have already buffered, and SSL_has_pending()
is supposed to tell you if we have any data buffered (whether processed or
not, and whether app data or not).

Neither SSL_pending() or SSL_has_pending() were taking account of this
DTLS specific app data buffer.

If app data is received before a Finished message in DTLS then we buffer
it to return later. The function SSL_pending() is supposed to tell you
how much processed app data we have already buffered, and SSL_has_pending()
is supposed to tell you if we have any data buffered (whether processed or
not, and whether app data or not).

Neither SSL_pending() or SSL_has_pending() were taking account of this
DTLS specific app data buffer.
If the first app data record arrives before the Finished message we should
be able to buffer it and move on to the Finished message.
@mattcaswell mattcaswell added approval: review pending This pull request needs review by a committer approval: otc review pending branch: 3.0 Applies to openssl-3.0 branch labels Aug 10, 2022
@hlandau hlandau removed the approval: review pending This pull request needs review by a committer label Aug 11, 2022
@t8m t8m added approval: done This pull request has the required number of approvals triaged: bug The issue/pr is/fixes a bug and removed approval: otc review pending labels Aug 16, 2022
@openssl-machine openssl-machine removed the approval: done This pull request has the required number of approvals label Aug 17, 2022
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

@openssl-machine openssl-machine added the approval: ready to merge The 24 hour grace period has passed, ready to merge label Aug 17, 2022
@hlandau
Copy link
Member

hlandau commented Aug 17, 2022

Merged to 3.0. Thank you.

@hlandau hlandau closed this Aug 17, 2022
openssl-machine pushed a commit that referenced this pull request Aug 17, 2022
If app data is received before a Finished message in DTLS then we buffer
it to return later. The function SSL_pending() is supposed to tell you
how much processed app data we have already buffered, and SSL_has_pending()
is supposed to tell you if we have any data buffered (whether processed or
not, and whether app data or not).

Neither SSL_pending() or SSL_has_pending() were taking account of this
DTLS specific app data buffer.

Reviewed-by: Hugo Landau <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #18975)
openssl-machine pushed a commit that referenced this pull request Aug 17, 2022
If the first app data record arrives before the Finished message we should
be able to buffer it and move on to the Finished message.

Reviewed-by: Hugo Landau <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from #18975)
kafei-cy added a commit to kafei-cy/Tongsuo that referenced this pull request Jan 11, 2026
Include 2 commits:
     Fix SSL_pending() and SSL_has_pending() with DTLS
         If app data is received before a Finished message in DTLS then we buffer
         it to return later. The function SSL_pending() is supposed to tell you
         how much processed app data we have already buffered, and SSL_has_pending()
         is supposed to tell you if we have any data buffered (whether processed or
         not, and whether app data or not).

         Neither SSL_pending() or SSL_has_pending() were taking account of this
         DTLS specific app data buffer.
     Test that swapping the first app data record with Finished msg works
         If the first app data record arrives before the Finished message we should
         be able to buffer it and move on to the Finished message.

(Merged from openssl/openssl#18975)
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: 3.0 Applies to openssl-3.0 branch triaged: bug The issue/pr is/fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants