summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2026-05-08 09:54:12 +0100
committerKhem Raj <khem.raj@oss.qualcomm.com>2026-05-12 01:10:18 -0700
commit088013da95860f94983b3efeab6354e3b92be53b (patch)
tree53c0ccedd5e2a5679cf0560a11ff012b38f39649
parent2fdc97fac5cdcbf4f1dbdb074ff237f195af771d (diff)
downloadmeta-openembedded-088013da95860f94983b3efeab6354e3b92be53b.tar.gz
mdns: Update for mbedtls4, set daemon version
Switch to psa_crypto_init() which initialises all crypto subsystems, this works for both Mbed TLS 3 and 4. Also set the daemon version so it's correctly reported at runtime. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
-rw-r--r--meta-networking/recipes-protocols/mdns/mdns/0001-mDNSPosix-Rework-mbedtls-for-compatibility-with-mbed.patch57
-rw-r--r--meta-networking/recipes-protocols/mdns/mdns_2881.100.56.0.1.bb4
2 files changed, 60 insertions, 1 deletions
diff --git a/meta-networking/recipes-protocols/mdns/mdns/0001-mDNSPosix-Rework-mbedtls-for-compatibility-with-mbed.patch b/meta-networking/recipes-protocols/mdns/mdns/0001-mDNSPosix-Rework-mbedtls-for-compatibility-with-mbed.patch
new file mode 100644
index 0000000000..a561fd232f
--- /dev/null
+++ b/meta-networking/recipes-protocols/mdns/mdns/0001-mDNSPosix-Rework-mbedtls-for-compatibility-with-mbed.patch
@@ -0,0 +1,57 @@
1From f4f5039eb90918b5248bd6266afdad0b33b2d010 Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Thu, 30 Apr 2026 08:21:19 +0100
4Subject: [PATCH] mDNSPosix: Rework mbedtls for compatibility with mbedtls4
5
6Upstream-Status: Inactive-Upstream [Upstream does not take patches]
7Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
8---
9 mDNSPosix/mbedtls.c | 21 +++++----------------
10 1 file changed, 5 insertions(+), 16 deletions(-)
11
12diff --git a/mDNSPosix/mbedtls.c b/mDNSPosix/mbedtls.c
13index 6726ef9b9145..c4b7fd4edfff 100644
14--- a/mDNSPosix/mbedtls.c
15+++ b/mDNSPosix/mbedtls.c
16@@ -29,14 +29,10 @@
17 #include <errno.h>
18 #include <unistd.h>
19
20+#include <psa/crypto.h>
21+
22 #include <mbedtls/error.h>
23-#include <mbedtls/pk.h>
24-#include <mbedtls/ecp.h>
25-#include <mbedtls/ecdsa.h>
26-#include <mbedtls/entropy.h>
27-#include <mbedtls/ctr_drbg.h>
28-#include <mbedtls/sha256.h>
29-#include <mbedtls/base64.h>
30+#include <mbedtls/psa_util.h>
31
32 #include <mbedtls/x509.h>
33 #include <mbedtls/ssl.h>
34@@ -53,21 +49,14 @@ struct TLSServerContext_struct {
35 mbedtls_ssl_config config;
36 };
37
38-// Context that is shared amongs all TLS connections, regardless of which server cert/key is in use.
39-static mbedtls_entropy_context entropy;
40-static mbedtls_ctr_drbg_context ctr_drbg;
41-
42 mDNSBool
43 mDNSPosixTLSInit(void)
44 {
45 int status;
46
47- mbedtls_entropy_init(&entropy);
48- mbedtls_ctr_drbg_init(&ctr_drbg);
49-
50- status = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, NULL, 0);
51+ status = psa_crypto_init();
52 if (status != 0) {
53- LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "Unable to seed RNG: %x", -status);
54+ LogRedact(MDNS_LOG_CATEGORY_DEFAULT, MDNS_LOG_ERROR, "PSA crypto init failed: %x", -status);
55 return mDNSfalse;
56 }
57 return mDNStrue;
diff --git a/meta-networking/recipes-protocols/mdns/mdns_2881.100.56.0.1.bb b/meta-networking/recipes-protocols/mdns/mdns_2881.100.56.0.1.bb
index 10560d795a..48e7a8d52d 100644
--- a/meta-networking/recipes-protocols/mdns/mdns_2881.100.56.0.1.bb
+++ b/meta-networking/recipes-protocols/mdns/mdns_2881.100.56.0.1.bb
@@ -15,6 +15,7 @@ SRC_URI = "git://github.com/apple-oss-distributions/mDNSResponder;protocol=https
15 file://0001-Fix-build-with-gcc-15.patch \ 15 file://0001-Fix-build-with-gcc-15.patch \
16 file://mdns.service \ 16 file://mdns.service \
17 file://0007-mDNSShared-Make-Apple-Wireless-Direct-Link-depend-on.patch \ 17 file://0007-mDNSShared-Make-Apple-Wireless-Direct-Link-depend-on.patch \
18 file://0001-mDNSPosix-Rework-mbedtls-for-compatibility-with-mbed.patch \
18 " 19 "
19BRANCH = "rel/mDNSResponder-2881" 20BRANCH = "rel/mDNSResponder-2881"
20SRCREV = "ea3902cfeff86a04b4c684753c80e425edbd1a21" 21SRCREV = "ea3902cfeff86a04b4c684753c80e425edbd1a21"
@@ -47,7 +48,8 @@ EXTRA_OEMAKE = "os=linux 'CC=${CCLD}' 'LD=${CCLD}' 'LINKOPTS=${LDFLAGS}' STRIP=:
47 48
48# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string, 49# MDNS_VERSIONSTR_NODTS disables __DATE__ and __TIME__ in the version string,
49# which are fixed anyway for build reproducibility. 50# which are fixed anyway for build reproducibility.
50TARGET_CPPFLAGS += "-DMDNS_VERSIONSTR_NODTS" 51TARGET_CPPFLAGS += "-DmDNSResponderVersion=${PV} \
52 -DMDNS_VERSIONSTR_NODTS"
51 53
52TARGET_CC_ARCH += "${LDFLAGS}" 54TARGET_CC_ARCH += "${LDFLAGS}"
53 55