Skip to content

Ensure close_notify is sent after user_canceled during quiet shutdown - #11225

Open
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:gh11131
Open

Ensure close_notify is sent after user_canceled during quiet shutdown#11225
holtrop-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
holtrop-wolfssl:gh11131

Conversation

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor

Description

Ensure close_notify is sent after user_canceled during quiet shutdown

Fixes #11131

Testing

How did you test?

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@holtrop-wolfssl holtrop-wolfssl self-assigned this Aug 20, 2026
Copilot AI lite review requested due to automatic review settings August 20, 2026 20:44

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

This PR ensures that when a user_canceled alert is sent, a subsequent close_notify is still emitted during quiet shutdown, aligning shutdown behavior with the protocol expectation described in the TLS spec and addressing #11131.

Changes:

  • Track whether a user_canceled has been sent (or queued) so quiet shutdown can still send the required close_notify.
  • Update wolfSSL_shutdown() quiet-shutdown path to flush/emit close_notify when user_canceled occurred.
  • Add a regression test covering quiet shutdown behavior after wolfSSL_SendUserCanceled().

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

File Description
wolfssl/internal.h Adds an options bit to record user_canceled state relevant to shutdown behavior.
src/ssl_api_rw.c Implements the quiet-shutdown exception to still send close_notify after user_canceled.
src/ssl.c Initializes the new options bit during SSL object reset/init.
tests/api/test_ssl_rw.[ch] Registers and adds a new test validating the quiet shutdown + user_canceled behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/api/test_ssl_rw.c
Comment thread src/ssl_api_rw.c
Comment thread tests/api/test_ssl_rw.c
Comment thread wolfssl/internal.h
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m3

  • FLASH: .text +172 B (+0.1%, 125,687 B / 262,144 B, total: 48% used)

gcc-arm-cortex-m4

  • FLASH: .text +128 B (+0.1%, 204,207 B / 262,144 B, total: 78% used)

gcc-arm-cortex-m4-dtls13

  • FLASH: .text +192 B (+0.1%, 185,660 B / 1,048,576 B, total: 18% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .text +192 B (+0.0%, 779,028 B / 1,048,576 B, total: 74% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +128 B (+0.0%, 300,124 B / 1,048,576 B, total: 29% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .text +128 B (+0.0%, 330,672 B / 1,048,576 B, total: 32% used)

gcc-arm-cortex-m4-tls12

  • FLASH: .text +192 B (+0.2%, 126,451 B / 262,144 B, total: 48% used)

gcc-arm-cortex-m4-tls13

  • FLASH: .text +64 B (+0.0%, 240,865 B / 262,144 B, total: 92% used)

gcc-arm-cortex-m7

  • FLASH: .text +192 B (+0.1%, 204,207 B / 262,144 B, total: 78% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +128 B (+0.0%, 301,020 B / 1,048,576 B, total: 29% used)

gcc-arm-cortex-m7-tls13

  • FLASH: .text +128 B (+0.1%, 240,929 B / 262,144 B, total: 92% used)

linuxkm-standard

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor Author

retest this please (build removed)

@holtrop-wolfssl

Copy link
Copy Markdown
Contributor Author

retest this please (fatal: early EOF
fatal: fetch-pack: invalid index-pack output
)

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.

quietShutdown can suppress the close_notify required after user_canceled

3 participants