Commit 8c61c4f4 authored by Ad Schellevis's avatar Ad Schellevis

(legacy/ipsec) fixes for certref, caref, trust config data instead of...

(legacy/ipsec) fixes for certref, caref, trust config data instead of reengineering authentication_method again...
parent 3724aecb
...@@ -579,9 +579,6 @@ EOD; ...@@ -579,9 +579,6 @@ EOD;
switch ($ph1ent['authentication_method']) { switch ($ph1ent['authentication_method']) {
case 'eap-tls': case 'eap-tls':
$authentication = "leftauth=eap-tls\n\trightauth=eap-tls"; $authentication = "leftauth=eap-tls\n\trightauth=eap-tls";
if (!empty($ph1ent['certref'])) {
$authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt";
}
break; break;
case 'xauth_rsa_server': case 'xauth_rsa_server':
$authentication = "leftauth = pubkey\n\trightauth = pubkey"; $authentication = "leftauth = pubkey\n\trightauth = pubkey";
...@@ -602,6 +599,19 @@ EOD; ...@@ -602,6 +599,19 @@ EOD;
$authentication .= "\n\trightauth2 = xauth"; $authentication .= "\n\trightauth2 = xauth";
break; 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; $left_spec = $ep;
if (isset($ph1ent['reauth_enable'])) { if (isset($ph1ent['reauth_enable'])) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment