diff options
author | Matt Smith <mgsmith@netgate.com> | 2015-10-15 10:30:38 -0500 |
---|---|---|
committer | Matt Smith <mgsmith@netgate.com> | 2015-10-15 10:30:38 -0500 |
commit | 7a7e1ba909e37d237e36c43a847faecfdf9559b5 (patch) | |
tree | 9fc56800d12247d7eab7abb2ede8544a0fdc4c14 /src | |
parent | ea148bd7b3201b40f1722c51b9429af74eecc7ce (diff) | |
download | pfsense-7a7e1ba909e37d237e36c43a847faecfdf9559b5.zip pfsense-7a7e1ba909e37d237e36c43a847faecfdf9559b5.tar.gz |
Set rightca for IPsec phase 1 using Mutual RSA, Mutual RSA + xauth, or EAP-TLS. Fixes #5241.
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/vpn.inc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/etc/inc/vpn.inc b/src/etc/inc/vpn.inc index a529cfa..62c5fa2 100644 --- a/src/etc/inc/vpn.inc +++ b/src/etc/inc/vpn.inc @@ -951,6 +951,21 @@ EOD; } } + if (!empty($ph1ent['caref'])) { + $ca = lookup_ca($ph1ent['caref']); + if ($ca) { + $casubarr = cert_get_subject_array($ca['crt']); + $casub = ""; + foreach ($casubarr as $casubfield) { + if (empty($casub)) { + $casub = "/"; + } + $casub .= "{$casubfield['a']}={$casubfield['v']}/"; + } + + } + } + $authentication = ""; switch ($ph1ent['authentication_method']) { case 'eap-mschapv2': @@ -975,6 +990,9 @@ EOD; $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; } } + if (isset($casub)) { + $authentication .= "\n\trightca=\"$casub\""; + } break; case 'eap-radius': if (isset($ph1ent['mobile'])) { @@ -996,6 +1014,9 @@ EOD; if (!empty($ph1ent['certref'])) { $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; } + if (isset($casub)) { + $authentication .= "\n\trightca=\"$casub\""; + } break; case 'xauth_psk_server': $authentication = "leftauth = psk\n\trightauth = psk"; @@ -1009,6 +1030,9 @@ EOD; if (!empty($ph1ent['certref'])) { $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; } + if (isset($casub)) { + $authentication .= "\n\trightca=\"$casub\""; + } break; case 'hybrid_rsa_server': $authentication = "leftauth = pubkey\n\trightauth = xauth-generic"; |