Guard wolfSSL_CTX_set_alpn_protos with HAVE_ALPN - #11232
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns the OpenSSL-compat ALPN API surface so wolfSSL_CTX_set_alpn_protos() is only available when ALPN support is actually compiled in (HAVE_ALPN) and BIO is available (!NO_BIO), matching the existing guard pattern used for wolfSSL_set_alpn_protos().
Changes:
- Guarded
wolfSSL_CTX_set_alpn_protos()(and its header declaration) withHAVE_ALPN && !NO_BIO. - Moved the implementation guard in
src/ssl_api_ext.cso both ALPN “set protos” functions share the same compile-time conditions. - Updated API tests to only reference
wolfSSL_CTX_set_alpn_protos()when the symbol is available.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| wolfssl/ssl.h | Wraps wolfSSL_CTX_set_alpn_protos() / wolfSSL_set_alpn_protos() declarations with HAVE_ALPN && !NO_BIO under OPENSSL_EXTRA. |
| src/ssl_api_ext.c | Moves HAVE_ALPN / !NO_BIO guards upward to include wolfSSL_CTX_set_alpn_protos(). |
| tests/api/test_ssl_ext.c | Updates the invalid-args test guard to include HAVE_ALPN && !NO_BIO. |
| tests/api.c | Avoids defining/using ALPN protos variables unless OPENSSL_EXTRA && HAVE_ALPN && !NO_BIO, matching availability. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
c353ad3 to
2c7e1a8
Compare
|
retest this please (ERROR: Build 'PRB-generic-config-parser' failed with result: FAILURE) |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #11232
Scan targets checked: wolfcrypt-rs-bugs, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
Description
This was found while investigating F-10717.
This does not change the default build options which is the main thing that F-10717 is identifying. Rather, a secondary finding related was that the
wolfSSL_CTX_set_alpn_protosfunction was not guarded byHAVE_ALPN. I moved the guard inssl_api_ext.cup so thatwolfSSL_CTX_set_alpn_protosis guarded the same aswolfSSL_set_alpn_protosbelow it.Testing
How did you test?
Checklist