Skip to content

Example client: larger static memory pool with the compat layer - #12256

Merged
philljj merged 1 commit into
wolfSSL:masterfrom
SparkiDev:fix-client-static-mem-compat
Nov 27, 2026
Merged

philljj merged 1 commit into
wolfSSL:masterfrom
SparkiDev:fix-client-static-mem-compat

Conversation

@SparkiDev

Copy link
Copy Markdown
Contributor

Description

With OPENSSL_EXTRA the compatibility layer copies each peer certificate into a WOLFSSL_X509, where every RDN and subjectAltName is its own small allocation. A public server's leaf can carry dozens of names, which drains the smallest bucket of the 320000 byte WOLFSSL_STATIC_MEMORY pool and the handshake then runs the pool dry. Scale the whole pool to 1280000 bytes for that case, in BSS since the standalone client calls this function once.

Testing

./configure --enable-staticmemory --enable-opensslextra
make
./examples/client/client -h google.com -p 443 -g -d

With OPENSSL_EXTRA the compatibility layer copies each peer certificate
into a WOLFSSL_X509, where every RDN and subjectAltName is its own small
allocation. A public server's leaf can carry dozens of names, which drains
the smallest bucket of the 320000 byte WOLFSSL_STATIC_MEMORY pool and the
handshake then runs the pool dry. Scale the whole pool to 1280000 bytes for
that case, in BSS since the standalone client calls this function once.
@SparkiDev SparkiDev self-assigned this Nov 25, 2026
Copilot AI balanced review requested due to automatic review settings November 25, 2026 00:24

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.

🟢 Approval recommended

The compatibility-layer memory-pool update has no active review issues.

No open issues 🎉

What changed in this PR

Increases the example client’s static memory capacity for compatibility-layer builds to accommodate allocation-heavy peer certificates.

Changes:

  • Uses a 1,280,000-byte pool for standalone builds with OPENSSL_EXTRA or OPENSSL_EXTRA_X509_SMALL.
  • Places the larger pool in static storage to avoid increasing stack usage, while preserving existing sizing for other builds.
  • Updates the cleanup comment to reflect that the pool is not always stack-allocated.
File Description
examples/​client/​client.c Adds the larger compatibility-layer memory pool and clarifies its storage and cleanup comments.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report · Explore what changed →

zephyr-frdm_rw612

  • FLASH: datas +16 B, log_const_area -8 B, rodata +108 B, text +13,816 B (+4.9%, 296,396 B / 67,108,864 B, total: 0% used)
  • RAM: bss +49 B, datas +16 B (+0.1%, 58,423 B / 983,040 B, total: 6% used)

No memory changes detected for:


Catch memory regressions in CI with MemBrowse. Free for open source.

@philljj
philljj merged commit 1c50349 into wolfSSL:master Nov 27, 2026
431 of 433 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