diff options
author | Ermal LUÇI <eri@pfsense.org> | 2015-04-16 19:42:12 +0200 |
---|---|---|
committer | Ermal LUÇI <eri@pfsense.org> | 2015-04-16 19:42:12 +0200 |
commit | 99d263f5871b3984f8a93024471a7b429931967f (patch) | |
tree | 8f634c769eb8cdb1b24b47b7664760a30d627914 /etc | |
parent | ff3c14a510141860973bc2923e3479ae0567d2e4 (diff) | |
parent | d09155b684b90d14ddcae6a69fb99ce8d34f5c35 (diff) | |
download | pfsense-99d263f5871b3984f8a93024471a7b429931967f.zip pfsense-99d263f5871b3984f8a93024471a7b429931967f.tar.gz |
Merge pull request #1613 from ibauersachs/ipsec-mobile-eap-radius_2-2
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/ipsec.inc | 1 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 36 |
2 files changed, 36 insertions, 1 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc index aef66fe..c81edc5 100644 --- a/etc/inc/ipsec.inc +++ b/etc/inc/ipsec.inc @@ -126,6 +126,7 @@ $p1_authentication_methods = array( 'xauth_rsa_server' => array( 'name' => 'Mutual RSA + Xauth', 'mobile' => true ), 'xauth_psk_server' => array( 'name' => 'Mutual PSK + Xauth', 'mobile' => true ), 'eap-tls' => array( 'name' => 'EAP-TLS', 'mobile' => true), + 'eap-radius' => array( 'name' => 'EAP-RADIUS', 'mobile' => true), 'eap-mschapv2' => array( 'name' => 'EAP-MSChapv2', 'mobile' => true), 'rsasig' => array( 'name' => 'Mutual RSA', 'mobile' => false ), 'pre_shared_key' => array( 'name' => 'Mutual PSK', 'mobile' => false ) ); diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index 5ae011b..103bd70 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -374,6 +374,28 @@ EOD; $strongswan .= "\tplugins {\n"; + $a_servers = auth_get_authserver_list(); + foreach ($a_servers as $id => $pconfig) { + if ($id == $config['ipsec']['client']['user_source'] && $pconfig['type'] == "radius") { + $strongswan .= <<<EOD + eap-radius { + class_group = yes + eap_start = no + servers { + primary { + address = {$pconfig['host']} + secret = {$pconfig['radius_secret']} + auth_port = {$pconfig['radius_auth_port']} + acct_port = {$pconfig['radius_acct_port']} + } + } + } + +EOD; + break; + } + } + if (is_array($a_client) && isset($a_client['enable'])) { $strongswan .= "\t\tattr {\n"; if ($a_client['pool_address'] && $a_client['pool_netbits']) @@ -500,7 +522,7 @@ EOD; continue; if (strstr($ph1ent['authentication_method'], 'rsa') || - in_array($ph1ent['authentication_method'], array('eap-mschapv2', 'eap-tls'))) { + in_array($ph1ent['authentication_method'], array('eap-mschapv2', 'eap-tls', 'eap-radius'))) { $certline = ''; $ikeid = $ph1ent['ikeid']; @@ -778,6 +800,18 @@ EOD; $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; } break; + case 'eap-radius': + if (isset($ph1ent['mobile'])) { + $authentication = "eap_identity=%identity\n\t"; + $authentication .= "leftauth=pubkey\n\trightauth=eap-radius"; + if (!empty($ph1ent['certref'])) + $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; + } else { + $authentication = "leftauth=eap-radius\n\trightauth=eap-radius"; + if (!empty($ph1ent['certref'])) + $authentication .= "\n\tleftcert={$certpath}/cert-{$ph1ent['ikeid']}.crt"; + } + break; case 'xauth_rsa_server': $authentication = "leftauth = pubkey\n\trightauth = pubkey"; $authentication .= "\n\trightauth2 = xauth-generic"; |