Skip to content

tls13: set sess_free_cb to null after calling.#10989

Open
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:sess_free_cb
Open

tls13: set sess_free_cb to null after calling.#10989
philljj wants to merge 1 commit into
wolfSSL:masterfrom
philljj:sess_free_cb

Conversation

@philljj

@philljj philljj commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Set ->sess_free_cb = NULL; after calling session free callback and nulling the session.

Fixes zd#22190.

@philljj philljj self-assigned this Jul 24, 2026
Copilot AI review requested due to automatic review settings July 24, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 hardens the TLS 1.3 PSK/session-ticket handling in DoPreSharedKeys() by clearing the session free callback pointer after it has been invoked, alongside the existing session pointer and callback-context cleanup. This reduces the chance of accidental double-invocation if the current PSK entry is revisited or reused after cleanup.

Changes:

  • After invoking current->sess_free_cb(...), set current->sess_free_cb = NULL in all relevant cleanup paths.
  • Keep cleanup consistent with the existing pattern of nulling current->sess and zeroing current->sess_free_cb_ctx.

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

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.

2 participants