Skip to content

Fix DoKexDhReply() to reject the server's pub key if no PublicKeyCheck callback is registered#917

Merged
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom
yosuke-wolfssl:f_2471
Apr 15, 2026
Merged

Fix DoKexDhReply() to reject the server's pub key if no PublicKeyCheck callback is registered#917
JacobBarthelmeh merged 3 commits intowolfSSL:masterfrom
yosuke-wolfssl:f_2471

Conversation

@yosuke-wolfssl
Copy link
Copy Markdown
Contributor

This PR fixes the default behavior of DoKexDhReplay() so that this rejects the pub key if no callback is registered.
Also, the new regression test case is added for that.

@yosuke-wolfssl yosuke-wolfssl self-assigned this Apr 15, 2026
Copilot AI review requested due to automatic review settings April 15, 2026 01:47
Copy link
Copy Markdown
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 tightens the client-side KEXDH reply handling by changing DoKexDhReply() to reject a server host key when no PublicKeyCheck callback is registered, and adds a regression test to ensure this behavior is enforced.

Changes:

  • Update DoKexDhReply() to return WS_PUBKEY_REJECTED_E when publicKeyCheckCb is NULL.
  • Extend the KEXDH reply regression harness to optionally skip registering PublicKeyCheck.
  • Add regression coverage asserting handshake failure when no PublicKeyCheck callback is configured.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/internal.c Changes default KEXDH reply behavior to reject server public keys when no verification callback is registered.
tests/regress.c Adds a regression test and harness option to validate the new default rejection behavior.

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

@JacobBarthelmeh JacobBarthelmeh merged commit f291d99 into wolfSSL:master Apr 15, 2026
131 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