diff mbox series

[meta-oe,master/wrynose] libwebsockets: fix build against OpenSSL 3.5

Message ID 20260604-libweb2-v1-1-004afc9f92bd@ti.com
State New
Headers show
Series [meta-oe,master/wrynose] libwebsockets: fix build against OpenSSL 3.5 | expand

Commit Message

Kamlesh Gurudasani June 4, 2026, 9:41 a.m. UTC
OpenSSL 3.5 (first shipped in wrynose) made HMAC_CTX a fully opaque
type by removing its struct definition from the public headers. It was
deprecated since OpenSSL 3.0 but the struct remained visible until 3.5.

libwebsockets uses HMAC_CTX_new() to detect which form to use in its
lws-genhash.h public header: if found it uses HMAC_CTX *ctx (pointer),
otherwise it falls back to HMAC_CTX ctx (embedded struct).

In cross-compilation the CMake CHECK_FUNCTION_EXISTS probe for
HMAC_CTX_new can fail due to native libraries being incorrectly pulled
into the aarch64 link test, causing the function to be reported as not
found. Before OpenSSL 3.5 this was a silent failure: the fallback
embedded struct still compiled fine. With OpenSSL 3.5 the fallback
now fails with "field has incomplete type".

Force LWS_HAVE_HMAC_CTX_new=ON so the pointer form is always used.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
---
 meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.5.8.bb | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 39321ae90b64e8f2bd890a2957a5f80e74d4de30
change-id: 20260604-libweb2-6a985e84804f

Best regards,
diff mbox series

Patch

diff --git a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.5.8.bb b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.5.8.bb
index a18f88390e..fc65890d8d 100644
--- a/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.5.8.bb
+++ b/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.5.8.bb
@@ -35,6 +35,7 @@  python __anonymous() {
 EXTRA_OECMAKE += " \
     -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
     -DLWS_WITHOUT_TESTAPPS=ON \
+    -DLWS_HAVE_HMAC_CTX_new=ON \
 "
 
 do_compile:prepend() {