1From 78494ea005bd38324953b05176d6eb2c3f55af2c Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Sun, 8 Jan 2023 23:21:24 +0800
4Subject: [PATCH] bootstrap: check commands of openssl exist
5
6It calls openssl commands dhparam and pkcs12 in script bootstrap. These
7commands are configurable based on configure options 'no-dh' and
8'no-des', and may not be provided by openssl. So check existence of
9these commands. If not, abort running of script bootstrap.
10
111. https://github.com/openssl/openssl/blob/master/apps/build.info#L37
122. https://github.com/openssl/openssl/blob/master/apps/build.info#L22
13
14Upstream-Status: Denied [https://github.com/FreeRADIUS/freeradius-server/pull/4059]
15				 The maintainer commented in the pull that the script could
16				 be run on a host which provides these openssl commands.
17
18Signed-off-by: Kai Kang <kai.kang@windriver.com>
19---
20 raddb/certs/bootstrap | 8 ++++++++
21 1 file changed, 8 insertions(+)
22
23diff --git a/raddb/certs/bootstrap b/raddb/certs/bootstrap
24index 57de8cf0d7..4641c71700 100755
25--- a/raddb/certs/bootstrap
26+++ b/raddb/certs/bootstrap
27@@ -13,6 +13,14 @@
28 umask 027
29 cd `dirname $0`
30
31+#  check commands of openssl exist
32+for cmd in dhparam pkcs12; do
33+	if ! openssl ${cmd} -help >/dev/null 2>&1; then
34+		echo "Error: command ${cmd} is not supported by openssl."
35+		exit 1
36+	fi
37+done
38+
39 make -h > /dev/null 2>&1
40
41 #
42--
432.25.1
44
45