Add Enable/DisableNormalMasterSecret APIs to enforce EMS requirement at runtime. Disable server EMS when DisableExtendedMasterSecret is called, not just client EMS.#10978
Conversation
…at runtime. Disable server EMS when DisableExtendedMasterSecret is called, not just client EMS.
There was a problem hiding this comment.
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.
|
|
Retest this please |
Description
Fixes zd#21980
Testing
Built-in tests plus added tests
Checklist