Skip to content

Use SNI in google.test, return MEMORY_E instead of DECODE_E - #11968

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
padelsbach:google-test-sni
Nov 3, 2026
Merged

philljj merged 1 commit into
wolfSSL:masterfrom
padelsbach:google-test-sni

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Description

Fixes failing google.test in PRB-generic-config-parser. As of Oct 30, google started replying with 130 SAN in response to the client handshake in google.test. This causes the test to fail since it does not have memory to store all of them. Fix is to use the -S option on the client app to enable SNI and get a single SAN.

Also fixes the return code from ProcessPeerCerts to properly indicate the failure condition.

Testing

CI, added unit tests

Checklist

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

Copilot AI balanced review requested due to automatic review settings November 3, 2026 03:31

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 test guard still permits --enable-trackmemory, allowing tracked and native allocators to mix during cleanup and cause invalid frees that can crash the test process.

1 open issue
What changed in this PR

This PR addresses google.test failures caused by large default certificates and corrects memory-allocation error reporting during peer-certificate processing.

Changes:

  • Enable SNI in Google connection tests when supported.
  • Propagate MEMORY_E when copying the peer certificate fails.
  • Add TLS 1.2 and TLS 1.3 regression tests for that failure.
File Description
tests/​api/​test_ssl_cert.h Declares and registers the new regression test.
tests/​api/​test_ssl_cert.c Adds allocation-failure tests for peer-certificate copying.
src/​internal.c Preserves the certificate-copy memory error.
scripts/​google.test Detects SNI support and supplies the server name.

Review effort: Balanced

Comment thread tests/api/test_ssl_cert.c Resolved
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

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

Allocator capture is skipped after setup failures, so the unconditional restore can install NULL callbacks and crash cleanup in track-memory builds.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread tests/api/test_ssl_cert.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 #11968

Scan targets checked: wolfssl-src, wolfssl-bugs
Not reviewed (no scan target covers them): scripts/google.test, tests/api/test_ssl_cert.h
Coverage: 1 of 2 in-scope changed file(s) opened by the reviewer; not opened: tests/api/test_ssl_cert.c

Fenrir result: Approved ✅

No new issues found in the changed files.

Advisory only — this automated result does not count as a GitHub approval.

Review tier: Lite

@philljj philljj self-assigned this Nov 3, 2026
@philljj

philljj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

note: the multi-test failure is unrelated and a known issue being fixed separately.

@philljj
philljj merged commit 2e33bfd into wolfSSL:master Nov 3, 2026
429 of 430 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