Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame^] | 1 | From 78494ea005bd38324953b05176d6eb2c3f55af2c Mon Sep 17 00:00:00 2001 |
| 2 | From: Kai Kang <kai.kang@windriver.com> |
| 3 | Date: Sun, 8 Jan 2023 23:21:24 +0800 |
| 4 | Subject: [PATCH] bootstrap: check commands of openssl exist |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 5 | |
| 6 | It calls openssl commands dhparam and pkcs12 in script bootstrap. These |
| 7 | commands are configurable based on configure options 'no-dh' and |
| 8 | 'no-des', and may not be provided by openssl. So check existence of |
| 9 | these commands. If not, abort running of script bootstrap. |
| 10 | |
| 11 | 1. https://github.com/openssl/openssl/blob/master/apps/build.info#L37 |
| 12 | 2. https://github.com/openssl/openssl/blob/master/apps/build.info#L22 |
| 13 | |
| 14 | Upstream-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 | |
| 18 | Signed-off-by: Kai Kang <kai.kang@windriver.com> |
| 19 | --- |
| 20 | raddb/certs/bootstrap | 8 ++++++++ |
| 21 | 1 file changed, 8 insertions(+) |
| 22 | |
| 23 | diff --git a/raddb/certs/bootstrap b/raddb/certs/bootstrap |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame^] | 24 | index 57de8cf0d7..4641c71700 100755 |
Andrew Geissler | f103a7f | 2021-05-07 16:09:40 -0500 | [diff] [blame] | 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 | # |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame^] | 42 | -- |
| 43 | 2.25.1 |
| 44 | |