From e4b7410b9bc3622cee6797588a7d5a685d4d759e Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Fri, 17 Jul 2015 09:51:15 -0300 Subject: Fix #4794: - Add a upgrade code to fix asn1dn string format to match strongSwan needs - Bump config version to 11.8 --- conf.default/config.xml | 2 +- etc/inc/globals.inc | 2 +- etc/inc/upgrade_config.inc | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/conf.default/config.xml b/conf.default/config.xml index 46afa50..6a6da59 100644 --- a/conf.default/config.xml +++ b/conf.default/config.xml @@ -1,6 +1,6 @@ - 11.7 + 11.8 pfsense_ng diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 6cf1150..7a8a09a 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -74,7 +74,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "11.7", + "latest_config" => "11.8", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 96f0325..a60b966 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -3566,4 +3566,25 @@ function upgrade_116_to_117() { } +function upgrade_117_to_118() { + global $config; + + if (!isset($config['ipsec']['phase1'])) { + return; + } + + $a_phase1 =& $config['ipsec']['phase1']; + + foreach ($a_phase1 as &$ph1_entry) { + if (isset($ph1_entry['myid_type']) && $ph1_entry['myid_type'] == 'asn1dn') { + $ph1_entry['myid_data'] = + preg_replace('/\/\s*emailAddress\s*=\s*/', ', E=', $ph1_entry['myid_data']); + } + if (isset($ph1_entry['peerid_type']) && $ph1_entry['peerid_type'] == 'asn1dn') { + $ph1_entry['peerid_data'] = + preg_replace('/\/\s*emailAddress\s*=\s*/', ', E=', $ph1_entry['peerid_data']); + } + } +} + ?> -- cgit v1.1