Skip to content

Conversation

@rizlik
Copy link
Contributor

@rizlik rizlik commented Jan 5, 2026

Description

  1. check that we are resuming or using PSK when invoking wolfSSL_write_early_data, error otherwise
  2. set ssl->earlyData == expecting_early_data only on the first wolfSSL_write_early_data invocation
  3. merge consecutive section guarded by the same macro

rizlik added 3 commits January 5, 2026 09:04
Avoid resetting ssl->earlyData in wolfSSL_write_early_data when the
function is re-entered due to WC_PENDING_E, WANT_WRITE, or WANT_READ.
Copy link
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 enhances the early data handling in TLS 1.3 by adding validation checks and refactoring redundant code. The changes ensure that early data can only be sent when session resumption or PSK is available, and improve the state management when wolfSSL_write_early_data is invoked multiple times.

Key Changes:

  • Introduces EarlyDataPossible() helper function to validate early data prerequisites
  • Adds validation in wolfSSL_write_early_data to verify resumption/PSK before allowing early data
  • Fixes state management to avoid re-setting ssl->earlyData on function re-entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rizlik rizlik requested a review from julek-wolfssl January 5, 2026 11:57
@rizlik
Copy link
Contributor Author

rizlik commented Jan 7, 2026

retest this please

@rizlik rizlik requested a review from julek-wolfssl January 7, 2026 17:27
@rizlik rizlik assigned julek-wolfssl and unassigned rizlik Jan 7, 2026
@dgarske dgarske merged commit 97d9bfc into wolfSSL:master Jan 8, 2026
393 of 395 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants