tests/api: add DTLS 1.3 server CTX reuse ticket regression test#10797
Open
Spongman wants to merge 2 commits into
Open
tests/api: add DTLS 1.3 server CTX reuse ticket regression test#10797Spongman wants to merge 2 commits into
Spongman wants to merge 2 commits into
Conversation
test_dtls13_server_ctx_reuse_ticket reproduces a BAD_STATE_E fatal error that occurs when a WOLFSSL_CTX is reused across successive DTLS 1.3 handshakes after issuing a NewSessionTicket. Root cause: TicketEncCbCtx_ChooseKey() refuses to use a key unless expirary[i] >= now + ticketHint, but only generates a replacement when expirary[i] < now. When ticketHint > WOLFSSL_TICKET_KEY_LIFETIME / 2 (e.g. because wolfSSL_CTX_set_timeout() was called with a large value), both keys can be simultaneously alive yet unable to cover the hint window, hitting the BAD_STATE_E branch and causing wolfSSL_accept() to fail fatally on every handshake after the first. test_dtls13_server_ctx_reuse_no_ticket_ok is the control: the same scenario with TLS 1.3 tickets suppressed passes, isolating the fault to NewSessionTicket issuance tainting the reused CTX.
|
Can one of the admins verify this patch? |
test_dtls13_server_ctx_reuse_ticket reproduces a BAD_STATE_E fatal error that occurs when a WOLFSSL_CTX is reused across successive DTLS 1.3 handshakes after issuing a NewSessionTicket. Root cause: TicketEncCbCtx_ChooseKey() refuses to use a key unless expirary[i] >= now + ticketHint, but only generates a replacement when expirary[i] < now. When ticketHint > WOLFSSL_TICKET_KEY_LIFETIME / 2 (e.g. because wolfSSL_CTX_set_timeout() was called with a large value), both keys can be simultaneously alive yet unable to cover the hint window, hitting the BAD_STATE_E branch and causing wolfSSL_accept() to fail fatally on every handshake after the first. test_dtls13_server_ctx_reuse_no_ticket_ok is the control: the same scenario with TLS 1.3 tickets suppressed passes, isolating the fault to NewSessionTicket issuance tainting the reused CTX.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_dtls13_server_ctx_reuse_ticket reproduces a BAD_STATE_E fatal error that occurs when a WOLFSSL_CTX is reused across successive DTLS 1.3 handshakes after issuing a NewSessionTicket.
Root cause: TicketEncCbCtx_ChooseKey() refuses to use a key unless expirary[i] >= now + ticketHint, but only generates a replacement when expirary[i] < now. When ticketHint > WOLFSSL_TICKET_KEY_LIFETIME / 2 (e.g. because wolfSSL_CTX_set_timeout() was called with a large value), both keys can be simultaneously alive yet unable to cover the hint window, hitting the BAD_STATE_E branch and causing wolfSSL_accept() to fail fatally on every handshake after the first.
test_dtls13_server_ctx_reuse_no_ticket_ok is the control: the same scenario with TLS 1.3 tickets suppressed passes, isolating the fault to NewSessionTicket issuance tainting the reused CTX.
Repros #10796
Testing
(see bug report)
Checklist