Skip to contentSkip to conversation

freeradius: fix radiusd startup failure due to missing openssl legacy provider

PATCH New Yi Zhao 1 participant 1 message Apr 1

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/1 freeradius: fix radiusd startup failure due to missing openssl legacy provider

Radiusd fails to start because the openssl legacy provider is no longer built by default[1]:

$ radiusd -C -X
FreeRADIUS Version 3.2.8
[snip]
(TLS) Failed loading legacy provider

Add PACKAGECONFIG[legacy-openssl] to enable openssl legacy provider support. When disabled, pass --enable-fips-workaround to configure instead.

Backport two patches to fix the --enable-fips-workaround option.

[1] https://git.openembedded.org/openembedded-core/commit/?id=a150c3580f7f4962152444272c0fe07cfdb72df5

---
 ...y-provider-on-enable-fips-workaround.patch |  62 +++++++++++
 ...y-provider-on-enable-fips-workaround.patch | 104 ++++++++++++++++++
 .../freeradius/freeradius_3.2.8.bb            |   3 +
 3 files changed, 169 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/0001-don-t-load-legacy-provider-on-enable-fips-workaround.patch
 create mode 100644 meta-networking/recipes-connectivity/freeradius/files/0002-don-t-load-legacy-provider-on-enable-fips-workaround.patch
meta-networking/recipes-connectivity/freeradius/files/0001-don-t-load-legacy-provider-on-enable-fips-workaround.patch new file +62 -0
new file mode 100644
index 0000000000..594286cdcf
@@ -0,0 +1,62 @@
+From 2c2c6a460ae8cc655df83c8964595581389676c1 Mon Sep 17 00:00:00 2001
+From: "Alan T. DeKok" <[email protected]>
+Date: Tue, 9 Sep 2025 07:03:21 -0400
+Subject: [PATCH] don't load legacy provider on --enable-fips-workaround. 
+ Fixes #5644
+
+Upstream-Status: Backport
+[https://github.com/FreeRADIUS/freeradius-server/commit/2c2c6a460ae8cc655df83c8964595581389676c1]
+
+Signed-off-by: Yi Zhao <[email protected]>
+---
+ src/main/tls.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/main/tls.c b/src/main/tls.c
+index ba267983b1..c04f3228e4 100644
+--- a/src/main/tls.c
++++ b/src/main/tls.c
+@@ -64,8 +64,11 @@ USES_APPLE_DEPRECATED_API	/* OpenSSL API has been deprecated by Apple */
+ #  include <openssl/provider.h>
+ 
+ static OSSL_PROVIDER *openssl_default_provider = NULL;
++
++#ifndef WITH_FIPS
+ static OSSL_PROVIDER *openssl_legacy_provider = NULL;
+ #endif
++#endif
+ 
+ #define LOG_PREFIX "tls"
+ 
+@@ -3693,6 +3696,7 @@ int tls_global_init(TLS_UNUSED bool spawn_flag, TLS_UNUSED bool check)
+ 		return -1;
+ 	}
+ 
++#ifndef WITH_FIPS
+ 	/*
+ 	 *	Needed for MD4
+ 	 *
+@@ -3703,6 +3707,7 @@ int tls_global_init(TLS_UNUSED bool spawn_flag, TLS_UNUSED bool check)
+ 		ERROR("(TLS) Failed loading legacy provider");
+ 		return -1;
+ 	}
++#endif
+ #endif
+ 
+ 	return 0;
+@@ -3777,10 +3782,12 @@ void tls_global_cleanup(void)
+ 	}
+ 	openssl_default_provider = NULL;
+ 
++#ifndef WITH_FIPS
+ 	if (openssl_legacy_provider && !OSSL_PROVIDER_unload(openssl_legacy_provider)) {
+ 		ERROR("Failed unloading legacy provider");
+ 	}
+ 	openssl_legacy_provider = NULL;
++#endif
+ #endif
+ 
+ 	CONF_modules_unload(1);
+-- 
+2.43.0
+
meta-networking/recipes-connectivity/freeradius/files/0002-don-t-load-legacy-provider-on-enable-fips-workaround.patch new file +104 -0

104 lines not on this page · raw message

meta-networking/recipes-connectivity/freeradius/freeradius_3.2.8.bb +3 -0
index 9b05968638..4be127209b 100644
@@ -40,6 +40,8 @@ SRC_URI = "git://github.com/FreeRADIUS/freeradius-server.git;branch=v3.2.x;lfs=0
     file://0018-update-license-1.patch \
     file://0019-update-license-2.patch \
     file://0020-update-license-3.patch \
+    file://0001-don-t-load-legacy-provider-on-enable-fips-workaround.patch \
+    file://0002-don-t-load-legacy-provider-on-enable-fips-workaround.patch \
 "
 
 raddbdir = "${sysconfdir}/${MLPREFIX}raddb"
@@ -114,6 +116,7 @@ PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl"
 PACKAGECONFIG[rlm-eap-fast] = "--with-rlm_eap_fast, --without-rlm_eap_fast"
 PACKAGECONFIG[rlm-eap-pwd] = "--with-rlm_eap_pwd, --without-rlm_eap_pwd"
 PACKAGECONFIG[kafka] = "--with-rlm_kafka, --without-rlm_kafka, librdkafka"
+PACKAGECONFIG[legacy-openssl] = ",--enable-fips-workaround,,openssl-ossl-module-legacy"
 
 inherit useradd autotools-brokensep update-rc.d systemd multilib_script multilib_header
 
Signature · 1 line
2.34.1