Skip to content

Commit

Permalink
OpenVPN server, support static-challenge formatted password, closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
AdSchellevis committed Mar 6, 2019
1 parent a98f043 commit 2c2eca7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/etc/inc/plugins.inc.d/openvpn/auth-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ function parse_auth_properties($props)
$strictusercn = $argv[4] == 'false' ? false : true;

$a_server = get_openvpn_server($modeid);
if (strpos($password, 'SCRV1:') === 0) {
// static-challenge https://github.com/OpenVPN/openvpn/blob/v2.4.7/doc/management-notes.txt#L1146
// validate and concat password into our default pin+password
$tmp = explode(':', $password);
if (count($tmp) == 3) {
$pass = base64_decode($tmp[1]);
$pin = base64_decode($tmp[2]);
if ($pass !== false && $pin !== false) {
$password = $pin . $pass;
}
}
}

// primary input validation
$error_message = null;
Expand Down

0 comments on commit 2c2eca7

Please sign in to comment.