Project

General

Profile

« Previous | Next » 

Revision 95c93bc3

Added by Ermal Luçi over 10 years ago

Fixes #4340 encode username same as with password to avoid issues with special chars.

View differences:

etc/inc/openvpn.auth-user.php
84 84

  
85 85
if (isset($_GET)) {
86 86
	$authmodes = explode(",", $_GET['authcfg']);
87
	$username = $_GET['username'];
87
	$username = base64_decode(str_replace('%3D', '=', $_GET['username']));
88 88
	$password = base64_decode(str_replace('%3D', '=', $_GET['password']));
89 89
	$common_name = $_GET['cn'];
90 90
	$modeid = $_GET['modeid'];
usr/local/sbin/ovpn_auth_verify
5 5
else
6 6
	# Single quoting $password breaks getting the value from the variable.
7 7
	password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's/=/%3D/g')
8
	username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's/=/%3D/g')
8 9
	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")
9 10
fi
10 11

  

Also available in: Unified diff