Project

General

Profile

Bug #4521 » 154.diff

Viktor Gurov, 02/26/2021 08:41 AM

View differences:

src/usr/local/sbin/ovpn_auth_verify
24 24
	for check_depth in $(/usr/bin/seq ${3} -1 0)
25 25
	do
26 26
		eval serial="\$tls_serial_${check_depth}"
27
		RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.tls-verify.php -d "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
27
		RESULT=$(/usr/local/bin/php-cgi -q /etc/inc/openvpn.tls-verify.php "servercn=$2&depth=$3&certdepth=$4&certsubject=$5&serial=$serial&config=$config")
28 28
	done
29 29
else
30 30
	# Single quoting $password breaks getting the value from the variable.
31 31
	# Base64 and urlEncode usernames and passwords
32 32
	password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
33 33
	username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
34
	RESULT=$(/usr/local/sbin/fcgicli -f /etc/inc/openvpn.auth-user.php -d "username=$username&password=$password&cn=$common_name&strictcn=$3&authcfg=$2&modeid=$4&nas_port=$5")
34
	RESULT=$(/usr/local/bin/php-cgi -q /etc/inc/openvpn.auth-user.php "username=$username&password=$password&cn=$common_name&strictcn=$3&authcfg=$2&modeid=$4&nas_port=$5")
35 35
fi
36 36

  
37 37
if [ "${RESULT}" = "OK" ]; then
(1-1/2)