-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Libwebsockets: temp fix for mbedtls 3.6+
3.6 removed mbedtls_x509_get_cert into private header, redefined it in resonable place to temperatly fix it, and make it not depend on mbedtls_version_C. everything is upstreamed so won't need when upstrea release 4.3.4 Signed-off-by: Seo Suchan <tjtncks@gmail.com>
- Loading branch information
1 parent
7157d5a
commit 8eb0d2d
Showing
3 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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(+) | ||
|
||
diff --git a/lib/tls/mbedtls/private-lib-tls-mbedtls.h b/lib/tls/mbedtls/private-lib-tls-mbedtls.h | ||
index 162d9726..73f49c01 100644 | ||
--- 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_crt *x509, enum lws_tls_cert_info type, | ||
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); | ||
-- | ||
2.39.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
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, 9 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/lib/core/context.c b/lib/core/context.c | ||
index b9b724ed..dc1a09a0 100644 | ||
--- a/lib/core/context.c | ||
+++ b/lib/core/context.c | ||
@@ -788,11 +788,16 @@ lws_create_context(const struct lws_context_creation_info *info) | ||
#endif /* network */ | ||
|
||
#if defined(LWS_WITH_MBEDTLS) | ||
- mbedtls_version_get_string(mbedtls_version); | ||
-#endif | ||
+ { | ||
+ char mbedtls_version[32]; | ||
|
||
-#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 | ||
-- | ||
2.39.2 | ||
|