Skip to content

Add Enable/DisableNormalMasterSecret APIs to enforce EMS requirement at runtime. Disable server EMS when DisableExtendedMasterSecret is called, not just client EMS.#10978

Open
kareem-wolfssl wants to merge 2 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd21980

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes zd#21980

Testing

Built-in tests plus added tests

Checklist

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

…at runtime.

Disable server EMS when DisableExtendedMasterSecret is called, not just client EMS.
@kareem-wolfssl kareem-wolfssl self-assigned this Jul 22, 2026
Copilot AI review requested due to automatic review settings July 22, 2026 22:58

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

Note

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.

Adds runtime controls to enforce TLS Extended Master Secret (EMS) usage by introducing “require EMS” behavior (via disabling the normal master secret) and ensuring server-side EMS disablement is honored, with accompanying error/message updates and new API tests.

Changes:

  • Add public APIs to enable/disable “normal master secret” (effectively requiring EMS) at WOLFSSL and WOLFSSL_CTX levels.
  • Make wolfSSL_DisableExtendedMasterSecret() disable EMS behavior on servers (ignore peer EMS request), not only clients.
  • Add tests covering server-side EMS disable behavior and EMS-required negotiation failure.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
wolfssl/ssl.h Exposes new public APIs for requiring/allowing standard master secret usage.
wolfssl/internal.h Adds disableEMS / requireEMS flags to context and per-connection options.
wolfssl/error-ssl.h Updates EMS-related error code description to match new semantics.
src/tls.c Enforces EMS-required behavior during master secret derivation; server ignores EMS extension when disabled.
src/ssl_api_ext.c Implements new Enable/DisableNormalMasterSecret APIs and updates DisableExtendedMasterSecret semantics.
src/internal.c Propagates new EMS flags from CTX to SSL; updates error string; server ignores EMS when disabled in PSK path.
tests/api/test_tls_ext.h Declares new EMS tests.
tests/api/test_tls_ext.c Adds new EMS behavior tests and API-level tests for new functions.
tests/api.c Registers new tests in the runner.

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

Comment thread tests/api/test_tls_ext.c Outdated
Comment thread tests/api/test_tls_ext.c Outdated
Comment thread src/tls.c Outdated
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m3

  • FLASH: .text +192 B (+0.2%, 122,731 B / 262,144 B, total: 47% used)

gcc-arm-cortex-m4-openssl-compat

  • FLASH: .rodata +24 B, .text +256 B (+0.0%, 769,492 B / 1,048,576 B, total: 73% used)

gcc-arm-cortex-m4-rsa-only

  • FLASH: .text +256 B (+0.1%, 326,168 B / 1,048,576 B, total: 31% used)

gcc-arm-cortex-m4-tls12

  • FLASH: .text +192 B (+0.2%, 123,483 B / 262,144 B, total: 47% used)

linuxkm-standard

@kareem-wolfssl

Copy link
Copy Markdown
Contributor Author

Retest this please

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.

3 participants