Skip to content

Commit

Permalink
Revert "Change OpenVPN auth to php-cgi for the time being. Fixes pfse…
Browse files Browse the repository at this point in the history
…nse#4521"

This reverts commit 1bfdb79.
  • Loading branch information
Reid Linnemann committed Nov 4, 2022
1 parent fef6c79 commit 758ee42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/usr/local/sbin/ovpn_auth_verify
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if [ "$1" = "tls" ]; then
do
eval serial="\$tls_serial_${check_depth}"
if [ -n "$serial" ]; then
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")
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")
if [ "${RESULT}" = "FAILED" ]; then
exit 1
fi
Expand All @@ -36,7 +36,7 @@ else
# Base64 and urlEncode usernames and passwords
password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's_=_%3D_g;s_+_%2B_g;s_/_%2F_g')
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")
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")
fi

if [ "${RESULT}" = "OK" ]; then
Expand Down
4 changes: 2 additions & 2 deletions src/usr/local/sbin/ovpn_auth_verify_async
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# nas_port - $5

# ---------- Command Definitions
phpcgi="/usr/local/bin/php-cgi"
fcgicli="/usr/local/sbin/fcgicli"
openssl="/usr/bin/openssl"
sed="/usr/bin/sed"
auth_user_php="/etc/inc/openvpn.auth-user.php"
Expand Down Expand Up @@ -66,7 +66,7 @@ auth_server_1="cn=${common_name}&strictcn=${strictcn}&authcfg=${authcfg}&dev=${d
auth_server_2="modeid=${modeid}&nas_port=${nas_port}"
auth_args="${auth_credentials}&${auth_server_1}&${auth_server_2}"

result=$("${phpcgi}" -f "${auth_user_php}" "${auth_args}")
result=$("${fcgicli}" -f "${auth_user_php}" -d "${auth_args}")

# ---------- Write the Result

Expand Down

0 comments on commit 758ee42

Please sign in to comment.