Skip to content

Commit

Permalink
(legacy/ipsec) fixes for certref, caref, trust config data instead of…
Browse files Browse the repository at this point in the history
… reengineering authentication_method again...
  • Loading branch information
AdSchellevis committed Jan 8, 2016
1 parent 3724aec commit 8c61c4f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/etc/inc/vpn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,6 @@ EOD;
switch ($ph1ent['authentication_method']) {
case 'eap-tls':
$authentication = "leftauth=eap-tls\n\trightauth=eap-tls";
if (!empty($ph1ent['certref'])) {
$authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt";
}
break;
case 'xauth_rsa_server':
$authentication = "leftauth = pubkey\n\trightauth = pubkey";
Expand All @@ -602,6 +599,19 @@ EOD;
$authentication .= "\n\trightauth2 = xauth";
break;
}
if (!empty($ph1ent['certref'])) {
$authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt";
}
if (!empty($ph1ent['caref'])) {
$ca = lookup_ca($ph1ent['caref']);;
if (!empty($ca)) {
$rightca = "";
foreach (cert_get_subject_array($ca['crt']) as $ca_field) {
$rightca .= "{$ca_field['a']}={$ca_field['v']}/";
}
$authentication .= "\n\trightca=\"/$rightca\"";
}
}
$left_spec = $ep;

if (isset($ph1ent['reauth_enable'])) {
Expand Down

0 comments on commit 8c61c4f

Please sign in to comment.