Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libwebsocket: fix compile with mbedtls and update to 4.3.3 #24071

Merged
merged 2 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions libs/libwebsockets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=libwebsockets
PKG_VERSION:=4.3.2
PKG_RELEASE:=3
PKG_VERSION:=4.3.3
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=6a85a1bccf25acc7e8e5383e4934c9b32a102880d1e4c37c70b27ae2a42406e1
PKG_HASH:=6fd33527b410a37ebc91bb64ca51bdabab12b076bc99d153d7c5dd405e4bdf90

PKG_SOURCE_VERSION:=v$(PKG_VERSION)

Expand Down
26 changes: 0 additions & 26 deletions libs/libwebsockets/patches/010-fix-enum-int-mismatch-openssl.patch

This file was deleted.

14 changes: 0 additions & 14 deletions libs/libwebsockets/patches/011-fix-enum-int-mismatch-mbedtls.patch

This file was deleted.

23 changes: 23 additions & 0 deletions libs/libwebsockets/patches/110-mbedtls36_compilefix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 017dfcb144c557bb4bc72669168ad7b70a34ce57 Mon Sep 17 00:00:00 2001
From: Seo Suchan <tjtncks@gmail.com>
Date: Fri, 3 May 2024 17:18:46 +0900
Subject: [PATCH 1/2] mbedtls: fix compile on mbedtls 3.6+ they moved
mbedtls_x509_get_name into interal zone, this declares it again in a file I
looked approperate to hold one

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
---
lib/tls/mbedtls/private-lib-tls-mbedtls.h | 5 +++++
1 file changed, 5 insertions(+)

--- a/lib/tls/mbedtls/private-lib-tls-mbedtls.h
+++ b/lib/tls/mbedtls/private-lib-tls-mbedtls.h
@@ -57,3 +57,8 @@ lws_tls_mbedtls_cert_info(mbedtls_x509_c
int
lws_x509_get_crt_ext(mbedtls_x509_crt *crt, mbedtls_x509_buf *skid,
lws_mbedtls_x509_authority *akid);
+
+/* redefine hidden mbedtls internal functions*/
+int
+mbedtls_x509_get_name(unsigned char **p, const unsigned char *end,
+ mbedtls_x509_name *cur);
36 changes: 36 additions & 0 deletions libs/libwebsockets/patches/120-removed-mbedtlsverc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From adcc5a1ccb9f6ffe9fca793ea67e6c3e7ad8274a Mon Sep 17 00:00:00 2001
From: Seo Suchan <tjtncks@gmail.com>
Date: Tue, 7 May 2024 12:46:08 +0900
Subject: [PATCH 2/2] mbedtls: make it no longer depend on mbedtls_version_c
complie flag

everything that code does is already done as macro constants
and openwrt doesn't build with mbedtls with that flag by default

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
---
lib/core/context.c | 13 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

--- a/lib/core/context.c
+++ b/lib/core/context.c
@@ -788,11 +788,15 @@ lws_create_context(const struct lws_cont
#endif /* network */

#if defined(LWS_WITH_MBEDTLS)
- mbedtls_version_get_string(mbedtls_version);
-#endif
+ {

-#if defined(LWS_WITH_MBEDTLS)
- lwsl_cx_notice(context, "LWS: %s, MbedTLS-%s %s%s", library_version, mbedtls_version, opts_str, s);
+#if defined(MBEDTLS_VERSION_C)
+ mbedtls_version_get_string(mbedtls_version);
+#else
+ lws_snprintf(mbedtls_version, sizeof(mbedtls_version), "%s", MBEDTLS_VERSION_STRING);
+#endif
+ lwsl_cx_notice(context, "LWS: %s, MbedTLS-%s %s%s", library_version, mbedtls_version, opts_str, s);
+ }
#else
lwsl_cx_notice(context, "LWS: %s, %s%s", library_version, opts_str, s);
#endif