From 9314298f103bde09035a4e8769b69bfe7a60b9ca Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 23 Feb 2015 05:46:26 +0100 Subject: [PATCH] openvpn: proper style and a TODO for zapping OpenSSL (#42) --- src/sbin/ovpn_auth_verify | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sbin/ovpn_auth_verify b/src/sbin/ovpn_auth_verify index b2f3e2ba5..a15786025 100755 --- a/src/sbin/ovpn_auth_verify +++ b/src/sbin/ovpn_auth_verify @@ -1,14 +1,14 @@ #!/bin/sh + if [ "$1" = "tls" ]; then - (/usr/local/bin/php /usr/local/etc/inc/openvpn.tls-verify.php -d "$2" "$3") - exit $? + /usr/local/bin/php /usr/local/etc/inc/openvpn.tls-verify.php -d "$2" "$3" else # Single quoting $password breaks getting the value from the variable. - password=$(echo -n "${password}" | openssl enc -base64 | sed -e 's/=/%3D/g') - username=$(echo -n "${username}" | openssl enc -base64 | sed -e 's/=/%3D/g') + # XXX I really don't like going through openssl for this... + password=$(echo -n "${password}" | /usr/local/bin/openssl enc -base64 | sed -e 's/=/%3D/g') + username=$(echo -n "${username}" | /usr/local/bin/openssl enc -base64 | sed -e 's/=/%3D/g') - (/usr/local/bin/php /usr/local/etc/inc/openvpn.auth-user.php "$username" "$password" "$common_name" "$3" "$2" "$4") - exit $? + /usr/local/bin/php /usr/local/etc/inc/openvpn.auth-user.php "$username" "$password" "$common_name" "$3" "$2" "$4" fi -exit 1 +exit $?