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