Skip to content

Prevent session ticket nonce overflow#9884

Merged
douzzer merged 1 commit intowolfSSL:masterfrom
Frauschi:f-204
Mar 7, 2026
Merged

Prevent session ticket nonce overflow#9884
douzzer merged 1 commit intowolfSSL:masterfrom
Frauschi:f-204

Conversation

@Frauschi
Copy link
Copy Markdown
Contributor

@Frauschi Frauschi commented Mar 5, 2026

F-204

@douzzer douzzer added the Staged Staged for merge pending final test results and review label Mar 5, 2026
@douzzer douzzer removed the Staged Staged for merge pending final test results and review label Mar 5, 2026
Copy link
Copy Markdown
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

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

[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,
      |                                        ^

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 SendTls13NewSessionTicket before 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.

Comment thread src/tls13.c
Comment thread wolfssl/error-ssl.h Outdated
@Frauschi
Copy link
Copy Markdown
Contributor Author

Frauschi commented Mar 6, 2026

./wolfssl/error-ssl.h:243:40: error: comma at end of enumerator list [-Werror=pedantic]
  243 |     WOLFSSL_LAST_E               = -517,
      |                                        ^

Fixed now.

@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi Mar 6, 2026
@Frauschi Frauschi requested a review from douzzer March 6, 2026 09:23
@Frauschi
Copy link
Copy Markdown
Contributor Author

Frauschi commented Mar 6, 2026

Jenkins retest this please

1 similar comment
@Frauschi
Copy link
Copy Markdown
Contributor Author

Frauschi commented Mar 6, 2026

Jenkins retest this please

@philljj philljj added the For This Release Release version 5.9.1 label Mar 6, 2026
@douzzer douzzer added the Staged Staged for merge pending final test results and review label Mar 6, 2026
@douzzer douzzer merged commit 45d814e into wolfSSL:master Mar 7, 2026
453 of 455 checks passed
@Frauschi Frauschi deleted the f-204 branch March 17, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.1 Staged Staged for merge pending final test results and review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants