From 7530177c7c59795b4e5c0767453444837ee5d622 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 12 Jun 2012 15:10:24 -0400 Subject: Generalize the Crypto hardware option and add GUI support for AES-NI. --- etc/inc/globals.inc | 2 +- etc/inc/pfsense-utils.inc | 16 +++++++++++----- etc/inc/upgrade_config.inc | 8 +++++++- etc/rc.bootup | 4 ++-- 4 files changed, 21 insertions(+), 9 deletions(-) (limited to 'etc') diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 711d1f5..519f28c 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -77,7 +77,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "http://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "8.7", + "latest_config" => "8.8", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 9402eb7..ef2a4f8 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1498,13 +1498,19 @@ function compare_hostname_to_dnscache($hostname) { } /* - * load_glxsb() - Load the glxsb crypto module if enabled in config. + * load_crypto() - Load crypto modules if enabled in config. */ -function load_glxsb() { +function load_crypto() { global $config, $g; - $is_loaded = `/sbin/kldstat | /usr/bin/grep -c glxsb`; - if (isset($config['system']['glxsb_enable']) && ($is_loaded == 0)) { - mwexec("/sbin/kldload glxsb"); + $crypto_modules = array('glxsb', 'aesni'); + + if (!in_array($config['system']['crypto_hardware'], $crypto_modules)) + return false; + + $is_loaded = `/sbin/kldstat | /usr/bin/grep -c {$config['system']['crypto_hardware']}`; + if (!empty($config['system']['crypto_hardware']) && ($is_loaded == 0)) { + log_error("Loading {$config['system']['crypto_hardware']} cryptographic accelerator module."); + mwexec("/sbin/kldload {$config['system']['crypto_hardware']}"); } } diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 04b6a71..b8bb978 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -2876,5 +2876,11 @@ function upgrade_086_to_087() { } } } - +function upgrade_087_to_088() { + global $config; + if (isset($config['system']['glxsb_enable'])) { + unset($config['system']['glxsb_enable']); + $config['system']['crypto_hardware'] = "glxsb"; + } +} ?> diff --git a/etc/rc.bootup b/etc/rc.bootup index 8b78866..a4479ab 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -215,8 +215,8 @@ echo "Setting up extended sysctls..."; system_setup_sysctl(); echo "done.\n"; -/* enable glxsb if wanted */ -load_glxsb(); +/* enable optional crypto modules */ +load_crypto(); /* run any early shell commands specified in config.xml */ system_do_shell_commands(1); -- cgit v1.1