Skip to content

Add example of certificate + PSK auth. - #621

Open
anhu wants to merge 3 commits into
wolfSSL:masterfrom
anhu:psk_with_cert
Open

anhu wants to merge 3 commits into
wolfSSL:masterfrom
anhu:psk_with_cert

Conversation

@anhu

@anhu anhu commented Aug 27, 2026

Copy link
Copy Markdown
Member

Fixes ZD 22369

@anhu
anhu requested a review from wolfSSL-Bot August 27, 2026 14:13
@anhu anhu assigned wolfSSL-Bot and anhu and unassigned wolfSSL-Bot and anhu Aug 27, 2026
@philljj
philljj requested review from philljj and wolfSSL-Fenrir-bot and removed request for wolfSSL-Bot September 18, 2026 19:12

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #621

Scan targets checked: wolfssl-examples-src, wolfssl-examples-bugs

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread tls/server-tls13-psk-with-certs.c Outdated

/* Set up the external PSK */
wolfSSL_CTX_set_psk_server_tls13_callback(ctx, my_psk_server_tls13_cb);
wolfSSL_CTX_use_psk_identity_hint(ctx, "wolfssl server");

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove identity hint. Apparently this is a TLS 1.2 thing.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 22:23

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #621

Scan targets checked: wolfssl-examples-src, wolfssl-examples-bugs
Not reviewed (no scan target covers them): .github/examples-manifest.yml, tls/README.md
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Review tier: Max

Comment thread tls/server-tls13-psk-with-certs.c Resolved

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.

🟡 Changes recommended

The client does not verify the expected server identity, allowing a peer with the PSK and a different certificate from the trusted CA to impersonate the target.

3 open issues
What changed in this PR

Adds TLS 1.3 client/server examples demonstrating certificate authentication combined with an external pre-shared key (PSK), following RFC 9973.

Changes:

  • Configure matching PSK callbacks, mandatory PSK negotiation, and peer-certificate verification.
  • Document wolfSSL build requirements and commands to run the examples.
  • Enable PSK and certificate-with-external-PSK support in the TLS CI build profile.
File Description
tls/​server-tls13-psk-with-certs.c Adds the combined-authentication server and message exchange loop.
tls/​README.md Explains authentication requirements, build options, and usage.
tls/​client-tls13-psk-with-certs.c Adds the matching client and interactive message exchange.
.github/​examples-manifest.yml Enables the required wolfSSL features for TLS builds.

Review effort: Balanced

Comment thread tls/client-tls13-psk-with-certs.c Resolved
Comment thread tls/client-tls13-psk-with-certs.c Resolved
Comment thread tls/server-tls13-psk-with-certs.c Resolved

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #621

Fenrir already completed a review of this PR at commit fffb84dedcf9 (run 4291); its findings are the review threads on the PR. Push a new commit to request another review.

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