Prevent session ticket nonce overflow#9884
Merged
douzzer merged 1 commit intowolfSSL:masterfrom Mar 7, 2026
Merged
Conversation
douzzer
requested changes
Mar 5, 2026
Contributor
douzzer
left a comment
There was a problem hiding this comment.
[allcryptonly-gcc-c89] [20 of 56] [81a691f13d]
configure... real 0m8.089s user 0m4.478s sys 0m4.389s
In file included from ./wolfssl/ssl.h:35,
from ./wolfssl/openssl/ssl.h:39,
from ./wolfssl/openssl/aes.h:44,
from conftest.c:78:
8690a9da4b (<tobias@wolfssl.com> 2026-03-05 17:45:42 +0100 243) WOLFSSL_LAST_E = -517,
./wolfssl/error-ssl.h:243:40: error: comma at end of enumerator list [-Werror=pedantic]
243 | WOLFSSL_LAST_E = -517,
| ^
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds overflow protection for session ticket nonces in TLS 1.3. Since the nonce is stored as a single byte, it can overflow after 255 tickets, and this change prevents that by returning a new error code.
Changes:
- Adds a new error code
SESSION_TICKET_NONCE_OVERFLOW(-517) to the error enum. - Adds an overflow check in
SendTls13NewSessionTicketbefore incrementing the nonce. - Adds the corresponding human-readable error string in
wolfSSL_ERR_reason_error_string.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| wolfssl/error-ssl.h | Adds new SESSION_TICKET_NONCE_OVERFLOW error code and updates WOLFSSL_LAST_E |
| src/tls13.c | Adds nonce overflow check before incrementing the ticket nonce |
| src/internal.c | Adds error string mapping for the new error code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
Fixed now. |
Contributor
Author
|
Jenkins retest this please |
1 similar comment
Contributor
Author
|
Jenkins retest this please |
douzzer
approved these changes
Mar 7, 2026
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.
F-204