mirror of
https://github.com/lucaspalomodevelop/opnsense-core.git
synced 2026-03-13 00:07:27 +00:00
system: samplify dh-parameter files #2431
This commit is contained in:
parent
2f247f2f85
commit
d840e9acad
2
Makefile
2
Makefile
@ -338,7 +338,7 @@ license: want-p5-File-Slurp
|
||||
dhparam:
|
||||
.for BITS in 1024 2048 4096
|
||||
${OPENSSL} dhparam -out \
|
||||
${.CURDIR}/src/etc/dh-parameters.${BITS} ${BITS}
|
||||
${.CURDIR}/src/etc/dh-parameters.${BITS}.sample ${BITS}
|
||||
.endfor
|
||||
|
||||
test: want-phpunit6-php${CORE_PHP}
|
||||
|
||||
6
plist
6
plist
@ -2,9 +2,6 @@
|
||||
/boot/logo-hourglass.4th
|
||||
/usr/local/etc/devd/carp.conf
|
||||
/usr/local/etc/devd/ifnet.conf
|
||||
/usr/local/etc/dh-parameters.1024
|
||||
/usr/local/etc/dh-parameters.2048
|
||||
/usr/local/etc/dh-parameters.4096
|
||||
/usr/local/etc/inc/IPv6.inc
|
||||
/usr/local/etc/inc/PEAR.inc
|
||||
/usr/local/etc/inc/XMLRPC_Client.inc
|
||||
@ -1203,6 +1200,9 @@
|
||||
@sample /usr/local/etc/bogons.sample
|
||||
@sample /usr/local/etc/bogonsv6.sample
|
||||
@sample /usr/local/etc/config.xml.sample
|
||||
@sample /usr/local/etc/dh-parameters.1024.sample
|
||||
@sample /usr/local/etc/dh-parameters.2048.sample
|
||||
@sample /usr/local/etc/dh-parameters.4096.sample
|
||||
@sample /usr/local/opnsense/service/templates/OPNsense/IDS/custom.yaml.sample
|
||||
@shadow /usr/local/etc/pkg/repos/FreeBSD.conf.sample
|
||||
@shadow /usr/local/etc/pkg/repos/origin.conf.sample
|
||||
|
||||
@ -893,7 +893,7 @@ function openvpn_reconfigure($mode, $settings, $device_only = false)
|
||||
openvpn_add_keyfile($cert['prv'], $conf, $mode_id, "key");
|
||||
}
|
||||
if ($mode == 'server') {
|
||||
$conf .= "dh /usr/local/etc/dh-parameters.{$settings['dh_length']}\n";
|
||||
$conf .= "dh " . get_dh_parameters($settings['dh_length']) . "\n";
|
||||
}
|
||||
if (!empty($settings['crlref'])) {
|
||||
$crl = lookup_crl($settings['crlref']);
|
||||
|
||||
@ -376,7 +376,7 @@ EOD;
|
||||
$lighty_config .= "\n## ssl configuration\n";
|
||||
$lighty_config .= "ssl.engine = \"enable\"\n";
|
||||
$lighty_config .= "ssl.disable-client-renegotiation = \"enable\"\n";
|
||||
$lighty_config .= "ssl.dh-file = \"/usr/local/etc/dh-parameters.4096\"\n";
|
||||
$lighty_config .= "ssl.dh-file = \"" . get_dh_parameters(4096) . "\"\n";
|
||||
$lighty_config .= "ssl.ec-curve = \"secp384r1\"\n";
|
||||
$lighty_config .= "ssl.pemfile = \"/var/etc/{$cert_location}\"\n";
|
||||
if (!empty($ca)) {
|
||||
|
||||
@ -1,32 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (C) 2015-2017 Franco Fichtner <franco@opnsense.org>
|
||||
Copyright (C) 2004-2007 Scott Ullrich <sullrich@gmail.com>
|
||||
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
* Copyright (C) 2015-2018 Franco Fichtner <franco@opnsense.org>
|
||||
* Copyright (C) 2004-2007 Scott Ullrich <sullrich@gmail.com>
|
||||
* Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
require_once("IPv6.inc");
|
||||
|
||||
@ -76,6 +76,18 @@ function is_process_running($process)
|
||||
return (intval($retval) == 0);
|
||||
}
|
||||
|
||||
function get_dh_parameters($bits)
|
||||
{
|
||||
/*
|
||||
* XXX Use the sample file for now. Later we want to
|
||||
* try to see if the non-sample file is newer, in these
|
||||
* cases we can use it. If not, fall back to the sample
|
||||
* file which should give a flexible and fixable apporach
|
||||
* that does not leave users open to stale files.
|
||||
*/
|
||||
return "/usr/local/etc/dh-parameters.$bits.sample";
|
||||
}
|
||||
|
||||
function is_subsystem_dirty($subsystem = '')
|
||||
{
|
||||
return file_exists("/tmp/{$subsystem}.dirty");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user